arichiardi / replumb

ClojureScript plumbing for your self-hosted REPLs.
http://clojurescript.io
Eclipse Public License 1.0
209 stars 16 forks source link

Repl specials don't work with "load-file" (unless it is the last) #125

Open tomasz-biernacki opened 8 years ago

tomasz-biernacki commented 8 years ago

If we try to load a file

(ns foo.load-require)
(require 'foo.bar.baz)
(def a true)

with (load-file ...) it will fail because (require ....) is a repl special and needs "special" treatment.

arichiardi commented 8 years ago

By the way in clojure:

user=> (doc load-file)
-------------------------
clojure.core/load-file
([name])
  Sequentially read and evaluate the set of forms contained in the file.
nil

Sequentially is the keyword, but we first need #92 of course.

arichiardi commented 8 years ago

To expand on this, if we evaluate sequentially, form by form we need first to have all our repl specials as macros injected at runtime. Alternatively we could call read-eval-call, which includes process-repl-specials on each form but this looks hack-ish and rushy to me so I prefer to give priority to #92 first and come back on this later.