Module introspect

This package provides introspection into the interpreter. Introspection allows finding out what modules have been imported and what symbols that those modules hold. Note that the api that this package exports is currently limited.

One caveat with introspection is that the interpreter does not automatically load all symbols from foreign libraries. This mechanism (dynaload) means that introspecting a foreign library may not include all of the symbols inside of it. Introspection does not provide any means of finding symbols that are not loaded.

Classes

ClassEntry This is a foreign class that wraps over a Lily class.
ConstantEntry This is a foreign class that wraps over a constant value.
EnumEntry This is a foreign class that wraps over an enum.
FunctionEntry This is a foreign class that wraps over a toplevel function of a package.
MethodEntry This is a foreign class that wraps over a class or enum method.
ModuleEntry This is a foreign class that wraps over a module.
ParameterEntry This is a native class representing a definition parameter.
PropertyEntry This is a foreign class that wraps over a class property.
TypeEntry This is a foreign class that wraps over a type.
VarEntry This is a foreign class that wraps over a var.
VariantEntry This is a foreign class that wraps over an enum variant.

Functions

define class_name(value: A): String

Return the class name of the value given.

If the value given is a variant, this returns the name of the variant.

define main_module: ModuleEntry

Returns the first module loaded.

define module_list: List[ModuleEntry]

Return all modules inside of the interpreter. This includes registered modules and modules in the interpreter's prelude. In most cases, main_module should be used instead.