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

what about dropping rest-lists?



When thinking of single-value return as just a case of multiple-value
return, I like the clean syntactic symmetry between:

    (let ( (a     (foo)) ) ...)

and:

    (let ( (a b c (bar)) ) ...)

The "values" keyword as a kludge to support rest-lists, however, strikes
me as a syntactically ugly way to support an operation that I'd expect
to use only rarely.

If rest-lists are to be supported, I'd like a cleaner syntax.  What that
syntax should be, I have no good suggestion.  The historical syntax of
the single-value binding clause of "let" precludes good syntactic
symmetry with "lambda"'s argument syntax, and it also adds extra parens
to the most common case, which is a single-value binding:

    (let ( ((a)     (foo)) ) ...)
    (let ( ((a b c) (bar)) ) ...)
    (let ( (x       (bar)) ) ...)

In summary, I'd really like to see "let", "let*", "letrec", and
"letrec*" extended for multiple-value, but would like to drop the
"(value ...)" syntax, even if that means dropping rest-list support.

-- 
                                             http://www.neilvandyke.org/