Skip to content

Commit ac411db

Browse files
committed
Tweak some formatting
1 parent e6f63e2 commit ac411db

File tree

1 file changed

+31
-26
lines changed

1 file changed

+31
-26
lines changed

doc/modules/ROOT/pages/cljs/overview.adoc

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,40 @@ differences everyone has to be aware of.
4242

4343
Here's how the standard ClojureScript behaves with multiple input forms:
4444

45-
cljs.user>
46-
(declare is-odd?)
47-
(defn is-even? [n] (if (= n 0) true (is-odd? (dec n))))
48-
(defn is-odd? [n] (if (= n 0) false (is-even? (dec n))))
49-
#'cljs.user/is-odd?
50-
#'cljs.user/is-even?
51-
#'cljs.user/is-odd?
52-
cljs.user> (is-even? 4)
53-
true
54-
45+
[source,clojure]
46+
----
47+
cljs.user>
48+
(declare is-odd?)
49+
(defn is-even? [n] (if (= n 0) true (is-odd? (dec n))))
50+
(defn is-odd? [n] (if (= n 0) false (is-even? (dec n))))
51+
#'cljs.user/is-odd?
52+
#'cljs.user/is-even?
53+
#'cljs.user/is-odd?
54+
cljs.user> (is-even? 4)
55+
true
56+
----
5557

5658
And here's how a Piggieback-powered REPL behaves:
5759

58-
cljs.user>
59-
(declare is-odd?)
60-
(defn is-even? [n] (if (= n 0) true (is-odd? (dec n))))
61-
(defn is-odd? [n] (if (= n 0) false (is-even? (dec n))))
62-
#'cljs.user/is-odd?
63-
cljs.user> (is-even? 4)
64-
Compile Warning <cljs repl> line:1 column:2
65-
66-
Use of undeclared Var cljs.user/is-even?
67-
68-
1 (is-even? 4)
69-
^---
70-
71-
#object[TypeError TypeError: Cannot read property 'call' of undefined]
72-
(<NO_SOURCE_FILE>)
73-
cljs.user>
60+
[source,clojure]
61+
----
62+
cljs.user>
63+
(declare is-odd?)
64+
(defn is-even? [n] (if (= n 0) true (is-odd? (dec n))))
65+
(defn is-odd? [n] (if (= n 0) false (is-even? (dec n))))
66+
#'cljs.user/is-odd?
67+
cljs.user> (is-even? 4)
68+
Compile Warning <cljs repl> line:1 column:2
69+
70+
Use of undeclared Var cljs.user/is-even?
71+
72+
1 (is-even? 4)
73+
^---
74+
75+
#object[TypeError TypeError: Cannot read property 'call' of undefined]
76+
(<NO_SOURCE_FILE>)
77+
cljs.user>
78+
----
7479

7580
This difference comes from a performance optimization in Piggieback, which avoids
7681
creating an different REPLs for each ClojureScript form it evaluates.

0 commit comments

Comments
 (0)