5c: Compiler Backend & Prettyprinter
+ut
+utHoon compiler backend.
Source
This core is too large to include here, refer to hoon.hoon for the source.
+us
+usPretty-printer backend.
Source
This core is too large to include here, refer to hoon.hoon for the source.
+cain
+cainTank pretty-print.
Pretty-print a $vase as a $tank using +deal. This is the same as +sell.
Accepts
A $vase.
Produces
A $tank.
Source
Examples
+noah
+noahTape pretty-print.
Pretty-print a $vase as a $tape. This is the same as +text.
Accepts
A $vase.
Produces
A $tape.
Source
Examples
+onan
+onanVise to vase.
Convert a $vise (old $vase) to the new $vase. This is the same as +seer.
Accepts
A $vise.
Produces
A $vase.
Source
Examples
+levi
+leviType nests or crash.
Check if type .b nests under type .a. Produces %.y if it nests and crashes if it does not.
Accepts
.a is a $type.
.b is a $type.
Produces
A $flag.
Source
Examples
+text
+textTape pretty-print.
Pretty print vase .x as a $tape.
Accepts
.x is a $vase.
Produces
A $tape.
Source
Examples
+seem
+seemPromote typo.
Convert $typo (old type) to the new $type.
Accepts
.y is a $typo.
Produces
A $type.
Source
Examples
+seer
+seerPromote vise.
Convert a $vise (old $vase) to the new $vase.
Accepts
.x is a $vise.
Produces
A $vase.
Source
Examples
+sell
+sellPretty-print vase to a tank.
Pretty-print vase .x to a $tank using +deal:us.
Accepts
.x is a $vase.
Produces
A $tank.
Source
Examples
+skol
+skolPretty-print type to tank.
Pretty-print type .p to a $tank using +duck:ut.
Accepts
.p is a $type.
Produces
A $tank.
Source
Examples
+slam
+slamSlam a gate.
Slam gat, a gate in a $vase, with sam, a sample in a $vase. Produces a $vase containing the result.
Accepts
.t is a gate in a $vase.
.m is a $noun in a $vase.
Produces
A $vase.
Source
Examples
+slab
+slabTest if contains.
States whether you can access named wing .g in type .p using access method .way.
Accepts
.y is a ?(%read %rite %both) (A $vial without %free). This represents the access method (read, write, or both read and write).
.g is a @tas, the name of a wing.
.p is a $type.
Produces
A $flag.
Source
+slap
+slapUntyped vase .*.
Compile hoon .n with subject .x using .*, producing a $vase of the result.
Accepts
.x is a $noun in a $vase, and is the subject.
.n is some $hoon.
Produces
A $vase.
Source
Examples
+slog
+slogDeify printf.
Prints stack trace .a if the stack trace isn't null, then produces the other input. +slog first takes .a, producing a gate. The gate then takes some hoon.
Accepts
.a is a $tang, and is the sample of +slog.
(slog a) takes some $hoon.
Produces
The result of the hoon given to (slog a), with .a printed to the terminal.
Source
Examples
Discussion
+slog is intended to be put in the middle of a bunch of chained function calls that string a piece of data through them, so that an error message will be printed if there's one to print.
+mean
+meanCrash and printf.
Ends the program and prints .a, a tracing error message.
Accepts
.a is a $tang.
Produces
A crash, with .a printed to the terminal.
Source
Examples
+road
+roadEvaluate trap.
Evaluate a +trap, producing the result if successful or else crashing with a trace.
Accepts
A +trap.
Produces
A $noun.
Source
Examples
+slew
+slewGet axis in vase.
Get axis .e in vase .vax, producing the resulting $vase in a +unit which is null if the axis cannot be retrieved.
Accepts
.e is an $atom.
.x is a $vase.
Produces
A (unit vase).
Source
Examples
+slim
+slimIdentical to +seer.
Convert a $vise (old $vase) to a $vase. Identical to +seer.
Accepts
.d is a $vise.
Produces
A $vase.
Source
Examples
+slit
+slitType of slam.
The $type produced if a gate of type .t were slammed with a sample of type .sam.
Accepts
.t is a $type.
.m is a $type.
Produces
A $type.
Source
Examples
+slob
+slobSuperficial arm.
Source
+sloe
+sloeGet arms in core.
Produces a list of the arms in a core of type .typ.
Accepts
.p is a type.
Produces
A (list term).
Source
Examples
+slop
+slopCons two vases.
Produce the vase of a cell of vases .d and .tal.
Accepts
.d is a $vase.
.l is a $vase.
Produces
A $vase.
Source
Examples
+slot
+slotGot axis in vase.
Get axis .e in vase .vax, returning it in a $vase. Crashes if the axis cannot be retrieved.
Accepts
.e is an $atom.
.x is a $vase.
Produces
A $vase.
Source
Examples
+slym
+slymSlam without sample-type.
Slam .gat, a gate in a $vase, with .sam, a $noun. The type of .m is ignored and the type of the resulting vase is determined by the gate alone.
Accepts
.t is a $vase.
.m is a $noun.
Produces
A $vase.
Source
Examples
+sped
+spedReconstruct type.
Source
+swat
+swatDeferred +slap.
This is the same as +slap except .p is the subject $vase encapsulated in a +trap, and a (trap vase) is produced.
Accepts
.p is a (trap vase).
.n is $hoon.
Produces
A (trap vase).
Source
Examples
Last updated