Hi, Create & use dotopdown (or doreverse, name it as you like):
user=> (defmacro dotopdown [& body] `(do ~@(reverse body))) #'user/dotopdown user=> (dotopdown (defn abstract [a] (helper a)) (defn helper [a] (str a))) #'user/abstract user=> (abstract 30) "30" ;) 2011/2/9 jkrueger <[email protected]> > When writing a Clojure namespace very often I would like to sort my > functions according to level of abstraction, starting with the most > abstract functions, followed by helper functions to the more abstract > functions, and so on. This way of organizing code is promoted as good > style by the Clean Code guys. However, to do this in Clojure one would > have to declare almost every function in the namespace before actually > defining it, since namespaces are interpreted top-down. This strikes > me as very ugly. Since other functional languages like Haskell manage > to avoid this problem, I would like to suggest that Clojure should > provide a way to support this organizational scheme in the future. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > 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 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. 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
