Well, I agree it is a bit ambiguous,
but if you think that rebol operates
left to right, then you can see that
the get-word :n happens before the set-word n:
The second possible meaning:
I imagine if it was wanted that way, you could
be able to write:
data/:(n: 150 'n)
or
data/(150)
since you already know the value of n
or know how to calculate n.
I don't see it's very useful to set 'n just to
be used as a temporary value in a path.
However, it got me thinking...
Perhaps temporary variables could be used further down
the path. ie.
data/(n: 150)/(n + 1)
is equivalent to:
data/150/151
Another idea is perhaps if data is a block which contains
a name/value pair, then you could access 'name inside the
parens. eg:
data: [index 3 a b c d e]
data/(index + 2)
;== c
or
data: [header 4 index 3 a b c d e]
data/(header + index)
;== c
Just some ideas.
Anton.
> Hi, list,
>
> About http://www.rebol.net/blog/carl.html#section-5
>
> Here's Carl's exemple:
> data: [10 20 30]
> n: 3
>
> This shorthand for accessing elements in blocks is added to rebol version=
> 2.5.55:
> data/:n: 150
>
> But then: is it absolutely clear that this should mean
> poke data n 150
>
> Couldn't it just as well mean:
> n: 150
> pick data n
>
> i.e. with the form=20
> :n:
> which should be evaluated first, :n or n: ?
>
> This might be a dumb question, but I don't see that this is all
> that clear.=
> Elucidate me!
>
> A copy of this email is sent via http://www.rebol.com/contacts.html.
>
> HY
--
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.