I just discovered a nice feature that I don't remember having seen discussed or documented before: there is a way to write recursive functions without having them associated to any var/symbol in any namespace. The optional name of a function can be used for a recursive call. Example:
((fn fac [n] (if (zero? n) 1 (* n (fac (dec n))))) 5) I know this is not the best way to write a factorial (it is not tail- recursive), the point is just to show an example of a recursive call. Konrad. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
