Beni Cherniavsky <cben@crosswinds.net> wrote:
+---------------
| > ((lambda (x y . z) z)
| > 3 4 5 6) ==> (5 6)
| > Note that there must be at least one formal argument preceeding the '.' !
|
| Actually this is an improper list: the last cdr isn't (). The simplest
| improper list consists of only one value - then it's not written as
| (a b c . rest)
| but as
| rest
| In other words you *can* have a function with all arguments possible,
+---------------
Correct so far, if you're talking about the (lambda rest body...) form.
+---------------
| it just won't fit into the above notation:
| (define (function rest) ...)
+---------------
Uh, no, sorry. The shorthand define form still *does* use a dot, because
of the procedure name. That is, the following two are the same:
(define foo (lambda rest body...))
(define (foo . rest) body...)
[Hint: What is (cdr '(foo . rest))?]
-Rob
-----
Rob Warnock, 31-2-510 rpw3@sgi.com
SGI Network Engineering http://reality.sgi.com/rpw3/
1600 Amphitheatre Pkwy. Phone: 650-933-1673
Mountain View, CA 94043 PP-ASEL-IA