I might suggest looking at literate programming.

A literate program will allow you to structure your
program in any natural way that facilitates understanding.

The extracted code that Clojure sees can be arranged
in the order required by the REPL. 

Tim Daly
d...@literatesoftware.com

On Sun, 2011-07-17 at 12:42 -0400, Luc Prefontaine wrote:
> Oops, missed the part you wrote about declare...
> There is no real solution to your problem except declare.
> 
> Evaluation is done for each form submitted one by one. There is no "file 
> scope"
> in this context.
> 
> I still think that declare is the way to go except. Splitting things in 
> different name spaces is even more work.
> 
> Luc P.
> 
> On Sun, 17 Jul 2011 04:33:19 -0700 (PDT)
> Jevgeni Holodkov <jevgeni.holod...@gmail.com> wrote:
> 
> > Hello,
> > 
> >   Usually, when I write a program, I tend to organize the function to
> > keep with higher abstraction on the top and the details implementation
> > in the end of the file like this:
> > 
> >  start() {
> >    doGenericThing1();
> >    doGenericThing2();
> > }
> > doGenericThing1() {
> >   doSpecific();
> > }
> > doGenericThing2() {
> > doSpecific()
> >  }
> > doSpecific() {..}
> > 
> > The idea is that when I open the file I want to see the most important
> > stuff, not the implementation details. This is also a more natural way
> > of reading the code. In Clojure, however, I am forced to place more
> > specific functions on top of the file or I will get "Unable to resolve
> > symbol". Yes, it is possible to overcome by using "declare" call on
> > the top, but this requires manual work. Is there something more
> > automated which I am not aware of?
> > 
> > Wbr,
> > Jevgeni Holodkov
> > 
> 
> 
> 
> -- 
> Luc P.
> 
> ================
> The rabid Muppet
> 


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