Create a standard way to reference this

Description

Some js frameworks require you to implement 'methods' and those methods need to access js this. Currelty this forces you to js*.

the following is handled by CLJS-83

Currently deftype only supports implementing protocol functions. It could be enhanced to support 'method' fns, possibly by using the Object section:

(deftype Foo [a]
Object
(anyArbitraryMethod [a-name-for-this] ...))

Note that the arity of the actual fn would be one less than for protocol 'methods'.

Explore other options before going this way.

Supporting access to 'this' in stand-alone functions may cause gclosure to complain (it only wants to see traditional methods on prototypes), and is a non-objective for now.

Environment

None

Assignee

Fogus

Reporter

Rich Hickey

Labels

None

Approval

None

Patch

None

Priority

Critical
Configure