on bfaa358 help sign in
53 lines 1.1 kB history raw
1### `++mock`
3Compute formula on subject with hint
5Produces a `++toon`, which is either a sucessful, blocked, or
6crashed result. If nock 11 is invoked, `sky` computes on the subject and
7produces a `++unit` result. An empty result becomes a `%1` `++tune`,
8indicating a block.
10Accepts
11-------
13`sub` is the subject as a noun.
15`fol` is the formula as a noun.
17`sky` is an %iron gate invoked with nock operator 11.
19Produces
20--------
22The `++unit` of a noun.
24Source
25------
27 ++ mock
28 |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
29 (mook (mink [sub fol] gul))
30 ::
33Examples
34--------
36 ~zod/try=> (mock [5 4 0 1] ,~)
37 [%0 p=6]
38 ~zod/try=> (mock [~ 11 1 0] |=(* `999))
39 [%0 p=999]
40 ~zod/try=> (mock [~ 0 1.337] ,~)
41 [%2 p=~]
42 ~zod/try=> (mock [~ 11 1 1.337] ,~)
43 [%1 p=~[1.337]]
44 ~zod/try=> (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[+<]))
45 [%0 p=14]
46 ~zod/try=> (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>]))
47 [%0 p=[49 52 0]]
48 ~zod/try=> ;;(tape +:(mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>])))
49 "14"
53***