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

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


5 points by rincewind 5946 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 5946 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 5946 days ago | link

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

-----

1 point by almkglor 5946 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.

-----