| ? quote: |
| I've just come across function pointers this semester, and it seems like they could come in useful sometime. Recursion is something that everyone says is useful (or essential, and incredibly neat and tidy compared to the alternatives in many situations), but the only time I've used it is in trees, and I can't thik of many more practical uses.
|
Try working in a functional language (like Scheme, LISP, Hascal, etc.). Loops don't exist- the only way to do things is via recursion.
Those languages are 1337 because you get these obscenely long looking things that do incredibly dull things... For example- this line:
(define member-slst? (lambda (s slst) (if (null? slst) #f (or (if (symbol? (car slst)) (equal? s (car slst)) (member-slst? s (car slst))) (member-slst? s (cdr slst))))))
Simply reads through a list of symbols and returns t or f, depenging on whether or not s is a member of the slist. Without recursion, I think I might have shot myself in the face. [addsig]


[addsig]