[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: feeley@xxxxxxxxxxxxxxxx*Subject*: Re: Moving ahead*From*: Alhambra Petrofsky <alhambra@xxxxxxxxxxxxx>*Date*: Sat, 8 Mar 2003 09:09:06 -0800*Cc*: felixundduni@xxxxxxxxxx, srfi-39@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-39@xxxxxxxxxxxxxxxxx*In-reply-to*: <200303081437.h28EbZds008351@xxxxxxxxxxxxxxxxxxxxxxx> (message from Marc Feeley on Sat, 8 Mar 2003 09:37:35 -0500)*References*: <200303072209.h27M9Uad005975@xxxxxxxxxxxxxxxxxxxxxxx> <3E69EE42.3000101@xxxxxxxxxx> <200303081437.h28EbZds008351@xxxxxxxxxxxxxxxxxxxxxxx>

> From: Marc Feeley <feeley@xxxxxxxxxxxxxxxx> > Note that the lambda form does not close over the dynamic > environment so why should it be different from delay? Well if you > did this the "dynamic environment" would in fact be the lexical > environment so you would lose all the benefits of dynamic binding. > When one writes a function with lambda there is an expectation that > the dynamic environment is abstracted over. However when using a > DELAY the expectation is that only the evaluation time is changed, > not the computation being performed (unless side-effects are > performed that expose the evaluation order). Do you agree that what you are proposing violates the r5rs specification of delay? If so, do you really think it's worth the incompatibility? Perhaps you should use a different name, like dynamic-delay. Dynamic-delay can be portably implemented as shown below, at least with respect to a single-threaded r5rs system with dynamic-wind: (define-syntax dynamic-delay (syntax-rules () ((_ expr) ((call-with-current-continuation (lambda (k1) (lambda () (delay (call-with-current-continuation (lambda (k2) (k1 (lambda () (k2 expr))))))))))))) (let* ((x #f) (promise (delay x))) (dynamic-wind (lambda () (set! x #t)) (lambda () (force x)) (lambda () (set! x #f)))) => #t (let* ((x #f) (promise (dynamic-delay x))) (dynamic-wind (lambda () (set! x #t)) (lambda () (force promise)) (lambda () (set! x #f)))) => #f -al

**Follow-Ups**:**Re: Moving ahead***From:*Marc Feeley

**References**:**Moving ahead***From:*Marc Feeley

**Re: Moving ahead***From:*felix

**Re: Moving ahead***From:*Marc Feeley

- Prev by Date:
**Re: Moving ahead** - Next by Date:
**Re: Moving ahead** - Previous by thread:
**Re: Moving ahead** - Next by thread:
**Re: Moving ahead** - Index(es):