on 492ae2f help sign in
48 lines 798 B history raw
1### `++mack`
3Nock subject to unit
5Accepts a nock subject-formula cell and wraps it into a `++unit`.
6`fol` is pure nock, meaning that nock `11` operations result in a block,
7producing a `~`.
9Accepts
10-------
12`sub` is a subject noun.
14`fol` is a formula noun, which is generally a `++nock`.
16Produces
17--------
19The `++unit` of a noun.
21Source
22------
24 ++ mack
25 |= {sub/* fol/*}
26 ^- (unit)
27 =+ ton=(mink [sub fol] |=({* *} ~))
28 ?.(?=({$0 *} ton) ~ [~ p.ton])
29 ::
32Examples
33--------
35 ~zod/try=> (mack [[1 2 3] [0 1]])
36 [~ [1 2 3]]
37 ~zod/try=> (mack [41 4 0 1])
38 [~ 42]
39 ~zod/try=> (mack [4 0 4])
40 ~
41 ~zod/try=> (mack [[[0 2] [1 3]] 4 4 4 4 0 5])
42 [~ 6]
43 ~zod/try=> ;;((unit @tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
44 [~ %no]
48***