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

Re: [Scheme-reports] Some comments after reading the r7rs public draft

Aaron W. Hsu scripsit:

> This is not clear to me.  What about the dynamic extent in which the
> thunk is evaluated? This affects parameters.

That's true, but it's a general problem which we have to resolve.
What are we going to do about code like this:

(define foo (make-parameter 0))
(define bar (delay (foo)))
(parameterize ((foo 1)) (force bar))

Does this return 0, 1, or either?  All the Schemes in my test suite that
support SRFI 39 return 1.

> Additionally, there is no
> gain to forking a thread at force time, because force must wait for the
> return any ways.

No, the idea is for `delay` to fork a thread and `force` to join it (unless
the result is already cached).

> This is better done with the clearer and already existing futures
> feature that some implementation have.

I don't object to this, provided futures degenerate to promises if no
parallel execution is possible.

You annoy me, Rattray!  You disgust me!         John Cowan
You irritate me unspeakably!  Thank Heaven,     cowan@x
I am a man of equable temper, or I should       http://www.ccil.org/~cowan
scarcely be able to contain myself before
your mocking visage.            --Stalky imitating Macrea

Scheme-reports mailing list