on 492ae2f help sign in
55 lines 1.2 kB history raw
1### `++mung`
3Virtualize slamming gate
5Produces a [`++tone`]() computation result from slamming `gat` with
6`sam`, using `sky` to compute or block on nock 11 when applicable.
8Accepts
9-------
11`gat` is a [noun]() that is generally a [`gate`]().
13`sam` is a [`sample`]() noun.
15`sky` is an [%iron]() gate invoked with [nock operator 11]().
17Produces
18--------
20A `++tone`.
22Source
23------
25 ++ mung
26 |= [[gat=* sam=*] sky=$+(* (unit))]
27 ^- tone
28 ?. &(?=(^ gat) ?=(^ +.gat))
29 [%2 ~]
30 (mink [[-.gat [sam +>.gat]] -.gat] sky)
31 ::
33Examples
34--------
36 ~zod/try=> (mung [|=(@ 20) ~] ,~)
37 [%0 p=20]
38 ~zod/try=> (mung [|=(@ !!) ~] ,~)
39 [%2 p=~]
40 ~zod/try=> (mung [|=(a=@ (add 20 a)) ~] ,~)
41 [%0 p=20]
42 ~zod/try=> (mung [|=(a=[@ @] (add 20 -.a)) ~] ,~)
43 [%2 p=~]
44 ~zod/try=> (mung [|=(a=[@ @] (add 20 -.a)) [4 6]] ,~)
45 [%0 p=24]
46 ~zod/try=> (mung [|=(a=@ .^(a)) ~] ,~)
47 [%1 p=~[0]]
48 ~zod/try=> (mung [|=(a=@ .^(a)) ~] ,[~ %42])
49 [%0 p=42]
50 ~zod/try=> (mung [|=(a=@ .^(a)) ~] |=(a=* [~ a 6]))
51 [%0 p=[0 6]]
52 ~zod/try=> (mung [|=(a=@ .^(a)) 8] |=(a=* [~ a 6]))
53 [%0 p=[8 6]]