[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SRFI 22 finished?

This page is part of the web mail archives of SRFI 22 from before July 7th, 2015. The new archives for SRFI 22 contain all messages, not just those from before July 7th, 2015.

>>>>> "Marc" == Marc Feeley <feeley@xxxxxxxxxxxxxxxx> writes:

Marc> Here are my comments:

Marc> The name "scm-i3e1178-90" is bizarre and I will not remember it.
Marc> Why not "scm-ieee-1178-1990"?  Also I don't like the prefix "scm-"...
Marc> why not the more explicit "scheme-" prefix?  I think the 32 character
Marc> limit for the script-interpreter line is a lame argument. 

You won't hear a complaint from us :-)  Olin?

Marc> Finally, I don't understand the sudden change in the way parameters
Marc> are passed to "main".

What change?  It was this way since day 1 of SRFI 22.

Marc> It seems much more elegant to define "main" as
Marc> a procedure with as many arguments as are needed by the script, which
Marc> allows the Scheme interpreter to very naturally catch wrong number of
Marc> argument errors, and the code for scripts expecting a fixed number of
Marc> arguments is more elegant (they don't have to extract the arguments
Marc> from a list). 

But it would require the SRFI to specify what would happen in this
place.  The vanilla reaction to this by the Scheme system is very
probably not the one you want when someone calls the script with a
wrong number of arguments.

Marc> Scripts that handle variable number of arguments (such
Marc> as your example) can be written with a rest parameter:

Marc> (define (main . arguments)
Marc>   (for-each display-file arguments)
Marc>   0)

And vice versa:

(define (main args)
  (apply marc-feeley-main args))

Why is this important?

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla