What about defaulted parameters and 'excess keyword arguments' in some
language, e.g. Python [1], [2]:
funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite
parameter_list ::= (defparameter ",")*
("*" identifier [, "**" identifier]
| "**" identifier | defparameter [","])
defparameter ::= parameter ["=" expression]
sublist ::= parameter ("," parameter)* [","]
parameter ::= identifier | "(" sublist ")"
funcname ::= identifier
Defaulted parameters are bound to the default expression at definition time.
The '**identifier' definition means that excess keyword parameters (that do
not match formal parameters) in a functin call will be collected in the
dictionary 'identifier' (rather than raise a TypeError)
[1] http://www.python.org/doc/current/ref/function.html
[2] http://www.python.org/doc/current/ref/calls.html
kind regards,
Peter Ring
-----Original Message-----
From: Norman Walsh [mailto:[EMAIL PROTECTED]]
Sent: 17. september 2002 20:55
To: [EMAIL PROTECTED]
Subject: DOCBOOK: Re: RFE #582822: VARARG and FUNCDEF together
/ Norman Walsh <[EMAIL PROTECTED]> was heard to say:
| The TC proposes to solve RFE #582822 by changing the funcprototype
| in the following backwards-compatible way:
|
| funcprototype ::=
| (funcdef,
| (void|(paramdef*, varargs?)))
Make that
funcprototype ::=
(funcdef,
(void|varargs|(paramdef+, varargs?)))
To avoid a funcprototype containing only a funcdef.
Be seeing you,
norm
--
Norman Walsh <[EMAIL PROTECTED]> | ...it is significant that we are
http://www.oasis-open.org/docbook/ | called the 'information society'
Chair, DocBook Technical Committee | -- not the thinking society, not
| the deliberative society, not the
| society of reason and
| rationality.--Lloyd Morrisett