jed-users mailing list

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

Re: Some questions


begin  "John E. Davis" <davis@xxxxxxxxxxxxx> wrote:
> Joerg Sommer <joerg@xxxxxxxxxxxx> wrote:
>>is !if (foo) faster then if (foo != 0) or why exists this version of
>>negation?
> 
> The first form is twice as fast:
> 
> jdl> x = 0; tic; loop (10000000) !if (x); toc;
> 1.92
> jdl> x = 0; tic; loop (10000000) if (x!=0); toc; 
> 4.06

But at me:
#v+
$1=int(5e5);
$2=0;

variable a,b;
tic();
loop ( $1 ) !if($2);
a=toc();

tic();
loop ( $1 ) if($2 != 0);
b=toc();

message(string(a) + ", " + string(b));
#v-

evalbuffer() -> 3.78, 3.02

slsh -> 0.46, 0.9

>>What does ".[var]"? (var is a variable) I found it in site.sl
>>custom_variable().
> 
> The first version of S-Lang used a reverse polish syntax resembling
> postscript.  This syntax is still supported, though not recommended.
> Using this syntax, it is possible to write

Is there any advantage in use the polish syntax?

Joerg.

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


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