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

From: Michael Sperber <sperber>
Date: Wed Feb 21 12:43:02 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
Received on Wed Feb 21 2007 - 12:42:59 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC