I want to convert the following OCaml type (an unbalanced binary tree) to Common Lisp, but as a CL newbie, i donot know how to do it using a dynamic language.
type 'a tree =
Leaf
| Node of 'a * 'a tree * 'a tree
Any suggestion is appreciated !
A standard cons is your tree node, car being the left subtree, and cdr the right.
See http://nostoc.stanford.edu/jeff/llisp/13.html (at archive.org now) for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With