on master help sign in
added !< entry (#792)
4c66292poprox
reference/hoon-expressions/rune/zap.md+37−1
@@ -36,6 +36,42 @@ If you want just the type value, use a 'type spear'. This is `-:!>`, i.e., the
36#t/@ud
36#t/@ud
37```
37```
38
38
39+### !< "zapgal"
40+
41+`[%zpld p=spec q=hoon]`
42+
43+Takes a mold and a `vase` and dynamically checks that the type in the `vase`
44+matches the mold.
45+
46+##### Produces
47+
48+The value of `vase` typed with the type of the mold if possible, else a
49+`nest-fail`.
50+
51+##### Syntax
52+
53+Regular: **2-fixed**
54+
55+##### Discussion
56+
57+This is something like a partial inverse to the `!>` rune and can be used to extract
58+a typed value from a `vase`.
59+
60+##### Examples
61+
62+```
63+> !< @ !> ~zod
64+0
65+
66+> !< @p !> 0
67+nest-fail
68+
69+> =m !> 0
70+> =n !> 1
71+> !< [@ @] (slop m n)
72+[0 1]
73+```
74+
39### !: "zapcol"
75### !: "zapcol"
40
76
41`[%dbug p=hoon]`: turn on stack trace
77`[%dbug p=hoon]`: turn on stack trace
@@ -200,4 +236,4 @@ Nothing. Always crashes, with type `%void`.
200```
236```
201> !!
237> !!
202ford: build failed
238ford: build failed
203−```
239+```