[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] How does Chicken know the # of arguments to a functi
Re: [Chicken-users] How does Chicken know the # of arguments to a function
Mon, 20 Dec 2004 09:19:40 +0000
> felix winkelmann wrote:
>Yes, that's correct (and procedures that expect a dotted argument list
>simply use stdarg functionality)
> So the only requirement for calls to Chicken-generated
>functions is cdecl calling convention.
A bit of a background on my original question...
SWIG seems to register a wrapper for overloaded functions that takes a
variable number of arguments. For some reason, though, if the overloaded
functions take a different number of arguments (say, 2 and 4) then I
cannot call the function with the lesser number of arguments since
Chicken complains. Chicken appears to only know about the 4 arguments and
not know that I can pass 2.
I understand now that this is not a Chicken matter but I could not figure
out where SWIG tells Chicken about the 4 arguments :-(. I figured out now
that the TinyCLOS code generated by SWIG only generates the Chicken code
with the 4 arguments, like this:
(define-method (add (self <Container>) (widget <Widget>) x y)
((vector-ref swig-init-return 10) (slot-ref self 'swig-this) (slot-ref
widget 'swig-this) x y))
and does not specialize add (specialize is the right term?) for 2 arguments.
I'll repost to the SWIG list.
OpenPoker: The Linux of poker software
Tenerife: Canary Islands: Spain