slang-users mailing list

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

Re: What's faster ?


ah thanks...
I saw that I wrote it wrong after I submitted the message...
Don't want to spoil the list with my useless messages ;-)
but I go for the popping method...
I only looked for a way that I can make the compiler
clear that for example 2 integer parameters are
required....is that possible when I pop the parameters myself ?
So when the code doesn't contain the two integers or if one
of them is a string, that the compiler will throw an error...
If it's not possible, I can error check while executing the function
ofcourse, but this could be usefull....
Or is it safe to just use the add_intrinsic functions with a parameter
count ?

thanks in advance,

       Richard van Zon.

btw: I tested some stuff with LUA (another interpreter), but the embedding
method of S-Lang is much better, I must say. maybe nice to hear :-)

John E. Davis wrote:

Richard van Zon <rvanzon@xxxxxxxxxxxx> wrote:

I wonder what is faster/more efficient and how much the gap is between
accessing the function arguments directly like

int func(int *arg1,int *arg2)
{
 printf("%d %d",*arg1,*arg2);
}

or with pops

int func()
{
 printf("%d %d",SLang_pop_integer(),SLang_pop_integer());
}


For the last one, you mean:

   (void) SLang_pop_integer (&x);
   (void) SLang_pop_integer (&y);
   printf("%d %d",x,y);

In any case, I do not think that you will be able to detect any
difference between the two functions.

--John









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