[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: srfi-39 implementation
From: |
Kevin Ryde |
Subject: |
Re: srfi-39 implementation |
Date: |
Sun, 09 May 2004 10:48:04 +1000 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) |
Jose A Ortega Ruiz <address@hidden> writes:
>
> I'd be glad to transfer the copyright to the FSF (if needed; it's
> barely 30 loc without comments)
Paperwork will be required if adopted.
> together with a little test program.
Tests are vital, you'll never know if it works if you don't exercise
all features.
> #:use-module (ice-9 syncase)
I believe syncase is pretty big and not very fast. define-macro or
similar is probably a better idea. (And with enough quasiquote might
hide all helpers :).
> (define make-parameter
> (case-lambda
> ((val) (make-parameter/helper val (lambda (x) x)))
^^^^
`identity' in boot-9.
> (define get-fluid-tag (lambda () 'get-fluid)) ;; arbitrary unique (as per
> eq?) value
make-symbol perhaps.
> (define (make-parameter/helper val conv)
How does this stand in comparison to make-mutable-parameter in boot-9?
Similar but not quite the same?
> ((eq? (car new-value) get-fluid-tag) value)
> ((eq? (car new-value) get-conv-tag) conv)
Perhaps primitive-make-property or something to associate these,
instead of a function call. (If I understand what it's trying to do.)
> (define (check a b a-val b-val)
> (if (not (eqv? (a) a-val)) (error "failure -- a" (a) a-val))
> (if (not (eqv? (b) b-val)) (error "failure -- b" (b) b-val)))
No, you should use the test-suite/lib.scm framework.