In the following code
Note that the first argument to recur is s2, changing the target object when recurring.
recur
s2
In Clojure, this is allowed and the last form yields :hello.
:hello
In ClojureScript, the use of this-as in the implementation defeats this.
this-as
Note that, for deftype, defrecord, and reify, the use of this-as is currently needed because we pass in a dummy nil as the target object https://github.com/clojure/clojurescript/blob/69342169ba868574aa7f5a88669e6333ccc3df01/src/main/clojure/cljs/analyzer.cljc#L1818
deftype
defrecord
reify
nil
In the following code
Note that the first argument to
recur
iss2
, changing the target object when recurring.In Clojure, this is allowed and the last form yields
:hello
.In ClojureScript, the use of
this-as
in the implementation defeats this.Note that, for
deftype
,defrecord
, andreify
, the use ofthis-as
is currently needed because we pass in a dummynil
as the target object https://github.com/clojure/clojurescript/blob/69342169ba868574aa7f5a88669e6333ccc3df01/src/main/clojure/cljs/analyzer.cljc#L1818