[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] Some comments after reading the r7rs public draft
-----BEGIN PGP SIGNED MESSAGE-----
On 06/09/2012 07:22 PM, Alex Shinn wrote:
> On Sun, Jun 10, 2012 at 9:57 AM, Ray Dillinger <bear@x>
>> Scheme's "delay" and "force" have never really made strong
>> enough guarantees that delayed promises will not be computed
>> unless forced. The language allows implicit forcing whenever a
>> promise is referred to.
> If this were true it would definitely make delay completely
> unusable, however it is not true.
> What RnRS allow is "implicit forcing" when passing a promise to a
> primitive "like `cdr' and`+'", with the example
> (+ (delay (* 3 7)) 13) => 34
> given. This is obviously vague, but the intent is that primitives
> which immediately need the actual value are allowed to do an
> implicit force. Other primitives like "cons" for instance, don't
> care what the value is and should not perform an implicit force -
> otherwise you couldn't build a stream.
Due to the "vagueness," I have (since R3RS at least)
regarded streams relying on delayed functions as a bit
of magic that works, not because the implementors are
following the spec, but rather because implementors are
flatly refusing to follow a spec which permits a
completely useless result in such a way as to actually
*produce* a completely useless result.
If you claim that the behavior people have been
implementing is something that the spec has required
all along, I think you are wrong. If you claim that
it is something the spec has permitted and ought to
have required all along, I think you are right.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
Scheme-reports mailing list