[DGD]1.1.52

Felix A. Croes felix at dworkin.nl
Mon Mar 15 16:04:18 CET 1999


Frank Schmidt <franks at colargol.tihlde.hist.no> wrote:

> On Mon, 15 Mar 1999, Felix A. Croes wrote:
>
> > how many actual arguments the function was called, since I consider
> > foo(1) to be an alias for foo(1, nil, nil).
>
> Yes, but not knowing if the nil was a default argument (to be set to a
> default value) or if it is a destructed object or a somehow messed up
> string/array/mapping, allows Very nasty bugs where to code flow continues
> with hideous assumptions - Instead of detecting the obvious error.

Good point.  I'm not sure yet how to deal with this...


>  > > Dealing with this means breaking backwards
> compatibility
> and > dumpfile compatibility, but since I have already done both for
> > the new typechecking mode, I need postpone it no longer.  I am
> > considering something like
> > 
> >     void foo(int a, varargs string b, object c)
> >     {
> >     }
>
> Maybe "varargs object c" too? Or will you permit foo(a1,,c1) ?

"varargs" in the above would mean, "all arguments after this are
optional".  It would be tedious to have to repeat it for 20
optional arguments.  Introducing default arguments in the middle
also looks like a bad move.

Regards,
Dworkin

List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list