Arc Forumnew | comments | leaders | submitlogin
8 points by almkglor 6044 days ago | link | parent

  (load "foo.arc" your-macro-expander-here)
Anarki only


5 points by rincewind 6043 days ago | link

load would be even more useful if you were able to supply your own reader as the second argument.

-----

4 points by almkglor 6043 days ago | link

  (def load-my-reader (file read)
    (push current-load-file* load-file-stack*)
    (= current-load-file* file)
    (after
      (w/infile f file
        (whilet e (read f)
          (eval (hook e))))
      (do (= current-load-file* (pop load-file-stack*)) nil)))

-----

1 point by Bogart 6043 days ago | link

Wouldn't this force macros and code to be in separate files, though?

-----

1 point by almkglor 6043 days ago | link

It forces macro-expanders and code to be in separate files. You can still put macros in the code file, as long as your macro-expander can understand them.

-----