Thanks for that - I was wondering if it was a bug or I was doing something
in a non-rebol way :)

----- Original Message -----
From: "Larry Palmiter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 4:01 PM
Subject: [REBOL] Re: Paths, Arrays, Assignment and other bothersome things


> Hi James,
>
> The problem is that the path notation does not allow an element to
indicate
> both a GET and a SET. This will supposedly be fixed in the next version of
> REBOL.
>
> You could try:
>
> poke grid/:x/:y z random true     ;only get-words in path
>
> or
>
> poke pick pick grid x y z random true
>
> or if the indices need to be calculated:
>
> poke pick pick grid x + 5 y + 5 z + 5 random true
>
> POKE and PICK are the native block element manipulation functions and
> produce faster code than the path notation.
>
> BTW FOR is vary slow, it is better to use REPEAT or FOREACH when possible.
>
> HTH
> -Larry
>
> ----- Original Message -----
> From: "James Marsden" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, December 16, 2001 5:00 PM
> Subject: [REBOL] Paths, Arrays, Assignment and other bothersome things
>
>
> > Hi All,
> >
> > At present I am using the following to assign to an array:
> >
> > REBOL []
> > grid: array/initial [8 8 8] false
> > random/seed now
> > for z -3 2 1 [
> >  for y -3 2 1 [
> >   for x -3 2 1 [
> >    do reform join "grid/" [x + 5 "/" y + 5 "/" z + 5 ": random true"]
> >   ]
> >  ]
> > ]
> > print grid
> > halt
> >
> > This works fine but seems to be a rather round-about way to achieve the
> > assignment.
> > Is there a better way?
> >
> > Ideally I would like to have used something like:
> > -> grid/:x/:y/:z: random true
> > but this only gives a get error.
> >
> >
> > James.
> >
> > --
> > To unsubscribe from this list, please send an email to
> > [EMAIL PROTECTED] with "unsubscribe" in the
> > subject, without the quotes.
> >
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to