How annoying is that! :/
This is the working version ...

REBOL [
     Title:  "Binary tree insertion with terminals = []"
     Date:   2-Jul-2007
     File:   %t2.r
     Author: "Jonathan Kelly"
     Version: 0.0.1
]

add: func [ blk val ] [
     print [ "add" blk type? blk  blk = [] val]
     either blk = [] [
         print "at A"
         compose [ (val) [] [] ]
     ] [
         either blk/1 = val [
             print "at equals"
             blk
         ] [
             either val > blk/1 [
                 print "at greater"
                 poke blk 3 (add blk/3 val)
             ] [
                 print "at less"
                 poke blk 2 (add blk/2 val)
             ]
             blk
         ]
     ]
]

tt: add [] "c"
prin [ "tt is " ]
probe tt
print []
tt: add tt "b"
prin [ "tt is " ]
probe tt
print []
tt: add tt "e"
prin [ "tt is " ]
probe tt
print []
tt: add tt "d"
prin [ "tt is " ]
probe tt
print []
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to