-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b7ede4b
commit 6135750
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
ClojureScript 1.12 Dev Notes | ||
|
||
* Clojure 1.12 introduced method values in the following forms | ||
** `Classname/staticMethod` - existing static method descriptor | ||
** `Classname/.instancedMethod` - describes an instance method | ||
** `Classname/new` - describes a constructor | ||
* `Classname/staticMethod` | ||
** ClojureScript does not use JS class syntax to define anything | ||
** "static fields" are just properties on the ctor fn | ||
** However this could easily be detected by the compiler | ||
*** `(set! (.. Foo -prototype BAR) ...)` | ||
**** where `Foo` is a known deftype | ||
** Clojure can disambiguate between method/properties | ||
*** ClojureScript cannot in the general case | ||
**** foreign JS libraries | ||
*** It can work for Closure Compatible stuff | ||
**** due to externs parsing | ||
** Option: Could assume `Classname/staticMethod` fn | ||
*** CLJS doesn't support anything but namespaces before the `/` | ||
**** So minimal breakage likely | ||
* `Classname/.instanceMethod` no precendent so also easy to handle | ||
* `Classname/new` a special case so easy to handle | ||
** Again `non-namespace/foo` never worked before | ||
* Other considerations | ||
** `^:param-tags` | ||
*** Don't immediately see a use for this | ||
**** We don't have the method selection problem | ||
** `goog.foo.Bar` | ||
*** Users do sometimes depend on global access to Closure libs | ||
*** externs parsing can let us know if `/` should be allowed or not | ||
** if something is `:referred` etc. | ||
*** Can also support `/` | ||
** `js/foo/bar` | ||
*** Not supported |