manpagez: man pages & more
info bigloo
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1 DSSSL formal argument lists

DSSSL formal argument lists are defined by the following grammar:

<formal-argument-list> → <required-formal-argument>*
  [(#!optional <optional-formal-argument>*)]
  [(#!rest <rest-formal-argument>)]
  [(#!key <key-formal-argument>*) (#!rest <rest-formal-argument>?)]
<required-formal-argument> → <ieee-ident>
<optional-formal-argument> → <ieee-ident>
     | (<ieee-ident> <initializer>)
<rest-formal-argument> → <ieee-ident>
<key-formal-argument> → <ieee-ident>
     | (<ieee-ident> <initializer>)
<initializer> → <expr>

When a procedure is applied to a list of actual arguments, the formal and actual arguments are processed from left to right as follows:

It shall be an error for an <ieee-ident> to appear more than once in a formal-argument-list.

Example:

((lambda (x y) x) 3 4 5 6)   ⇒(3 4 5 6)
((lambda (x y #!rest z) z)
 3 4 5 6)                    ⇒ (5 6)
((lambda (x y #!optional z #!rest r #!key i (j 1)) 
    (list x y z i: i j: j))
 3 4 5 i: 6 i: 7)            ⇒ (3 4 5 i: 6 j: 1)
((lambda (x y #!optional z #!key i (j 1) #!rest r) 
    (list x y z i: i j: j r))
 3 4 5 i: 6 i: 7 8 9)        ⇒ (3 4 5 i: 6 j: 1 (8 9))

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on March 31, 2014 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.