extend-type allow target object to change

Description

In the following code

Note that the first argument to recur is s2, 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, 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

Environment

None

Activity

Show:
Mike Fikes
July 8, 2017, 4:49 PM

Duplicate of

Duplicate

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

Accepted

Patch

None

Fix versions

Affects versions

Priority

Major