- Subject: Re: Some questions
- From: "John E. Davis" <davis>
- Date: Tue, 17 Jun 2003 10:49:12 -0400
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
(jdl is my version of IDL--- a S-Lang-based interactive data language)
>How to declare a variable read only? slang.txt tells, that read only
>variables are possible, but doesn't say how.
Only intrinsic variables may be made readonly. S-Lang 2 _may_ support
user defined constants.
>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
define foo (x)
{
return x + 1;
}
as:
. ( [x] =x x 1 + ) foo
Take a look at jed/lib/dcl.sl for a more extensive example of this
syntax.
>And what's with %!%+ and %!%-? Are this active comments? Where can I read
>more about them? How to use them? Is there a function in jed, that helps
>creating them?
These are documentation markers that are processed using sl2tm
distributed with slang in the
slang/doc/tm/tools/
directory. See also jed/doc/tm/* for more information.
--John
--------------------------
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]