Hi Pierre,

PJ> Ordinary blocks only allow for IMPLICIT naming of elements
PJ> contained therein, which requires one to  

PJ> 1) remember their sequence 
PJ> 2) use any of these for retrieval: 

PJ> ordinal phrases (first, second, third ... [ ])
PJ> pick phrases (pick [ ]  n) *
PJ> select phrases (select [ ] 'selector-word)
PJ> path phrases ([ ] /n) * 
PJ> extract phrases (extract [ ] n) and (extract/index [ ] n m) *

PJ> * where n = any integer; m = any integer

Not true; path notation can be used on blocks just as easily. The
difference being that normally you use word! values, rather than
set-word! values, to name elements (for easier access).

>> block: [name "Gregg" phone #208.461....]
== [name "Gregg" phone #208.461....]
>> block/name
== "Gregg"
>> block/phone
== #208.461....

Indirection for path elements:

>> field: 'phone
== phone
>> block/:field
== #208.461....

Values other than words:

>> block: [name "Gregg" phone #208.461.... <tag> "It worked!"]
== [name "Gregg" phone #208.461.... <tag> "It worked!"]
>> block/<tag>
== "It worked!"

And, in recent releases, you can use parens to compute path elements.


-- Gregg                         

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to