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
information ; see:

user=> (set! *warn-on-reflection* true)
true
user=> (declare bar)
#'user/bar
user=> (defn foo [] (.length (bar "laurent")))
Reflection warning, NO_SOURCE_PATH:5 - reference to field length can't
be resolved.
#'user/foo
user=> (declare #^String bar)
#'user/bar
user=> (defn foo [] (.length (bar "laurent")))
#'user/foo
user=>

HTH,

-- 
Laurent



2010/2/25 reynard <atsan...@gmail.com>:
> 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 taking care of defining the auxiliary function first?  Thanks.
>
> --
> 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

-- 
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

Reply via email to