[REBOL] Re: A comment to Carl's blog
From: antonr:lexicon at: 21-Oct-2004 16:38
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.