[REBOL] Re: Limitation coming from the "initialize" refinement used with the "Ar
From: tomc:darkwing:uoregon at: 26-Jun-2002 18:30
thats nice Gerard
a bit prettier
do rejoin['tab_nbr "/" l "/" c ": " 20]
On Wed, 26 Jun 2002, Gerard Cote wrote:
> Hello,
>
> As I tried to generate a dynamic line of code to create a way to circumvent
> the way REBOL interprets the ARRAY notation when used with variable indexes
> instead of numeric constants (nothing really hard with REBOL), I found some
> limitation with the initialize refinement as following : It seems only
> possible to use the same constant (a scalar value or any other datatype
> seems to be is accepted) as the initial value used by the Array word itself.
>
> Here is my example code ( I tried it directly at the concole) :
>
> tab_nbr: array/initial [3 2] 0 cells contents are all initialized to
> the 0 value
> L: 2
> C: 1
> tab_nbr/2/1: 10 cell content [2 1] is updated to 10
> print tab_nbr/:L/:C I verify that all is OK
>
> tab_nbr/:L/:C: 20 But this one doesn't work, so I
> dynamically generated the real line and asked
> REBOL to execute it.
> The wanted expression was
> : tab_nbr/2/1: 20
> and this can be given by
> join join join join "tab_nbr/" L join "/" C ": " 20
> which generates > "tab_nbr/2/1:
20" then the "do" word will do it like this.
>
> do join join join join "tab_nbr/" L join "/" C ": " 20
>
> But now that I can use real variable indexes with my array, am I supposed to
> use loops too just to get
> any cell value initialized with something other than some constant like the
> series of values : 10, 20 , 30 , 40 50 and 60.
I think yes