class Ven::Program
- Ven::Program
- Reference
- Object
Overview
An individual Ven program, and a first-tier (higher is more abstract) high level manager.
High level managers are abstractions over the workhorses
of Ven: Reader
, Compiler
, Optimizer
and Machine
.
They manage the workhorses in a simple, graceful and
powerful way.
puts Program.new("1 + 1").run # 2 : Num
Included Modules
Defined in:
ven/program.crConstructors
-
.new(source : String, file : String = "untitled", hub : Ven::Suite::Context::Hub = Context::Hub.new, legate : Ven::Legate = Legate.new)
Makes a Program.
Instance Method Summary
-
#chunks : Array(Ven::Suite::Chunk)
Returns the chunks of this program.
-
#distinct : Distinct | Nil
Returns this program's distinct.
-
#export(destination : Chunks)
Appends the chunks that (exclusively) this program produced to destination.
-
#exposes : Array(Array(String))
Returns the distincts that this program exposes.
-
#file : String
Returns the filename (or unit name) of this program.
-
#hub : Context::Hub
Returns the context hub of this program.
-
#import(pool : Chunks)
Makes chunks of pool precede chunks of this program, as well as be available at runtime.
-
#quotes : Array(Ven::Suite::Quote)
Returns the quotes of this program.
-
#run(with parenthood = [] of Chunk)
Runs this program: performs all steps of Ven evaluation pipeline.
-
#source : String
Returns the source code of this program.
-
#step(step : Step)
Performs a particular step in Ven program evaluation pipeline.
-
#then(*args, **options)
Alias for
#step
. -
#to_s(io)
Appends the result of this program's evaluation of the string representation for an unevaluated program to io.
Constructor Detail
Makes a Program.
source is the source code of this program; file is its filename (or unit name); hub is the context hub that this program will use.
Instance Method Detail
Appends the chunks that (exclusively) this program produced to destination.
Returns self.
NOTE Mutates destination.
Makes chunks of pool precede chunks of this program, as well as be available at runtime.
Returns self.
Runs this program: performs all steps of Ven evaluation pipeline.
parenthood gets #import
ed first, and then gets
#export
ed. See these methods to find out about
the details.
Returns self.
Performs a particular step in Ven program evaluation pipeline.
See Step
for the available steps.
Appends the result of this program's evaluation of the string representation for an unevaluated program to io.