anchor.diff:  \ Never ever use this in actual code, only when debugging interactively.
   \ Thank you.
   : set-args ( arg-str len unit-str len -- )
  -           s" decode-unit" get-parent $call-static set-unit set-my-args ;
  -
  -: $cat-unit  dup parent 0= IF drop EXIT THEN
  -             dup >space? not IF drop EXIT THEN
  -             dup >r >unit s" encode-unit" r> parent $call-static dup IF
  -             dup >r here swap move s" @" $cat here r> $cat
  -             ELSE 2drop THEN ;
  +   s" decode-unit" get-parent $call-static set-unit set-my-args
  +;
  +
  +: $cat-unit
  +   dup parent 0= IF drop EXIT THEN
  +   dup >space? not IF drop EXIT THEN
  +   dup >r >unit s" encode-unit" r> parent $call-static
  +   dup IF
  +      dup >r here swap move s" @" $cat here r> $cat
  +   ELSE
  +      2drop
  +   THEN
  +;
   
   \ Getting basic info about a node.
   : node>name  dup >r s" name" rot get-property IF r> (u.) ELSE 1- r> drop THEN ;
   : node>qname dup node>name rot ['] $cat-unit CATCH IF drop THEN ;
  -: node>path  here 0 rot  BEGIN dup WHILE dup parent REPEAT 2drop
  -             dup 0= IF [char] / c, THEN
  -             BEGIN dup WHILE [char] / c, node>qname here over allot swap move
  -	     REPEAT drop here 2dup - allot over - ;
  +: node>path
  +   here 0 rot
  +   BEGIN dup WHILE dup parent REPEAT
  +   2drop
  +   dup 0= IF [char] / c, THEN
  +   BEGIN
  +      dup
  +   WHILE
  +      [char] / c, node>qname here over allot swap move
  +   REPEAT
  +   drop here 2dup - allot over -
  +;
   
   : interposed? ( ihandle -- flag )
     \ We cannot actually detect if an instance is interposed; instead, we look
  
positive.code: ;
  
  : find-alias ( alias-name len -- false | dev-path len )
      s" /aliases" find-node dup IF
  	get-property 0= IF 1- dup 0= IF nip THEN ELSE false THEN
      THEN ;
  
  : .alias ( alias-name len -- )
      find-alias dup IF type ELSE ." no alias available" THEN ;
  
negative.code: \ sub-alias does a single iteration of an alias at the begining od dev path
  \ expression. de-alias will repeat this until all indirect alising is resolved
  : sub-alias ( arg-str arg-len -- arg' len' | false )
     2dup
     2dup [char] / findchar ?dup IF ELSE 2dup [char] : findchar THEN
     ( a l a l [p] -1|0 ) IF nip dup ELSE 2drop 0 THEN >r
     ( a l l p -- R:p | a l -- R:0 )
     find-alias ?dup IF ( a l a' p' -- R:p | a' l' -- R:0 )
        r@ IF
           2swap r@ - swap r> + swap $cat strdup ( a" l-p+p' -- )
        ELSE
           ( a' l' -- R:0 ) r> drop ( a' l' -- )
        THEN
     ELSE
        ( a l -- R:p | -- R:0 ) r> IF 2drop THEN
        false ( 0 -- )
     THEN
  ;
  
  : de-alias ( arg-str arg-len -- arg' len' )
     BEGIN
        over c@ [char] / <> dup IF drop 2dup sub-alias ?dup THEN
     WHILE
        2swap 2drop
     REPEAT
  ;
  
  
  