Hacker News new | past | comments | ask | show | jobs | submit login

This list was originally written for Prolog, and it looks like not all of them have been fully translated. Here are a few notes to help read it:

In e.g. "Write a predicate hbal-tree/2 to construct...", hbal-tree/2 means a predicate with two values. Lisp's cons would be cons/3, cons(Atom, List, Result). In Prolog, you can leave other arguments (not just the "result") as a variable and will often serve as a generator for all possible values. hbal-tree/2 would be used as hbal-tree(T, R). If T was defined and R wasn't, it would return a balanced version in R. With R defined but not T, it would generate all permutations of trees that balance to R (perhaps very slowly). T and R both defined would check if R is a valid balanced version of T.

Also, Prolog syntax uses "name(arg1, arg2)." rather than "(name arg1 arg2)".




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: