on 5e6a67f help sign in
55 lines 1.1 kB history raw
1### `++mang`
3Unit: Slam gate with sample
5Produces a [`++unit`]() computation result from slamming `gat` with
6`sam`, using `sky` to compute or block on nock 11 when applicable.
7Similar to [`++mong`]().
9Accepts
10-------
12`gat` is a [noun]() that is generally a [`gate`]().
14`sam` is a [`sample`]() noun.
16`sky` is an [%iron]() gate invoked with [nock operator 11]().
18Produces
19--------
21The `++unit` of a noun.
23Source
24------
26 ++ mang
27 |= [[gat=* sam=*] sky=$+(* (unit))]
28 ^- (unit)
29 =+ ton=(mong [[gat sam] sky])
30 ?.(?=([0 *] ton) ~ [~ p.ton])
31 ::
33Examples
34--------
36 ~zod/try=> (mang [|=(@ 20) ~] ,~)
37 [~ 20]
38 ~zod/try=> (mang [|=(@ !!) ~] ,~)
39 ~
40 ~zod/try=> (mang [|=(a=@ (add 20 a)) ~] ,~)
41 [~ 20]
42 ~zod/try=> (mang [|=(a=[@ @] (add 20 -.a)) ~] ,~)
43 ~
44 ~zod/try=> (mang [|=(a=[@ @] (add 20 -.a)) [4 6]] ,~)
45 [~ 24]
46 ~zod/try=> (mang [|=(a=@ .^(a)) ~] ,~)
47 ~
48 ~zod/try=> (mang [|=(a=@ .^(a)) ~] ,[~ %42])
49 [~ 42]
50 ~zod/try=> (mang [|=(a=@ .^(a)) ~] |=(a=* [~ a 6]))
51 [~ [0 6]]
52 ~zod/try=> (mang [|=(a=@ .^(a)) 8] |=(a=* [~ a 6]))
53 [~ [8 6]]