Re: order of function definition

2010-02-25 Thread Laurent PETIT
Hi, 2010/2/25 Meikel Brandmeyer > Hi, > > On Feb 25, 11:24 am, reynard wrote: > > I define a function foo in which it calls an auxiliary function bar, > > which is not yet defined, and a compiler exception is raised claiming > > unable to resolve symbol bar. > > > > Is there a way that I can de

Re: order of function definition

2010-02-25 Thread Tom Danielsen
(declare bar) -- Freedom's just another word for nothing left to lose -- 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 wi

Re: order of function definition

2010-02-25 Thread Meikel Brandmeyer
Hi, On Feb 25, 11:24 am, reynard wrote: > I define a function foo in which it calls an auxiliary function bar, > which is not yet defined, and a compiler exception is raised claiming > unable to resolve symbol bar. > > Is there a way that I can define the functions in any order I want, > without

Re: order of function definition

2010-02-25 Thread Laurent PETIT
not yet. But you can just declare the function, before implementing it: (declare bar) (defn foo [] (bar "hello")) (defn bar [man] (println "hello" man)) Be aware that if you need to typehint bar, you'll also need to type hint the bar declaration, so that the compilation of foo can use this info