[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] Some comments after reading the r7rs public draft
On 06/12/2012 12:07 PM, John Cowan wrote:
> Per Bothner scripsit:
>> (Though a future version of Kawa might optimize (delay 4) to 4,
>> that's OK, since I can't think of a use case for you needing
>> the delay to evaluate specifically to a promise.)
> As I keep saying, the use case is to be able to write procedures that
> are guaranteed to return a promise that the caller may safely force.
> The only way to accomplish this in the presence of insta-forcing is
> to require `force` to return its argument if it is not a promise.
Certainly: If you have automatic forcing, then I'm pretty sure you
want force to be a no-op when passed a non-promise. And definitely
if you allow optimizing (delay 4) to 4. Kawa does this:
(force (+ 4 5)) ==> 9
Scheme-reports mailing list