[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] Formal Comment: R7RS 'eqv?' cannot be used for reliable memoization
-----BEGIN PGP SIGNED MESSAGE-----
On 11/21/2012 06:34 PM, Vassil Nikolov wrote:
> On Tue, 20 Nov 2012 00:57:19 -0800, Ray Dillinger <bear@x>
>> ... Branch cut selectors are strictly unnecessary in a language
>> that has the ability to return multiple values from a function;
>> the alternative is to simply return both (or all) answers at
>> non-continuous points.
> I wonder if this road doesn't lead further along to returning
> infinitely many values. There are (probably) ways to handle that
> as well, but beyond the remit of the R7RS working groups...
There's a semantic difference between returning multiple values
and returning multivalences as values.
A function like integer-division may return multiple values;
the quotient and the remainder. But these values have different
semantic loading, and it's important that the continuation, if it
captures and binds both values, remembers a different meaning for
A function like square-root, OTOH, may return a multivalence;
2 and -2 for example are both equally true answers for the square
root of 4. These values have the same semantic loading; they are
both answers to the same question. The same is true of, eg,
database queries, etc.
In Lispy languages, we tend to fake both by using lists. But
that is, IMO, not quite right. Sometimes the difference is
important and we'd like to know more about the meaning conveyed.
Using the same abstraction for both tends to lose information.
As Mark Weaver pointed out, if you have multivalences, you will
usually be required to select *one* of them because some client
somewhere won't want to know their question had more than one
answer. And in fact, will demand to be kept in ignorance, treating
additional correct answers as a bug.
-----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