[REBOL] Re: The evaluation semantics
From: rebolek::gmail::com at: 30-Aug-2005 11:47
On 8/30/05, Anton Rolls <[antonr--lexicon--net]> wrote:
>
> Aha, you stumbled upon the "weird" behaviour of
> rebol's OP! datatypes.
>
> >> type? :+
> == op!
>
> Yes, the infix operators (+ - * /) behave a bit differently
> than other "normal" rebol functions and actions.
>
> The explanation I remember is that an expression such as:
>
> arg1 + arg2
>
> becomes (internally)
>
> + arg1 arg2
>
Little bit off-topic:
I was wondering, what is faster?
arg1 + arg2
or
add arg1 arg2
?
May seem strange, because first option must be internally translated, but
it's faster then 'add.
>> x: now/time/precise loop 10000000 [1 + 1] probe now/time/precise - x
0:00:02.719
== 0:00:02.719
>> x: now/time/precise loop 10000000 [add 1 1] probe now/time/precise - x
0:00:03.86
== 0:00:03.86
Bye, Rebolek