class Novika::Library
- Novika::Library
- Reference
- Object
Overview
A library is a collection of foreign functions.
A library form can be opened with a block of function declarations to be exposed. Each function declaration consists of the function's name and type signature. Exposed functions are then defined in the opener block.
For more details, see Novika's ffi:getLibrary
.
Internally, library objects are created by the frontend and fed
to the capability collection caps
. When needed, they are
retrieved from this capability collection.
Included Modules
Defined in:
novika/forms/foreign.crConstructors
-
.new(id : String, path : Path) : Library
Initializes a library for the dynamic library at path, with the given identifier (may be chosen arbitrarily).
Class Method Summary
-
.new?(id : String, cwd : Path, env : Resolver::RunnableEnvironment) : Library | Nil
Tries to find the library with the given id in the system- specific library directories, current working directory cwd, and in the runnable environment env.
-
.new?(id : String, path : Path) : Library | Nil
Initializes a library for the dynamic library at path, with the given identifier (it may be chosen arbitrarily).
- .typedesc
Instance Method Summary
- #desc(io)
- #finalize
-
#id : String
Returns the identifier of this library.
-
#on_open(engine : Engine) : self
Reacts to this form being opened with engine.
- #to_s(io)
Instance methods inherited from module Novika::Schedulable::ShouldOpenWhenScheduled
schedule!(engine : Engine, stack : Block)
schedule!
Instance methods inherited from module Novika::Form
a(type : T.class) : T forall T
a,
desc(io : IO)desc : String desc, die(details : String) die, effect(io)
effect effect, on_open(engine : Engine) : self on_open, on_parent_open(engine : Engine) : self on_parent_open, onto(block : Block) : self onto, sel(a, b) sel, to_quote : Quote to_quote
Instance methods inherited from module Novika::Schedulable
schedule(engine : Engine, stack : Block)
schedule,
schedule!(engine : Engine, stack : Block)
schedule!
Constructor Detail
Initializes a library for the dynamic library at path, with the given identifier (may be chosen arbitrarily).
May die if LibDL fails to load the library.
Class Method Detail
Tries to find the library with the given id in the system- specific library directories, current working directory cwd, and in the runnable environment env.
Returns nil if the library could not be found or loaded.
Initializes a library for the dynamic library at path, with the given identifier (it may be chosen arbitrarily).
Returns nil if the library could not be loaded.
Instance Method Detail
Reacts to this form being opened with engine.