As a general rule, all arguments for REBOL functions follow the function
word.
+ and - and a few others are undocumented exceptions, provided by REBOL
designers to accommodate people who prefer to use the
"operator-between-the-arguments" format for arithmetic and some logic
operators.
Actually - doesn't work with the two arguments following the operator,
despite the documentation!
The reason for that peculiarity is that REBOL allows further user sloppiness
in inserting a space between the - and an integer to create a negative
number!  I've reported this as a bug.

In using the format + n1 n2, you must be careful not to allow + to look
earlier for a value to add to n1!
>> x: + 3 4  ; is ok,
== 7 ; but not
>> x: 5 + 3 4
== 4 ; 5+3 is calculated and dropped   To prevent + from looking back, use
parentheses:
>> x: 5 (+ 3 4) ; the 5 is dropped.
== 7

This example may seem artificial, but I like the + arg1 arg2 format and have
encountered
the above problem in "real" programs.

Russell, [EMAIL PROTECTED]
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, October 17, 1999 11:11 PM
Subject: [REBOL] A simple question


> Hi,
>
> The operators + and union are both native.
>
> If the following lines work ok
> >> + 3 2
> == 5
> >> 3 + 2
> == 5
> >> union [3] [2]
> == [3 2]
>
> Why the following line doesn't work?
>
> >> [3] union [2]
> ** Script Error: union expected set2 argument of type: series bitset.
> ** Where: union [2]
>
> Thank you
>
> --
> Luis Marzulli
> e-mail: [EMAIL PROTECTED]
> Caracas, VENEZUELA
> ----------------------------------------------------------
> Earn money when you or your friends are on the Web
> click --> http://www.alladvantage.com/go.asp?refid=BXX890
>

Reply via email to