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

Re: small Q



In article <398F2D0B.EB3781D5@lotus.com>, Brian Campbell 
<Brian_Campbell@lotus.com> wrote:

> Since I'm comming from a long history of one return value programming
> languages (Scheme R4RS, SmallTalk, C, Java, PASCAL, etc.), could someone
> describe where multiple return values would be useful and not just a
> convenience?

The debate over what is essential and what is mere convenience is 
impossible to decide.  When it comes down to it, you don't *need* 
anything more than raw lambda and applicative order evaluation.  You 
don't *need* objects, you don't *need* numbers, you don't even *need* 
"if".

Re multiple value return in particular:

  - R5RS Scheme has values and call-with-values, so they obviously
    think it's useful.  And you don't have to go any further than
    SICP to see plenty of code that would benefit from it.

  - most of the other languages you list have either VAR parameters
    or pointers, which permit multiple return values using a less
    convenient syntax and reference semantics instead of Dylan's
    value semantics.

  - "scripting" languages such as Perl which permit anonymous
    data structures to be created, retuned, and destructured
    don't need multiple return values but impose additional
    (and possibly unwanted) semantics and constraints on the
    implementation.

-- Bruce



Follow-Ups: References: