Re: what about dropping rest-lists?
Neil W. Van Dyke 17 May 2005 12:26 UTC
Sebastian Egner <xxxxxx@philips.com> wrote at 2005-05-17T10:51:31+0200:
> And if you really need the rest-list thing (the day will come),
> the meaning will at least be obvious.
How about a keyword named "rest", with parens around the keyword and
variable identifier? The parens emphasize to human readers that the
"rest" name is in a keyword position and therefore should not be
mistaken for a variable identifier?
(let ( (a b c d (values 1 2 3 4)) ) c) ;=> 3
(let ( (a b (rest x) (values 1 2 3 4)) ) x) ;=> (3 4)
(let ( ((rest x) (values 1 2 3 4)) ) x) ;=> (1 2 3 4)
(let ( (a b (rest x) (values 1 2 3 4)) ) x) ;=> (3 4)
(let ( (a b (rest rest) (values 1 2 3 4)) ) rest) ;=> (3 4)
--
http://www.neilvandyke.org/