on bfaa358 help sign in
57 lines 1.1 kB history raw
1### `++mong`
3Slam gate with sample
5Produces a `++toon` 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 `++toon`.
22Source
23------
25 ++ mong
26 |= {{gat/* sam/*} gul/$-({* *} (unit (unit)))}
27 ^- toon
28 ?. &(?=(^ gat) ?=(^ +.gat))
29 [%2 ~]
30 (mock [[-.gat [sam +>.gat]] -.gat] gul)
31 ::
33Examples
34--------
36 ~zod/try=> (mong [|=(@ 20) ~] ,~)
37 [%0 p=20]
38 ~zod/try=> (mong [|=(@ !!) ~] ,~)
39 [%2 p=~]
40 ~zod/try=> (mong [|=(a/@ (add 20 a)) ~] ,~)
41 [%0 p=20]
42 ~zod/try=> (mong [|=(a/[@ @] (add 20 -.a)) ~] ,~)
43 [%2 p=~]
44 ~zod/try=> (mong [|=(a/[@ @] (add 20 -.a)) [4 6]] ,~)
45 [%0 p=24]
46 ~zod/try=> (mong [|=(a/@ .^(a)) ~] ,~)
47 [%1 p=~[0]]
48 ~zod/try=> (mong [|=(a/@ .^(a)) ~] ,[~ %42])
49 [%0 p=42]
50 ~zod/try=> (mong [|=(a/@ .^(a)) ~] |=(a/* [~ a 6]))
51 [%0 p=[0 6]]
52 ~zod/try=> (mong [|=(a/@ .^(a)) 8] |=(a/* [~ a 6]))
53 [%0 p=[8 6]]
57***