slang-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-users] _NARGS is not set when calling an "overloaded" function (ie one set by __add_string)


John,

I can easily imaging that _NARGS is not meant to be set in the 
following situation, so I just wanted to know whether it was 
intentional behavior or a bug. The following is with S-Lang 2.0.5 on a 
OS-X machine:

slsh> typedef struct { a } A_Type;
slsh> p.a = 43;
slsh> p;
A_Type with 1 fields

I now define a routine for customizing the string representation of 
this type:

slsh> define A_string (x) { sprintf ("A_Type: a=%S (_NARGS=%d)", x.a, 
_NARGS); }

If I call it directly then _NARGS is set:

slsh> A_string (p);
A_Type: a=43 (_NARGS=1)

However, if the routine is called "indirectly", then _NARGS is not set:

slsh> __add_string (A_Type, &A_string);
slsh> p;
A_Type: a=43 (_NARGS=0)

Doug


_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]