[DGD]varargs void foo(object bar)

Frank Schmidt franks at colargol.tihlde.hist.no
Tue Dec 1 15:08:53 CET 1998



On Tue, 1 Dec 1998, Felix A. Croes wrote:

> >[...]
> > 1) foo()
> > 2) foo(beer) /* when <beer> != 0 */
> > 3) foo(beer) /* when <beer> == 0 */
> > 4) foo(0)
> 
> Note that 3) and 4) are always identical, from the called function's
> point of view.  Unlike MudOS, DGD has no way to distinguish a
> destructed object value from a zero value.

Nods, I'm not going into the debate about DGD and destructed objects here.
Just want to point out that also 1) is always identical (with 3 & 4) from
the called function's view, as DGD is today.

And, let's just forget about 4), dunno why I added it since it only
distracts attention. Just wanted to complete the table I guess ;)

> If I understand you correctly, you want to let call_trace() provide
> the caller's view rather than the called function's view.  That's an
> interesting solution to the varargs problem, but I'm not convinced it
> is the best one.  I am considering changing the way varargs works,
> though I haven't yet decided on anything specific.

If I understand you correctly, the caller's view is the list of the
parameters he has supplied. And the called functions's view is the list of
the parameters he has received. That would mean any code relying on a
certain amount of arguments and uses call_trace to read them, might
break.

Another solution could be to supply an additional number in the call_trace
list, saying how many arguments were actually supplied by the caller.


Happy coding,

Frank S.


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



More information about the DGD mailing list