struct Novika::Builtin
- Novika::Builtin
- Struct
- Value
- Object
Overview
Wraps a snippet of Crystal (native) code, namely a Crystal
Proc
, for usage in the Novika-land.
Included Modules
Defined in:
novika/forms/builtin.crConstructors
- .new(id : String, desc : String, code : Novika::Engine, Novika::Block -> _)
- .new(id : String, desc : String, &code : Engine, Block -> )
Class Method Summary
Instance Method Summary
- #==(other : self)
-
#desc(io : IO)
Appends a string description of this form to io.
-
#effect(io)
Generates and returns a description for the stack effect of this form.
-
#hash(hasher)
See
Object#hash(hasher)
-
#id : String
Returns the identifier of this builtin.
-
#on_parent_open(engine : Engine) : self
Reacts to this form's enclosing block 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
Class Method Detail
Instance Method Detail
def desc(io : IO)
#
Description copied from module Novika::Form
Appends a string description of this form to io.
def effect(io)
#
Description copied from module Novika::Form
Generates and returns a description for the stack effect of this form.
For blocks and builtins, tries to extract a ( ... -- ... )
(but see EFFECT_PATTERN
) from their corresponding
comment. If could not extract or no comment, returns
'a block' for blocks and 'native code' for builtins.
Description copied from module Novika::Form
Reacts to this form's enclosing block being opened with engine.