Skip to content

Commit e0f3061

Browse files
committedSep 1, 2011
Update example code in samples/repl
1 parent cb2d75f commit e0f3061

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed
 

‎samples/repl/src/repl/test.cljs

+8-13
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
;; You must not remove this notice, or any other, from this software.
88

99
(ns repl.test
10-
(:require [clojure.browser.repl :as repl]
11-
[clojure.browser.dom :as dom]))
10+
(:require [clojure.browser.repl :as repl]))
1211

1312
(repl/connect "http://localhost:9000/repl")
1413

@@ -35,32 +34,28 @@
3534

3635
;; Evaluate some basic forms
3736
(+ 1 1)
38-
;; TODO: Chrome has a problem with keywords
3937
{:a :b}
4038
"hello"
4139
(reduce + [1 2 3 4 5])
4240
(js/alert "Hello World!")
4341

44-
;; Can only load files that depend on what is already avaialble.
4542
(load-file "clojure/string.cljs")
4643
(clojure.string/reverse "Hello")
4744

48-
;; TODO: This is not being done automatically as it is in rhino.
49-
(ns cljs.user)
5045
(defn sum [coll] (reduce + coll))
5146
(sum [2 2 2 2])
5247

5348
;; Create dom elements.
54-
;; This require only works because we have already compiled
55-
;; 'clojure.browser.dom when the project was built.
5649
(ns dom.testing (:require [clojure.browser.dom :as dom]))
5750
(dom/append (dom/get-element "content")
5851
(dom/element "Hello World!"))
5952

60-
;; TODO: This will not work unless you have already required what it
61-
;; depends on. You may think that just copying all of goog to 'out'
62-
;; will solve the problem but it may not in every case. What if this
63-
;; depends on another cljs file which has not been compiled?
64-
(load-file "clojure/browser/dom.cljs")
53+
;; Load something we haven't used yet
54+
(ns test.crypt
55+
(:require [goog.crypt :as c]))
56+
(c/stringToByteArray "ClojureScript")
57+
58+
(load-namespace 'goog.date.Date)
59+
(goog.date.Date.)
6560

6661
)

0 commit comments

Comments
 (0)
Please sign in to comment.