On Nov 27, 8:37 am, lpetit <[EMAIL PROTECTED]> wrote:
> On Nov 27, 1:58 pm, lpetit <[EMAIL PROTECTED]> wrote:
>
> > and the modification of trampoline along these lines :
> > (defn trampoline [f]
> > (let [ret (f)]
> > (cond f
> > (fn? ret) (recur ret)
> > (instance? org.clojure.lang.NoBoingWrapper f) (.returnInstance
> > f)
> > else ret)))
>
> Mmm might read (cond ret , and also (instance?
> org.clojure.lang.NoBoingWrapper ret) (.returnInstance ret) of course,
>
> --
I considered that, and it's still a possibility, but I don't want
people thinking they need to call (trampoline-return x) all the time.
The only time you need to wrap the return value is when the result is
an actual fn.
But it is nice to do the unwrapping in trampoline itself.
My thinking is that such mutually-recursive state machines are
designed of-a-piece, so any wrapping protocol would be local, and I
wanted to minimize the amount of cruft one would have to add to use a
trampoline.
Rich
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---