Hi,
Found that for function like: f(void|int parm) the condition intp(parm) == 1 is always true, regardless of how it will be called - f() or f(integer_value). Sure I can use "mixed ... args", but this is not really convenient... This is in 7.4.28. Do I've any options? :) /Al
zero_type(parm) is your friend. This kind of question is more in scope with the pike list than the focus of pike-dev, by the way.
/ Johan Sundström (Achtung Liebe!)
Previous text:
2004-02-12 10:20: Subject: void|int function parameters - how to check if those are passed?
Hi,
Found that for function like:
f(void|int parm)
the condition intp(parm) == 1 is always true, regardless of how it will be called - f() or f(integer_value).
Sure I can use "mixed ... args", but this is not really convenient...
This is in 7.4.28.
Do I've any options? :)
/Al
/ Brevbäraren
On Thu, Feb 12, 2004 at 10:25:01AM +0100, Johan Sundström (Achtung Liebe!) @ Pike (-) developers forum wrote:
zero_type(parm) is your friend. This kind of question is more in scope with the pike list than the focus of pike-dev, by the way.
OK, thanks - I forgot about zero_type(). But the reason why I posted it here is: I believe that current behavior of intp() is not really correct, at least it seems so (void is not intp()).
Regards, /Al
Void is 0, so it's an int. There is no special void type in pike, just a special zero...
/ Mirar
Previous text:
2004-02-12 10:35: Subject: Re: void|int function parameters - how to check if those are passed?
On Thu, Feb 12, 2004 at 10:25:01AM +0100, Johan Sundström (Achtung Liebe!) @ Pike (-) developers forum wrote:
zero_type(parm) is your friend. This kind of question is more in scope with the pike list than the focus of pike-dev, by the way.
OK, thanks - I forgot about zero_type(). But the reason why I posted it here is: I believe that current behavior of intp() is not really correct, at least it seems so (void is not intp()).
Regards, /Al
/ Brevbäraren
pike-devel@lists.lysator.liu.se