This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: An optional arguments interface



> This is cool, but I have a comment.
>
> DSSSL provides optional arguments as well, I believe with a syntax
> something like:
>
> (lambda (a b #!optional c d . e) ...)
>
> Given that someone has already invented a syntax for optional
> arguments in Scheme variants, which isn't substantially different in
> functionality from yours, I'd rather be conservative than promote yet
> another syntax.
>
> Unfortunately, #! is the SCSH block comment start token.  Which I'd
> really like to support.  Argh.  I'll go bug Olin about this.

I'd be happy to change the syntax, however there are a couple of
issues to consider.

* DSSSL isn't R4RS compatible for a number of reasons which are not
likely to change (e.g. no mutation), so preserving compatability with
it shouldn't be that high a goal, certainly not as high as staying
compatible with other Scheme dialects. Also, a DSSSL syntax I looked
at seemed to have #!rest as the way to specify a rest argument, rather
than a dot (see http://www.tiac.net/users/bingham/dssslsyn/dssslsyn.htm#P31).  
So the lambda list syntax apparently won't be compatible either way.

* Removing #! as the block comment token would break the ability to specify
an interpreter under Unix by putting #!/usr/bin/guile on the first line,
unless you special-case that instance, which seems inelegant to me.

* Brackets are pretty universally understood to mean something
optional in a specifiction. I found it really cute to use that for the
declaration syntax as well.

 - Maciej Stachowiak