Hello folks,
While learning, it occured to me that factorial function can be
written as:
(defn factorial [n]
(apply * (for [x (range 1 (+ n 1))] x)))
I know that it has big argument list for large numbers, but it seems
to scale nicely (at least in clojure).
I am sure this was discussed to death in lisp groups - have searched
the net and did not find this version...
kind regards,
Vlad
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---