pkgmap

package
v0.6.5-rc31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: EPL-1.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(export string) (interface{}, bool)

Get returns the value of the given package and export name and whether it was found.

func HostClass added in v0.6.5

func HostClass(class string) (reflect.Type, bool)

HostClass returns the reflect.Type registered for the given class and whether it was found.

func HostClassPackage added in v0.6.5

func HostClassPackage(class string) string

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

func HostClassPackages() map[string]string

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

func HostClassTypes() map[string]reflect.Type

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

func PkgEntries(pkg string) []string

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

func SetHostClass(class string, t reflect.Type)

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 SplitExport(export string) (string, string)

func UnmungePkg

func UnmungePkg(pkg string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL