On Feb 22, 6:19 pm, Raffael Cavallaro <raffaelcavall...@gmail.com>
wrote:
> On Feb 22, 2:54 pm, Mirko <mirko.vuko...@gmail.com> wrote:
>
>
>
> > In lisp you would define it as (untested):
>
> > (defmacro print-times (reps text)
> > `(do-times (i ,reps)
> > (print ,text))
>
> > (Not trying to force-feed lisp, just that I do not know the closure
> > syntax).
>
> user=> (defmacro repeat-times [n & body]
>             `(dotimes [placeholder# ~n]
>                       ~...@body))
> #'user/repeat-times
> user=> (repeat-times 3 (println "hello!"))
> hello!
> hello!
> hello!
> nil
> user=>

Uh, it will take me time to get used to the brackets.  But if I
managed to learn some Lisp at my late stage of life, I guess I will
learn to handle brackets as well :-)

Thanks,

Mirko
--~--~---------~--~----~------------~-------~--~----~
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 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to