[REBOL] I just ain't gettin' it! :)
From: philb:upnaway at: 19-Dec-2002 7:21
Hi Ed,
I'm sure than in Rebol there are many ways of doing this and I am sure there are more
elegant ways of doing this, but you could try :
a: [1 2 3 4]
b: skip a 2
remove b
insert b 5
probe a
Typing at the console gives
>> a: [1 2 3 4]
== [1 2 3 4]
>> b: skip a 2
== [3 4]
>> remove b
== [4]
>> insert b 5
== [4]
>> probe a
[1 2 5 4]
== [1 2 5 4]
Of course you culd wrap this up in a function taking a series, index & value as parameters
Cheers Phil
=== Original Message ===
OK,
This is something in REBOL I just haven't figured out yet.
How do update a value in the middle of a series?
If I have an array of x: [ 1 2 3 4 ], how do I update it to be x: [ 1 2
5 4 ]. I do not want to change any other value and I want to do it based
on Index.
I can do this: x/3: 5. But I want to do this dynamically and can't
figure out how to use "Change" (if that is the right function) to do it
within a program.
--
Sincerely, | The problems of two little people don't amount to
Ed Dana | a hill of beans in this crazy mixed-up world! But
Software Developer | this is OUR hill, and these are OUR beans!
1Ghz Athlon Amiga | -- Naked Gun via Casablanca.