This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Re: RFE #582822: VARARG and FUNCDEF together


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:ndw@nwalsh.com]
Sent: 17. september 2002 20:55
To: docbook@lists.oasis-open.org
Subject: DOCBOOK: Re: RFE #582822: VARARG and FUNCDEF together


/ Norman Walsh <ndw@nwalsh.com> 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 <ndw@nwalsh.com>      | ...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


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