[REBOL] Re: paths & lookups & change
From: ingo:2b1 at: 18-Oct-2003 11:28
Robert M. Münch wrote:
> Hi, I seem to be stucked here:
> == ["Bug Report" 1]
> == "Bug Report"
>>>type? select test key
> == integer!
>>>add select test key + 1
> ** Script Error: Cannot use add on string! value
> ** Near: add select test key +
> Hmm... Ok, maybe a priority problem:
>>>add (select test key) + 1
> ** Script Error: add expected value2 argument of type: number pair char
> money date time tuple
> ** Near: add (select test key) + 1
> Strange. Shouldn't this be possible?
Have a look at these to statements, please
>> add select test key 1
>> (select test key) + 1
You're doing both of the above in one line, so the '+ eats away one of
'add s arguments
> I would like to write something like this, to increment the integer in the
> test/:key: test/:key + 1
I'd like that, too ;-) But until then, this works:
>> change next pos: find test key pos/2 + 1
== ["Bug Report" 2]
Though I'm sure, someone will come up with a better idea ...
> How can I do such a thing? Using to-set-path? I tried but failed. Robert
I wouldn't know how to do it, either, anyone else?