guile-devel
[Top][All Lists]
Advanced

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

Re: SCM_CALL_N


From: Dirk Herrmann
Subject: Re: SCM_CALL_N
Date: Tue, 26 Jun 2001 17:12:02 +0200 (MEST)

On Tue, 26 Jun 2001, Lars J. Aas wrote:

> On Tue, Jun 26, 2001 at 01:46:33AM +0200, Marius Vollmer wrote:
> : Additionally, what about
> : 
> :     scm_call_n (proc, n, ...);
> :     scm_apply_n (proc, n, ...);
> : 
> : where the number of arguments is given explicitely.
> 
> I'm more fan of terminating the end of the arglist than counting the
> args I've given and updating the count if I change something.  More
> convenience - less efficience?  Both systems can be provided, of course.
> 
>   SCM scm_va_apply( proc, ... ); /* decl */
> 
>   scm_va_apply( proc, arg1, arg2, [...], SCM_EOL ); /* usage */

I agree with respect to your argument that using an explicit count is
probably not a good idea.  However, I'd like to mention that we should not
use SCM_EOL as a terminator, since SCM_EOL may be a valid argument.  
Instead, SCM_UNDEFINED should be used to terminate the argument list,
since it can never represent any legal object.  And, another point, I
prefer the scm_<foo>_n naming scheme over the scm_va_<foo> naming.  The
varags implementation is something that should be hidden from the
user.  Nobody ever wants to think about how printf is actually realized...

> Another thing about varargs is that you should probably set up vararg
> functions as mere wrappers for functions working on the va_list datatype.
> If you don't, you can't wrap those functions because you can't expand the
> va_list data into the ... positions.  At least I haven't figured out
> how...

Hmmm.  I don't get it.  What is the problem?

Best regards,
Dirk Herrmann




reply via email to

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