[plt-scheme] lambda argument lists that contain only a rest argument

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Mar 22 01:23:46 EDT 2007

On Mar 21, Ethan Herdrick wrote:
> Why is this OK:
> (define (rest-only . r)
>   r)
> But this can't even be read into the interpreter:
> (define rest-only
>   (λ ( . r)
>     r))
> ...and what can I do about it?  I want to be able to make a lambda
> that may take 0 or more arguments.

Use this:

  (define rest-only
    (λ r

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.