Re: How to: an anonymous recursive function

2010-07-01 Thread Mike Meyer
On Thu, 1 Jul 2010 12:50:00 -0700 (PDT) Tim Robinson wrote: > and now corrected! > > (defmacro anaphoric-recur [parm-binds expr & parms] > "An anaphoric recursive function that takes a vector of blind >bindable vars, an expression that can handle the bindable vars. >and th

Re: How to: an anonymous recursive function

2010-07-01 Thread Tim Robinson
and now corrected! (defmacro anaphoric-recur [parm-binds expr & parms] "An anaphoric recursive function that takes a vector of blind bindable vars, an expression that can handle the bindable vars. and the parameters. 'self' is used to call the function recursively." `(

Re: How to: an anonymous recursive function

2010-07-01 Thread Tim Robinson
Hi folks, I found some time this morning to look at this: Mikes Letfn example worked out best for me: > (defmacro anaphoric-recur [parm-binds parms & body] "An anaphoric recursive function that takes a vector of blind bindable vars, parameters and a function that can handle the bindabl

Re: How to: an anonymous recursive function

2010-06-30 Thread Tim Robinson
Thanks for all the replies. Sorry if my responses are delayed. I'm still on newb moderation mode, so I find my response can take 2 - 10 hours to be published. > note that z is free in that expression, which looks suspicious. yup, it was supposed to be x. It was a copy paste error. I normally woul

Re: How to: an anonymous recursive function

2010-06-30 Thread Dominic Cooney
If you name the Y combinator, then you can write recursive anonymous functions: You can't use Clojure's recur as written because it isn't in tail position--the result of the function isn't just the value of the recur expression (in the first inst

Re: How to: an anonymous recursive function

2010-06-30 Thread Shawn Hoover
On Wed, Jun 30, 2010 at 1:44 AM, Tim Robinson wrote: > So I am reading On Lisp + some blogs while learning Clojure (I know, > scary stuff :) > > Anyway, I've been playing around to see if I can get an anonymous > recursive function to work, but alas I am still a n00b and not even > sure what Cloju

Re: How to: an anonymous recursive function

2010-06-30 Thread Nicolas Oury
user=> (fn plouf [] (plouf)) # user=> ((fn plouf [] (plouf))) java.lang.StackOverflowError (NO_SOURCE_FILE:0) (plouf/plaf is approximate french for foo/bar) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure

Re: How to: an anonymous recursive function

2010-06-30 Thread Mike Meyer
On Tue, 29 Jun 2010 22:44:58 -0700 (PDT) Tim Robinson wrote: > So I am reading On Lisp + some blogs while learning Clojure (I know, > scary stuff :) > > Anyway, I've been playing around to see if I can get an anonymous > recursive function to work, but alas I am still a n00b and not even > sure