Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Navigation in output produced by parse-xml

From: fsievert:uos at: 25-May-2001 18:14

On Fri, 25 May 2001, James Carlyle wrote:
> a parent when nested in other blocks, or should I store the ancestry of > blocks as I recurse into a block structure using deep-find?
No, they don't have this feature, but it is easy to add this. Try do http://proton.cl-ki.uni-osnabrueck.de/REBOL/parent-block.r Now you can convert a block-structure (non-recursive!) in a parent-block-structure.
>> a: [1 2 [3 4 [5] 6] 7]
== [1 2 [3 4 [5] 6] 7]
>> a: parent-block a
== [1 2 [3 4 [5] 6] 7] ; No it is converted
>> a/3
== [3 4 [5] 6] ; Everything looks like before
>> parent a/3
== [1 2 [3 4 [5] 6] 7] ; You can get the parent-block
>> head a
== [none 1 2 [3 4 [5] 6] 7] ; Here you can see, how it is done
>> parent-check head a
== [1 2 [3 4 [5] 6] 7] ; Use parent-check after a move in the ; block to prevent you from seeing the ; parent-pointer CU, Frank