4m: Formatting Functions
+pave
Parse $path to $pith.
Parses each segment of a $path into a typed $iota. A segment that does not parse as any recognised aura is kept as [%ta segment].
Accepts
.path is a $path.
Produces
A $pith.
Source
++ pave
|= =path
^- pith
%+ turn path
|= i=@ta
(fall (rush i spot:stip) [%ta i])Examples
> (pave /foo/123/0xdead)
~[%foo [%ud 123] [%ux 0xdead]]Note that a cast does not do this — `pith`/foo/123 produces ~[%foo %123], leaving the segments as bare @tas.
+pout
Render $pith to $path.
The inverse of +pave: renders each $iota back to a @ta segment with +scot.
Accepts
.pith is a $pith.
Produces
A $path.
Source
Examples
+scot
Render $dime as $cord.
Renders a $dime .mol as a $cord.
Accepts
.mol is a $dime.
Produces
A $cord.
Source
Examples
+scow
Render $dime as $tape.
Renders a $dime .mol as a $tape.
Accepts
.mol is a $dime.
Produces
A $tape.
Source
Examples
+slat
Curried slaw.
Produces a $gate that parses a $knot .txt to a +unit containing the $atom of the aura specified by .mod. The +unit will be null if parsing failed.
Accepts
.mod is a $knot.
.txt is a $cord.
Produces
A (unit @).
Source
Examples
+slav
Demand: parse $cord with input aura.
Parses a $cord .txt to an $atom of the aura specificed by .mod. Crashes if it fails to parse.
Accepts
.mod is a $term
.txt is a $knot.
Produces
an $atom.
Source
Examples
+slaw
Parse $cord to input aura.
Parses a $cord .txt to a +unit containing the $atom of the aura specified by .mod. The +unit is null if parsing failed.
Accepts
.mod is a $term.
.txt is a $knot.
Produces
A (unit @).
Source
Examples
+slay
Parse $cord to $coin.
Parses a $cord .txt to the unit of a $coin.
Accepts
.txt is a @ta.
Produces
A (unit coin).
Source
Examples
+smyt
Render $path as $tank.
Renders the $path .bon as a $tank, which is used for pretty-printing.
Accepts
.bon is a $path.
Produces
A $tank.
Source
Examples
+spat
Render $path as $cord.
Renders a $path .pax as $cord.
Accepts
.pax is a $path.
Produces
A $cord.
Source
Examples
+spud
Render $path as $tape.
Renders a $path .pax as $tape.
Accepts
.pax is a $path.
Produces
A $tape.
Source
Examples
+stab
Parse $cord to $path.
Parses a $cord .zep to a static $path. Crashes if it fails to parse.
Accepts
.zep is a @t.
Produces
A $path, or crash.
Source
Examples
+stip
Typed path parser.
A parser core for $piths. Used by +pave.
Source
The core reduces to +swot, so +stip used directly parses a whole path.
+spot:stip
Parses a single path segment into an $iota.
+swot:stip
Parses a whole /-separated path into a $pith.
+stap
Path parser.
Parsing $rule. Parses a $path, used internally by +stab.
Source
Examples
Last updated