On Mon, Dec 17, 2012 at 9:32 AM, Chas Emerick <c...@cemerick.com> wrote: > > What you're trying to do is really a special case of mutual recursion: > because Clojure's methods are separate functions, calling back through the > multimethod (and its dispatch fn) will always consume stack space. The > general solution for this is to use `trampoline`, which will continuously > call through functions returned from calling a function until a non-function > value is returned. This would allow you to make your multimethod > mutually-recursive, as long as those recursive calls are made by returning a > function (that the user of the multimethod would `trampoline` through):
Also as long as you don't want to return a function from the multimethod, no? -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also offer numerous other occasions to consume drinks for pleasure." [Larousse, "Drink" entry] -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en