Marc Feeley <xxxxxx@iro.umontreal.ca> writes:
> The new syntax does away with the `#!optional', `#!key' and `#!rest'
> markers. Instead, a syntax that is inspired from EBNF is used to
> denote optional parts (square brackets in the parameter list around
> the optional parameters).
Considering that R6RS will standardize brackets as being
equivalent to parentheses[1], this SRFI will also allow
(define (myproc required (optional #f) (key: key #t))
...)
I assume this is intended, and I want to state that I like this
syntax, and I definitively prefer it very much over the old.
It /might/ be preferable to some people if this SRFI would specify
LAMBDA-KW and DEFINE-KW special forms (the names up for debate of
course) instead of shadowing R5RS’ forms. A useful module system
can be used to explicitly shadow the R5RS forms if someone
requires the extended capabilities in LAMBDA and DEFINE itself.
This SRFI allows the following function definition:
(define (foo (bar: bar 2) (baz 3))
...)
But for this procedure, it would disallow the analogical
invocation:
(foo bar: 5 'baz-value)
In this example, BAZ is bound to the keyword BAR:, and the
application then is invalid due to too many arguments. To make
this dependence on order explicit, I think it would be useful to
only allow optional arguments to be specified before keyword
arguments.
Regards,
-- Jorgen
[1] The March 2005 R6RS Status Report
http://www.schemers.org/Documents/Standards/Charter/mar-2005.txt
--
((email . "xxxxxx@forcix.cx") (www . "http://www.forcix.cx/")
(gpg . "1024D/028AF63C") (irc . "nick forcer on IRCnet"))