Created
April 27, 2017 04:26
-
-
Save drewverlee/ebd0d1ecf4649092bcaa227a516acb8f to your computer and use it in GitHub Desktop.
ClojureScript REPL dump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cljs.user=> (defrecord ReversibleTie [a b]) | |
cljs.user/ReversibleTie | |
cljs.user=> (extend-protocol IReversible | |
ReversibleTie | |
(^clj -rseq [cool] cool)) | |
#object[Function "function (cool){ | |
var cool__$1 = this; | |
return cool__$1; | |
}"] | |
cljs.user=> (extend-protocol IReversible | |
ReversibleTie | |
(^clj -rseq [tie] (->ReversibleTie (:b tie) (:a tie)))) | |
#object[Function "function (tie){ | |
var tie__$1 = this; | |
return cljs.user.__GT_ReversibleTie.call(null,new cljs.core.Keyword(null,"b","b",(1482224470)).cljs$core$IFn$_invoke$arity$1(tie__$1),new cljs.core.Keyword(null,"a","a",(-2123407586)).cljs$core$IFn$_invoke$arity$1(tie__$1)); | |
}"] | |
cljs.user=> (reverse (->ReversibleTie :a :b)) | |
#cljs.user.ReversibleTie{:a :b, :b :a} | |
cljs.user=> (extend-protocol IReversible | |
ReversibleTie | |
(^clj -rseq [tie] (->ReversibleTie (:b tie) (:a tie))) | |
js/String | |
(^clj -rseq [s] (str "the castle of " s))) | |
Extending an existing JavaScript type - use a different symbol name instead of js/String e.g string at line 1 | |
cljs.user=> (extend-protocol IReversible | |
ReversibleTie | |
(^clj -rseq [tie] (->ReversibleTie (:b tie) (:a tie))) | |
String | |
(^clj -rseq [s] (str "the castle of " s))) | |
ERROR - Cannot read property 'prototype' of undefined | |
cljs.user=> (extend-protocol IReversible | |
ReversibleTie | |
(^clj -rseq [tie] (->ReversibleTie (:b tie) (:a tie))) | |
js/String | |
(^clj -rseq [s] (str "the castle of " s))) | |
Extending an existing JavaScript type - use a different symbol name instead of js/String e.g string at line 1 | |
cljs.user=> (reverse "hi") | |
"the castle of hi" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment