optional parameters

Stefan Monnier <stefan.monnier@epfl.ch>
Sun, 6 Aug 1995 13:23:39 GMT

          From comp.compilers

Related articles
optional parameters stefan.monnier@epfl.ch (Stefan Monnier) (1995-08-06)
Re: optional parameters markt@harlequin.co.uk (1995-08-10)
Re: optional parameters paulb@pablo.taligent.com (1995-08-15)
Re: optional parameters stachour@parka.winternet.com (1995-08-20)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Stefan Monnier <stefan.monnier@epfl.ch>
Keywords: C++, design, Lisp, question, comment
Organization: Ecole Polytechnique Federale de Lausanne
Date: Sun, 6 Aug 1995 13:23:39 GMT

How are optional parameters implemented ? I'm sure the technique is
not the same for C++ than for CommonLisp (and, for CommonLisp
&optional are probably not handled the same as &key and as &rest).

Is some special calling-convention used (with an arg count, for
instance) or are the missing optional parameters added by the
compiler thanks to prototype declarations ? How does it all fit with
the usual calling conventions ?

[In C++ it's easy, since the compiler can tell what missing parameters to
add. Life in Lisp is more complex, since Lisp calls usually have to handle
closures and the like anyway. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.