hoon: modernizes virtualization style

This commit is contained in:
Joe Bryan 2020-05-14 18:30:45 -07:00
parent 7ad707edc5
commit dae21cdbe7

View File

@ -6314,11 +6314,14 @@
:: ::
:::: 4n: virtualization :::: 4n: virtualization
:: ::
:: +mack: untyped, scry-less, unitary virtualization
::
++ mack ++ mack
|= {sub/* fol/*} |= [sub=* fol=*]
^- (unit) ^- (unit)
=+ ton=(mink [sub fol] |=({* *} ~)) =/ ton (mink [sub fol] |~(^ ~))
?.(?=({$0 *} ton) ~ [~ product.ton]) ?.(?=(%0 -.ton) ~ `product.ton)
:: +mink: raw virtual nock
:: ::
++ mink !. ++ mink !.
~/ %mink ~/ %mink
@ -6480,9 +6483,10 @@
%3 `[-.target u.mutant] %3 `[-.target u.mutant]
== ==
-- --
:: +mock: virtual nock
:: ::
++ mock ++ mock
|= {{sub/* fol/*} gul/$-({* *} (unit (unit)))} |= [[sub=* fol=*] gul=$-(^ (unit (unit)))]
(mook (mink [sub fol] gul)) (mook (mink [sub fol] gul))
:: +mook: convert $tone to %toon, rendering stack frames if present :: +mook: convert $tone to %toon, rendering stack frames if present
:: ::
@ -6569,24 +6573,23 @@
^- (unit _$:tap) ^- (unit _$:tap)
=/ mur (mure tap) =/ mur (mure tap)
?~(mur ~ `$:tap) ?~(mur ~ `$:tap)
:: +mong: virtual slam
:: ::
++ mong ++ mong
|= {{gat/* sam/*} gul/$-({* *} (unit (unit)))} |= [[gat=* sam=*] gul=$-(^ (unit (unit)))]
^- toon ^- toon
?. &(?=(^ gat) ?=(^ +.gat)) ?. ?=([* ^] gat) [%2 ~]
[%2 ~]
(mock [gat(+< sam) %9 2 %0 1] gul) (mock [gat(+< sam) %9 2 %0 1] gul)
:: +mule: typed virtual
:: ::
++ mule :: typed virtual ++ mule
~/ %mule ~/ %mule
=+ taq=|.(**) |* tap=(trap)
|@ ++ $ =/ mud (mute tap)
=+ mud=(mute taq)
?- -.mud ?- -.mud
%& [%& p=$:taq] %& [%& p=$:tap]
%| [%| p=p.mud] %| [%| p=p.mud]
== ==
--
:: +mure: untyped unitary virtual :: +mure: untyped unitary virtual
:: ::
++ mure ++ mure
@ -6594,15 +6597,19 @@
^- (unit) ^- (unit)
=/ ton (mink [tap %9 2 %0 1] |=((pair) ``.*(~ [%12 1+p 1+q]))) =/ ton (mink [tap %9 2 %0 1] |=((pair) ``.*(~ [%12 1+p 1+q])))
?.(?=(%0 -.ton) ~ `product.ton) ?.(?=(%0 -.ton) ~ `product.ton)
:: +mute: untyped virtual
:: ::
++ mute :: untyped virtual ++ mute
|= taq/_=>(~ ^?(|.(**))) |= tap=(trap)
^- (each * (list tank)) ^- (each * (list tank))
=/ ton (mock [taq %9 2 %0 1] |=((pair) ``.*(~ [%12 1+p 1+q]))) =/ ton (mock [tap %9 2 %0 1] |=((pair) ``.*(~ [%12 1+p 1+q])))
?- -.ton ?- -.ton
$0 [%& p.ton] %0 [%& p.ton]
$1 [%| (smyt (path p.ton)) ~] ::
$2 [%| p.ton] %1 =/ sof=(unit path) ((soft path) p.ton)
[%| ?~(sof leaf+"mute.hunk" (smyt u.sof)) ~]
::
%2 [%| p.ton]
== ==
:: +slum: slam a gate on a sample using raw nock, untyped :: +slum: slam a gate on a sample using raw nock, untyped
:: ::