Affects Version/s: None
Fix Version/s: None
CLJS-398 was a first attempt to implement an operation to extend single instances, but it fell short because it offered no control over which closures to attach onto the object (i.e. allocates every time). Also, specify is a much better name than extend-instance.
extend-type can be implemented in terms of specify (by specifying the .prototype), but extend-type has grown from its humble beginnings
to an monster of complexity
Currently it does
- print warnings
- optimize IFn impls
- special case the Object "protocol"
- special case js builtins
and all that in a single macro body. So this is also a good opportunity to do some refactoring.
specify should have an interface similar to extend-type. Additionally a lower level operation is needed to attach existing lambdas as protocol methods. It's called specify* in my current implementation. It takes a lambda for every specified protocol-method-arity, with a syntax loosely based on clojure.core/extend.
|Field||Original Value||New Value|
|Attachment||0001-CLJS-414-specify-and-specify-macros.patch [ 11645 ]|
|Attachment||0002-CLJS-414-Implement-extend-type-in-terms-of-specify.patch [ 11646 ]|
|Attachment||0103-CLJS-414-Test-specify-features-deprecation-nowarn-an.patch [ 11650 ]|
|Attachment||0101-CLJS-414-specify-and-specify-macros.patch [ 11651 ]|
|Attachment||0102-CLJS-414-Implement-extend-type-in-terms-of-specify.patch [ 11652 ]|
|Attachment||0104-CLJS-414-Update-specify-to-allow-implementing-IFn-an.patch [ 11664 ]|
|Attachment||0204-CLJS-414-Update-specify-to-allow-implementing-IFn-an.patch [ 11980 ]|
|Attachment||0203-CLJS-414-Test-specify-features-deprecation-nowarn-an.patch [ 11981 ]|
|Attachment||0202-CLJS-414-Implement-extend-type-in-terms-of-specify.patch [ 11982 ]|
|Attachment||0201-CLJS-414-specify-and-specify-macros.patch [ 11983 ]|
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Resolution||Completed [ 1 ]|
|Status||Resolved [ 5 ]||Closed [ 6 ]|