[r6rs-discuss] [Formal] SRFI-39 should be made an R6RS library

Michael Sperber sperber at informatik.uni-tuebingen.de
Wed Feb 21 12:42:59 EST 2007


"R. Kent Dybvig" <dyb at cs.indiana.edu> writes:

>> > Okay, but where's the definition of parameterize in terms of your
>> > dynamic binding construct?  It didn't make it into your note.
>>
>> I was assuming I'd use your definition unchanged.
>
> [...]
> I'm looking for proof of this claim, i.e., a definition of the parameter
> mechanism in terms of your dynamic-binding mechanism and thread-local
> storage.  So far you've only offered up a definition of make-parameter
> that is independent of your dynamic-binding mechanism and no definition of
> parameterize.

I wrote:

>> I was assuming I'd use your definition unchanged.

But, to repeat, here's your definition:

  (define-syntax parameterize
    (lambda (x)
      (syntax-case x ()
        [(_ ((x v) ...) e1 e2 ...)
         (with-syntax ([(p ...) (generate-temporaries #'(x ...))]
                       [(y ...) (generate-temporaries #'(x ...))])
           #'(let ([p x] ... [y v] ...)
               (let ([swap (lambda () (let ([t (p)]) (p y) (set! y t)) ...)])
                 (dynamic-wind #t swap (lambda () e1 e2 ...) swap))))])))

How does it fall down?

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



More information about the r6rs-discuss mailing list