slang-users mailing list

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

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


Doug Burke <dburke@xxxxxxxxxxxxxxx> wrote:
>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

A little of both.  The function will always be called with exactly one
argument; hence there is nothing to be gained by checking the value of
_NARGS in it.  Nevertheless, it is a bug since _NARGS should be 1.
Here is the patch:

--- slstruct.c~	2005-12-16 16:21:18.000000000 -0500
+++ slstruct.c	2005-12-19 14:09:53.000000000 -0500
@@ -1259,10 +1259,10 @@
 	return SLmake_string (buf);
      }
    
-   if (-1 == _pSLang_push_struct (s))
-     return NULL;
-   
-   if (-1 == SLexecute_function (f))
+   if ((-1 == SLang_start_arg_list ())
+       || (-1 == SLang_push_struct (s))
+       || (-1 == SLang_end_arg_list ())
+       || (-1 == SLexecute_function (f)))
      return NULL;
 
    if (-1 == SLpop_string (&str))

Thanks,
--John

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


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