bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `-' and zero arguments


From: Dirk Herrmann
Subject: Re: `-' and zero arguments
Date: Tue, 8 May 2001 11:12:05 +0200 (MEST)

On 6 May 2001, Marius Vollmer wrote:

> I fixed this by making SCM_WTA_DISPATCH_0 signal a `wrong num args'
> error when the generic function hasn't been initialized yet.  I think
> this is the right thing to do.
> 
> What I'm not sure about is: should we allow generic functions or
> methods with zero arguments?  Is that useful?  You can have exactly
> one method for the zero argument case.

(Not being a goops user (yet), I risk to talk complete rubbish below.  
Take this as a chance to laugh at me :-)

It's not usefull, right.  But, does it do any harm?  To me it seems
that the only aspects where it _might_ be harmfull are 
* performance for the case of a call with zero arguments.  But, I don't
  know whether the alternative, i. e. checking for this situation and
  handling it as a special case wouldn't slow down the (probably) more
  common situation of calls with at least one parameter?
* undetected errors.  Adding a second function with zero arguments will
  overwrite the first.  But, this is not a bug but a feature, right?

Best regards,
Dirk Herrmann




reply via email to

[Prev in Thread] Current Thread [Next in Thread]