Here's an illustrative console session that addresses your question:

>> dat: array [2 3]
== [[none none none] [none none none]]
>> dat/1: [1 2 3]
== [[1 2 3] [none none none]]
>> dat/2: [3 4 5]
== [[1 2 3] [3 4 5]]
>> change dat/1 777
== [2 3] ; this return allows you to change a number of elements in one
statement, but I don't use it here.
>> dat
== [[777 2 3] [3 4 5]]
>> change at dat/1 2 888 ; to change the second element of first row of
array.
== [3]
>> dat
== [[777 888 3] [3 4 5]]
>>
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 24, 2000 9:32 PM
Subject: [REBOL] Setting array variables


> I have been using "compose" to set variables within an array,
> I have the sneaky feeling that there may be easier way.
>
> >>data: [ [ 1 2 3 ] [ 3 4 5 ] ]
> == [[1 2 3] [3 4 5]]
> >> b: 2
> == 2
> >> c: 3
> == 3
> >> new-data: 777
> == 777
> >> do compose [ (to-set-path reduce [ 'data :a :b ])  new-data ]
> == [777 4 5]
> >> data
> == [[1 2 3] [777 4 5]]
>
> Anyone know of an easier way?
>
> Mike Yaunish
> [EMAIL PROTECTED]
>
>
>

Reply via email to