2title = "4n: Virtualization"
11Accepts a nock subject-formula cell and wraps it into a `++unit`.
12`fol` is pure nock, meaning that nock `11` operations result in a block,
17`sub` is a subject noun.
19`fol` is a formula noun, which is generally a `++nock`.
23The `++unit` of a noun.
31 =+ ton=(mink [sub fol] |=({* *} ~))
32 ?.(?=({$0 *} ton) ~ [~ p.ton])
39 > (mack [[1 2 3] [0 1]])
45 > (mack [[[0 2] [1 3]] 4 4 4 4 0 5])
47 > ;;((unit @tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
57Bottom-level mock (virtual nock) interpreter. Produces a
58`++tone`, a nock computation result. If nock 11 is invoked, `sky`
59computes on the subject and produces a `++unit` result. An empty
60result becomes a `%1` `++tone`, indicating a block.
64`sub` is the subject as a noun.
66`fol` is the formula as a noun.
68`sky` is an `%iron` gate invoked with nock operator 11.
79 |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
80 =+ tax=*(list {@ta *})
90 $0 ?-(-.hed $0 [%0 p.hed p.tal], $1 hed)
91 $1 ?-(-.hed $0 tal, $1 [%1 (weld p.hed p.tal)])
98 ?: =(0 b.fol) [%2 tax]
99 ?: =(1 b.fol) [%0 sub]
100 ?: ?=(@ sub) [%2 tax]
101 =+ [now=(cap b.fol) lat=(mas b.fol)]
102 $(b.fol lat, sub ?:(=(2 now) -.sub +.sub))
110 ?>(?=(^ p.ben) $(sub -.p.ben, fol +.p.ben))
111 ::?>(?=(^ p.ben) $([sub fol] p.ben)
121 ?. ?=(@ p.ben) [%2 tax]
127 ?. ?=(^ p.ben) [%2 tax]
128 [%0 =(-.p.ben +.p.ben)]
131 $(fol =>(fol [2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]))
133 {$7 b/* c/*} $(fol =>(fol [2 b 1 c]))
134 {$8 b/* c/*} $(fol =>(fol [7 [[0 1] b] c]))
135 {$9 b/* c/*} $(fol =>(fol [7 c 0 b]))
136 {$10 @ c/*} $(fol c.fol)
140 ?: ?=(?($hunk $hand $lose $mean $spot) b.fol)
141 $(fol d.fol, tax [[b.fol p.ben] tax])
149 =+ val=(gul p.ref p.ben)
150 ?~(val [%1 p.ben ~] ?~(u.val [%2 [[%hunk (mush p.ben)] tax]] [%0 u.u.val]))
158 > (mink [20 [4 0 1]] $~)
160 > (mink [[90 5 3] [0 3]] $~)
162 > (mink 20^[4 0 1] $~)
164 > (mink [90 5 3]^[0 3] $~)
166 > (mink [0]^[11 1 20] $~)
168 > (mink [0]^[11 1 20] |=(a=* `[40 a]))
170 > (mink [5]^[0 2] $~)
172 > (mink [5]^[10 yelp/[0 1] 0 0] $~)
179Compute formula on subject with hint
181Produces a `++toon`, which is either a sucessful, blocked, or
182crashed result. If nock 11 is invoked, `sky` computes on the subject and
183produces a `++unit` result. An empty result becomes a `%1` `++tune`,
188`sub` is the subject as a noun.
190`fol` is the formula as a noun.
192`sky` is an %iron gate invoked with nock operator 11.
196The `++unit` of a noun.
202 |= {{sub/* fol/*} gul/$-({* *} (unit (unit)))}
203 (mook (mink [sub fol] gul))
210 > (mock [5 4 0 1] ,~)
212 > (mock [~ 11 1 0] |=(* `999))
214 > (mock [~ 0 1.337] ,~)
216 > (mock [~ 11 1 1.337] ,~)
218 > (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[+<]))
220 > (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>]))
222 > ;;(tape +:(mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>])))
232Produces a `++toon` computation result from slamming `gat` with
233`sam`, using `sky` to compute or block on nock 11 when applicable.
237`gat` is a noun that is generally a `gate`.
239`sam` is a `sample` noun.
241`sky` is an %iron gate invoked with nock operator 11.
251 |= {{gat/* sam/*} gul/$-({* *} (unit (unit)))}
253 ?. &(?=(^ gat) ?=(^ +.gat))
255 (mock [[-.gat [sam +>.gat]] -.gat] gul)
262 > (mong [|=(@ 20) ~] ,~)
264 > (mong [|=(@ !!) ~] ,~)
266 > (mong [|=(a/@ (add 20 a)) ~] ,~)
268 > (mong [|=(a/[@ @] (add 20 -.a)) ~] ,~)
270 > (mong [|=(a/[@ @] (add 20 -.a)) [4 6]] ,~)
272 > (mong [|=(a/@ .^(a)) ~] ,~)
274 > (mong [|=(a/@ .^(a)) ~] ,[~ %42])
276 > (mong [|=(a/@ .^(a)) ~] |=(a/* [~ a 6]))
278 > (mong [|=(a/@ .^(a)) 8] |=(a/* [~ a 6]))
286Intelligently render crash annotation
288Converts a `%2` `++tone` nock stack trace to a list of `++tank`.
289Each may be a tank, cord, `++spot`, or trapped tank.
305 ?. ?=({$2 *} ton) ton
307 :: =. p.ton (moop p.ton)
310 ?. (gth yel 256) p.ton
314 :_ (slag (sub yel 128) p.ton)
317 "[skipped {(scow %ud (sub yel 256))} frames]"
320 =+ rep=$(p.ton t.p.ton)
322 $hunk [(tank +.i.p.ton) rep]
323 $lose [[%leaf (rip 3 (@ +.i.p.ton))] rep]
324 $hand [[%leaf (scow %p (mug +.i.p.ton))] rep]
326 ?@ +.i.p.ton [%leaf (rip 3 (@ +.i.p.ton))]
327 =+ mac=(mack +.i.p.ton +<.i.p.ton)
328 ?~(mac [%leaf "####"] (tank u.mac))
330 =+ sot=(spot +.i.p.ton)
333 => [ud=|=(a/@u (scow %ud a)) q.sot]
334 leaf+"<[{(ud p.p)} {(ud q.p)}].[{(ud p.q)} {(ud q.q)}]>"
342 > (mook [%0 5 4 5 1])
344 > (mook [%2 ~[[%hunk %rose ["<" "," ">"] ~[[%leaf "err"]]]]])
345 [%2 p=~[[%rose p=[p="<" q="," r=">"] q=[i=[%leaf p="err"] t=~]]]]
346 > (mook [%2 ~[[%malformed %elem] [%lose 'do print']]])
347 [%2 p=~[[%leaf p="do print"]]]
348 > (mook [%2 ~[[%mean |.(>(add 5 6)<)]]])
349 [%2 p=~[[%leaf p="11"]]]
350 > (mook [%2 ~[[%spot /b/repl [1 1]^[1 2]] [%mean |.(!!)]]])
351 [%2 p=~[[%leaf p="/b/repl/:<[1 1].[1 2]>"] [%leaf p="####"]]]
360Kicks a `++trap`, producing its results or any errors that occur along
361the way. Used to lazily compute stack traces.
365`taq` is a `++trap`, generally producing a list of `++tank`s.
374 ++ mule :: typed virtual
379 $& [%& p=$:taq] :: XX transition
388 > (mule |.(leaf/"hello"))
389 [%.y p=[%leaf "hello"]]
392 > (mule |.(.^(a//=pals/1)))
397 p=[p="/" q="/" r="/"]
400 t=[i=[%leaf p="~zod"] t=[i=[%leaf p="pals"] t=[i=[%leaf p="1"] t=~]]]
413Kicks a `++trap`, producing its result as a noun or the tanks of any
414error that occurs. Similar to `++mule`, but preserves no type
422Either a noun or a `++list` of `++tank`.
427 ++ mute :: untyped virtual
429 ^- (each * (list tank))
430 =+ ton=(mock [taq 9 2 0 1] |=({* *} ~))
433 $1 [%| (turn p.ton |=(a/* (smyt (path a))))]
441 > (mute |.(leaf/"hello"))
442 [%.y p=[1.717.658.988 104 101 108 108 111 0]]
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list