Documentation
¶
Index ¶
- func Get(export string) (interface{}, bool)
- func HostClass(class string) (reflect.Type, bool)
- func HostClassPackage(class string) string
- func HostClassPackages() map[string]string
- func HostClassTypes() map[string]reflect.Type
- func HostClasses() []string
- func PkgEntries(pkg string) []string
- func Set(export string, value interface{})
- func SetHostClass(class string, t reflect.Type)
- func SetHostClassPackage(class, javaPkg string)
- func SplitExport(export string) (string, string)
- func UnmungePkg(pkg string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HostClass ¶ added in v0.6.5
HostClass returns the reflect.Type registered for the given class and whether it was found.
func HostClassPackage ¶ added in v0.6.5
HostClassPackage returns the Java package registered for the given host class, or "java.lang" if none has been set.
func HostClassPackages ¶ added in v0.6.5
HostClassPackages returns a copy of the registered (class, javaPkg) map. Used by the REPL to enumerate fully-qualified namespace prefixes such as "java.time." or "java.util.regex." in tab completion.
func HostClassTypes ¶ added in v0.6.5
HostClassTypes returns a copy of the registered (class, type) map. Used by lang.NewNamespace to seed each fresh namespace with the auto-imported host classes so (ns-imports *ns*) is non-empty.
func HostClasses ¶ added in v0.6.5
func HostClasses() []string
HostClasses returns the set of pseudo-class pkg names that have at least one entry, where a "host class" is identified by a pkg part that is a bare identifier (e.g. "Math", "System") rather than a Go import path. Import paths munge to colon-separated strings and usually contain a dot (e.g. "github.com:..."), so this excludes any pkg containing either a colon or a dot. Used by REPL tab completion to discover javacompat host-class symbols.
func PkgEntries ¶ added in v0.6.5
PkgEntries returns the names registered under the given pkg. For example, PkgEntries("Math") returns the JVM-style names exposed by the javacompat math bridge ("abs", "sqrt", "PI", ...). Returns nil if the pkg has no entries.
func Set ¶
func Set(export string, value interface{})
Set sets the value of the given package and export name.
func SetHostClass ¶ added in v0.6.5
SetHostClass records the reflect.Type that represents a host class. Bridges call this once per class in init() so namespaces can seed their import maps with `<short-name> -> <type>` entries, mirroring real Clojure's auto-import of java.lang.* (plus any other registered packages). The same value is also exported under the bare class name (e.g. "Integer") and, if the class's Java package has been registered via SetHostClassPackage, under the fully-qualified Java name (e.g. "java.lang.Integer"), so EvalASTMaybeClass can resolve both forms from any namespace whose mappings predate the bridge's init (notably clojure.core).
func SetHostClassPackage ¶ added in v0.6.5
func SetHostClassPackage(class, javaPkg string)
SetHostClassPackage records the Java package a host class lives in (e.g. "java.lang" for Math, "java.time" for Instant). Bridges call this once per class in init() so the REPL can offer the correct fully-qualified name during tab completion. If a class is not registered, callers should fall back to "java.lang".
func SplitExport ¶
func UnmungePkg ¶
Types ¶
This section is empty.