Arc Forumnew | comments | leaders | submitlogin
5 points by mattjones 4381 days ago | link | parent

This is actually a really useful feature. The Ramaze Ruby framework does this by default and I like it a lot.

One thing that makes it even more convenient is automatically detecting what files to reload. Ramaze does it by using Ruby's $LOADED_FEATURES and $LOAD_PATH variables. You can get the same conveniece with Arc with a simple modification to arc.arc:

    (= loaded-files* nil)  ; added
    (def load (file)
      (w/infile f file
        (whilet e (read f)
          (eval e)))
      (= loaded-files* (adjoin file loaded-files*)))  ; added
Now you can just use loaded-files* in your reload-check function.

3 points by byronsalty 4378 days ago | link

Nice. I was trying to think of an easy way to do this.

In order to not have to muck with the internals of load itself I wonder if you could wrap the saving path name functionality but then call the original load. Maybe this would be some new synatx / ability to add to the language? Of course this is just aspects which I thought Lisp could do so - I'm probably missing something.


1 point by cooldude127 4378 days ago | link

that is very cool.