My work for Hoon 101. Will remain private until the class is over.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
282B

  1. :: depth first library
  2. ::
  3. |%
  4. ++ traverse
  5. |= t=(tree @)
  6. ^- (list @)
  7. ?~ t
  8. ~
  9. %+ weld
  10. (traverse l.t)
  11. %+ weld
  12. (traverse r.t)
  13. [n.t ~]
  14. ++ search
  15. |= [t=(tree @) x=@]
  16. ^- ?
  17. ?~ t
  18. %.n
  19. ?| (search l.t x)
  20. (search r.t x)
  21. =(n.t x)
  22. ==
  23. --