Skip to content

Commit 35276d7

Browse files
Update repl examples. We no longer need to configure a root directory.
1 parent 23d29f1 commit 35276d7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

samples/repl/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Start the REPL using the browser as the evaluator:
6363
```clj
6464
(require '[cljs.repl :as repl])
6565
(require '[cljs.repl.browser :as browser])
66-
(def env (browser/repl-env :root "samples/repl/"))
66+
(def env (browser/repl-env))
6767
(repl/repl env)
6868
```
6969

samples/repl/src/repl/test.cljs

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@
2424
(def opts {:output-to "samples/repl/main.js"
2525
:output-dir "samples/repl/out"})
2626
(build "samples/repl/src" opts)
27-
27+
2828
;; Start REPL
2929
(do (require '[cljs.repl :as repl])
3030
(require '[cljs.repl.browser :as browser])
31-
(def env (browser/repl-env :root "samples/repl/"))
31+
(def env (browser/repl-env))
3232
(repl/repl env))
33-
33+
3434
;; Open the file samples/repl/index.html
35-
35+
3636
;; Evaluate some basic forms
3737
(+ 1 1)
3838
;; TODO: Chrome has a problem with keywords
3939
{:a :b}
4040
"hello"
4141
(reduce + [1 2 3 4 5])
4242
(js/alert "Hello World!")
43-
43+
4444
;; Can only load files that depend on what is already avaialble.
4545
(load-file "clojure/string.cljs")
4646
(clojure.string/reverse "Hello")
@@ -63,4 +63,4 @@
6363
;; depends on another cljs file which has not been compiled?
6464
(load-file "clojure/browser/dom.cljs")
6565

66-
)
66+
)

0 commit comments

Comments
 (0)