Subject: Re: What the heck is ( . a ) ?
From: (Rob Warnock)
Date: 1997/09/18
Newsgroups: comp.lang.scheme
Message-ID: <5vsa06$>

Barry Margolin  <> wrote:
| Erick Gallesio <> wrote:
| >student program which found natural to code something like:
| >    (define foo (lambda ( . args)  ....)
| It also seems like this would be very natural mistake for programmers
| switching from Common Lisp to Scheme.  The CL lambda-list syntax is
|     (<named args> &rest <rest-arg>)
| The Scheme syntax usually just substitutes "." for "&rest".  The degenerate
| case in CL is (&rest <rest-arg>), so (. <rest-arg>) would seem to make sense.

And amusingly enough, this is exactly the syntax I chose when defining
an "parenthesis-lite" infix dialect of Scheme for some non-programmers
to use locally in a certain application [but that's another story]:

	fn <arglist> in <cmd>           Anonymous function (Scheme's "lambda")
	   arglist forms:
		fn in <exp>             no arguments
		fn a b c in <exp>       exactly 3 args
		fn a b . c in <exp>     2 required args, "c" gets list of rest
		fn . a in <exp>         "a" gets list of args (may be empty)

So it's it's a bit odd that I would argue [previously in this forum]
*against* interpreting "( . a)" as "a".  O.k., o.k., I recant!


Rob Warnock, 7L-551
Silicon Graphics, Inc.		Phone: 650-933-1673 [New area code!]
2011 N. Shoreline Blvd.		FAX: 650-933-4392
Mountain View, CA  94043	PP-ASEL-IA