Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax entry for $ (dollar sign) #186

Open
shaunlebron opened this issue Apr 27, 2021 · 0 comments
Open

Syntax entry for $ (dollar sign) #186

shaunlebron opened this issue Apr 27, 2021 · 0 comments

Comments

@shaunlebron
Copy link
Member

As of 1.10.844, dollar signs can be used to refer to nested namespaces in JS:
https://clojurescript.org/news/2021-04-06-release#_library_property_namespaces

(ns foo
  (:require [react-native$NativeModules.SomeBridge :as woz]))

This might be related to inner class names in Clojure, due to JVM rules:
https://clojure.org/reference/java_interop

Note that nested classes are named EnclosingClass$NestedClass, per the JVM spec

But it also looks like a convention from Closure Compiler in JS used to flatten foo.bar.baz to foo$bar$baz but I can’t remember how to find this. This mentions it for renaming anonymous functions:
https://github.com/roman01la/closure-compiler-handbook#anonymous-functions-naming

math.simple.add = function $math$simple$add$(a, b) {
  return a + b;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant