On 01.03.2009, at 01:38, Rich Hickey wrote:
> I've added letfn, which lets you define mutually recursive local
> functions a la CL's labels.
>
> (defn ring [n]
> (letfn [(a [n] (if (zero? n) n (b (dec n))))
> (b [n] (if (zero? n) n (c (dec n))))
> (c [n] (if (zero? n) n (a (dec n))))]
> (c n)))
I noticed that letfn does not permit destructuring in its argument
lists:
(letfn [(a [[f & r]] f)]
(a [1 2 3]))
java.lang.IllegalArgumentException: fn params must be Symbols
(NO_SOURCE_FILE:2)
Is this intentional?
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
-~----------~----~----~----~------~----~------~--~---