2title = "3g: Molds and Mold-Builders"
9Noun-literal syntax cases
11Syntax cases for nouns-literal: atoms, jammed nouns, and nestable tuples. Parsed
12and printed using `++so` and `++co` cores.
26> `coin`(need (slay '~s1'))
27[%$ p=[p=~.dr q=18.446.744.073.709.551.616]]
29> `coin`(need (slay '0x2b59'))
30[%$ p=[p=~.ux q=11.097]]
32> ~(rend co [%many ~[[%$ %ud 1] [%$ %tas 'a'] [%$ %s -2]]])
53Used in `++coin`. Convenience methods
54[`++scot`](/docs/hoon/reference/stdlib/4m#scot) and
55[`++scow`](/docs/hoon/reference/stdlib/4m#scow) print dimes as `++cord` and
56`++tape`, respectively. [`++slat`](/docs/hoon/reference/stdlib/4m#slat),
57[`++slav`](/docs/hoon/reference/stdlib/4m#slav), and
58[`++slaw`](/docs/hoon/reference/stdlib/4m#slaw) are used to parse atoms of
78Parsing location metadata. Parsing location input `p` and optional result `p.q` and parsing continuation `q.q`.
83+$ edge [p=hair q=(unit [p=* q=nail])]
92> (tall:vast [1 1] "a b")
93[p=[p=1 q=3] q=[~ u=[p=[%wing p=~[%a]] q=[p=[p=1 q=2] q=" b"]]]]
98See also: [$rule](#rule).
104Parsing line and column
106A pair of two `@ud` used in parsing indicating line and column number.
120> `hair`[1 1] :: parsing starts at [1 1] as a convention.
123> ((plus ace) [1 1] " --")
124[p=[p=1 q=4] q=[~ u=[p=[~~. " "] q=[p=[p=1 q=4] q="--"]]]]
126> `hair`p:((plus ace) [1 1] " --")
136Generates an [`$edge`](#edge) with a parsed result set to a specific type.
147 u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]]
157[p=[p=1 q=2] q=[~ u=[p=' ' q=[p=[p=1 q=2] q="a"]]]]
159> `(like char)`(ace [1 1] " a")
160[p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]]
162> `(like ,@)`(ace [1 1] " a")
163[p=[p=1 q=2] q=[~ u=[p=32 q=[p=[p=1 q=2] q="a"]]]]
170Location, remainder of parsed text
172Indicates parsing position `p`, and remaining text to be parsed `q`.
177+$ nail [p=hair q=tape]
193A `$pint` is a pair of [`$hair`](#hair), indicating from `p` to `q`. Mostly used for
199+$ pint [p=[p=@ q=@] q=[p=@ q=@]]
205> !:(!!) :: !! always produces a crash
206/~zod/base/~2014.9.20..01.22.04..52e3/:<[1 4].[1 6]>
209[p=[p=1 q=4] q=[p=1 q=6]]
218An empty parsing rule, but used to check that parsing rules match this with `_`.
223+$ rule _|:($:nail $:edge)
229> ([|=(a=nail [p.a ~ u=['a' a]])]:|6 [1 1] "hi")
230[[p=1 q=1] ~ u=['a' p=[p=1 q=1] q="hi"]]
239The stack trace that is printed after crashing.
244 ++ spot [p=path q=pint]
250> !: !! :: !! always produces a crash
251/~zod/base/~2018.8.8..21.42.40..7852:<[1 5].[1 7]>
259Nock result, error report
261Produces either success (`%0`), a block with list of requests blocked on (`%1`),
262or failure with an error report (`%2`).
267+$ tone $% [%0 product=*]
269 [%2 trace=(list [@ta *])]
276> (mink [[20 21] 0 3] $~)
281> (mink [[1 2] !=(!:(+(.)))] ,~)
282[%2 trace=~[[~.spot [[1.685.027.454 1.702.060.386 20.241.306.789.072.368.304.935.424.358.627.395.315.601.229.215.400.789.787.861.332.606 0] [1 20] 1 24]]]]
289Nock result, stack trace
291Produces either success (`%0`), a block with list of requests blocked on (`%1`),
292or failure with a stack trace (`%2`).
297+$ toon $% [%0 p=*] :: success
299 [%2 p=(list tank)] :: stack trace
306> (mock [[20 21] 0 3] $~)
311> (mock [[1 2] !=(!:(+(.)))] ,~)
317 q=[i=[%rose p=[p="/" q="/" r=""] q=[i=[%leaf p="~zod"] t=[i=[%leaf p="base"] t=[i=[%leaf p="~2021.10.16..10.03.16..59ee"] t=~]]]] t=[i=[%leaf p="<[1 20].[1 24]>"] t=~]]
329Pull result out of a [`$edge`](#edge), or crash if there's no result.
335 |@ ++ $ ?~(q.veq !! p.u.q.veq)
342> (wide:vast [1 1] "(add 2 2)")
343[p=[p=1 q=10] q=[~ [p=[%cncl p=[%wing p=~[%add]] q=~[[%sand p=%ud q=2] [%sand p=%ud q=2]]] q=[p=[p=1 q=10] q=""]]]]
347> (wonk (wide:vast [1 1] "(add 2 2)"))
348[%cncl p=[%wing p=~[%add]] q=~[[%sand p=%ud q=2] [%sand p=%ud q=2]]]
353See also: [`$edge`](#edge)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list