Re: [Scheme-reports] Some comments after reading the r7rs public draft John Cowan (11 Jun 2012 21:10 UTC)
[Scheme-reports] Unsafe optimizations Göran Weinholt (13 Jun 2012 11:48 UTC)

Re: [Scheme-reports] Some comments after reading the r7rs public draft John Cowan 11 Jun 2012 21:09 UTC

Emmanuel Medernach scripsit:

>   I agree that making a promise with an immediate value could evaluate
> to that immediate instead of creating a promise.

That's where make-promise (formerly known as eager) comes in: it allows
you to return an object to your caller that is guaranteed to be a
promise.  This allows promise-based APIs, where the caller knows he can
safely force the return value.

> But in general I think that a promise have to be opaque until forced
> and that it is worth to have a disjoint type for promises and to be
> able to check if an object is a promise or not.

Ticket #405 filed.

> IMHO for any other usage auto-forcing in primitives strongly sounds
> as being in the "it seems a good idea at that time" department:
> auto-forcing means that primitives have to check if something is a
> promise and forcing it in that case, adding this check add a cost and
> it has deep impact on the language semantics.

It does add a cost, but the cost is paid only by users of an
implementation (such as Kawa) that does auto-forcing.  The impact
is actually quite shallow: it simply makes some functions mildly
polymorphic.

--
Andrew Watt on Microsoft:                       John Cowan
Never in the field of human computing           cowan@ccil.org
has so much been paid by so many                http://www.ccil.org/~cowan
to so few! (pace Winston Churchill)

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports