'Subtract vs '-
[1/8] from: hallvard::ystad::oops-as::no at: 6-Jul-2004 11:45
Hello,
I have this console session:
>> a: 20.20.20
== 20.20.20
>> b: 10.10.10
== 10.10.10
>> a - b
== 10.10.10
>> a subtract b
** Script Error: subtract expected value2 argument of type: number pair char
money date time tuple
** Near: subtract b
>> minus: :-
>> a minus b
** Script Error: Cannot use negate on tuple! value
** Near: minus b
>>
Why is it that I can only get '- to work on tuples? What did I overlook?
HY
[2/8] from: apwing:zonnet:nl at: 6-Jul-2004 14:24
Hi Hallvard,
you should use
subtract a b
instead of:
a subtract b
Met vriendelijke groet / with kind regards,
Arie van Wingerden
[3/8] from: hallvard:ystad:oops-as:no at: 6-Jul-2004 13:36
Yes, thanks, Arie, but there still is this:
>> a: 20.20.20
== 20.20.20
>> b: 10.10.10
== 10.10.10
>> minus: :-
>> minus a b
** Script Error: Cannot use negate on tuple! value
** Near: minus a b
>> a minus b
** Script Error: Cannot use negate on tuple! value
** Near: minus b
(But, of course, minus: :subtract solves this.)
Guess the weird '- behaviour has got to do with '- accepting "strange" syntax, with the
first argument _before_ '-...
HY
Dixit Arie van Wingerden (14.24 06.07.2004):
[4/8] from: greggirwin:mindspring at: 6-Jul-2004 8:29
Hi Hallvard,
>>> minus: :-
>>> minus a b
HY> ** Script Error: Cannot use negate on tuple! value
HY> ** Near: minus a b
>>> a minus b
You're not getting the function you expect. Look at the error message
again and you'll see that it refers to the NEGATE function.
>> fn: :-
>> fn 5
== -5
It might still be a good feedback for RT to ask *why* we get the
negation op instead of the subtraction op; same if you use GET on '-.
-- Gregg
[5/8] from: lmecir:mbox:vol:cz at: 6-Jul-2004 16:34
Hi Hallvard,
>>>minus: :-
>>>minus a b
<<quoted lines omitted: 9>>
>(But, of course, minus: :subtract solves this.)
>Guess the weird '- behaviour has got to do with '- accepting "strange" syntax, with
the first argument _before_ '-..
see http://www.fm.vslib.cz/~ladislav/rebol/rep.html#section-21 , where I
wrote some of my observations.
-L
[6/8] from: lmecir:mbox:vol:cz at: 6-Jul-2004 16:56
Gregg Irwin napsal(a):
>It might still be a good feedback for RT to ask *why* we get the
>negation op instead of the subtraction op; same if you use GET on '-.
>
>-- Gregg
>
Actually we don't. See my previous post.
-L
[7/8] from: lmecir:mbox:vol:cz at: 6-Jul-2004 18:24
Ladislav Mecir napsal(a):
>see http://www.fm.vslib.cz/~ladislav/rebol/rep.html#section-21 , where I
>wrote some of my observations.
>
>-L
>
Sorry for any inconveniences, I just updated the page. The correct
reference now is:
http://www.fm.vslib.cz/~ladislav/rebol/rep.html#section-22
While I was at it, I changed the wording of
http://www.fm.vslib.cz/~ladislav/rebol/rep.html#section-6 ,
http://www.fm.vslib.cz/~ladislav/rebol/rep.html#section-20 and
http://www.fm.vslib.cz/~ladislav/rebol/rep.html#section-10
Any comments on that?
-L
[8/8] from: greggirwin:mindspring at: 6-Jul-2004 12:55
Hi Ladislav,
>>It might still be a good feedback for RT to ask *why* we get the
>>negation op instead of the subtraction op; same if you use GET on '-.
>>
LM> Actually we don't. See my previous post.
Thanks for the clarification!
-- Gregg
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted