++mine battery builder for callback from jets.
::
:::: 5aa: new partial nock interpreter
::
-++ musk !: :: nock with block set
+++ musk !. :: nock with block set
=> :: keep soft core out of models
+
=> |%
%fuse fuse
%gain gain
%lose lose
+ %mine mine
%mint mint
%moot moot
%mull mull
|= gen/hoon ^- type
(chip & gen)
::
+ ++ hemp
+ :: generate formula from foot
+ ::
+ |= fut/foot
+ ^- nock
+ ~+
+ ?- -.fut
+ $ash q:(mint %noun p.fut)
+ $elm q:(mint(vet |) %noun p.fut)
+ ==
+ ::
+ ++ hoof
+ :: lazy formula generator for cores being compiled
+ ::
+ |= dom/(map @ tomb)
+ ^- seminoun:musk
+ ~+
+ |- ^- seminoun:musk
+ ?: ?=(~ dom)
+ *seminoun:musk
+ =/ dov
+ =/ dab/(map term (pair what foot)) q.q.n.dom
+ |- ^- seminoun:musk
+ ?: ?=(~ dab)
+ *seminoun:musk
+ =/ vad/seminoun:musk =+(hemp [[%lazy -(+< q.q.n.dab)] ~])
+ ?- dab
+ {* ~ ~} vad
+ {* ~ *} (combine:musk vad $(dab r.dab))
+ {* * ~} (combine:musk vad $(dab l.dab))
+ {* * *} :(combine:musk vad $(dab l.dab) $(dab r.dab))
+ ==
+ ?- dom
+ {* ~ ~} dov
+ {* ~ *} (combine:musk dov $(dom r.dom))
+ {* * ~} (combine:musk dov $(dom l.dom))
+ {* * *} :(combine:musk dov $(dom l.dom) $(dom r.dom))
+ ==
+ ::
++ harp
|= dab/(map term (pair what foot))
^- ?(~ ^)
?: ?=(~ dab)
~
- =+ ^= vad
- ?- -.q.q.n.dab
- $ash q:(mint %noun p.q.q.n.dab)
- $elm q:(mint(vet |) %noun p.q.q.n.dab)
- ==
+ =+ vad=(hemp q.q.n.dab)
?- dab
{* ~ ~} vad
{* ~ *} [vad $(dab r.dab)]
=+ neg=~(open ap gen)
?:(=(neg gen) sut $(gen neg))
::
+ ++ mine
+ :: compile a core, minting all within it.
+ ::
+ ~/ %mine
+ |= dom/(map @ tomb)
+ ^- ?(~ ^)
+ (hope(sut (core sut %gold sut *chap ~ dom)) dom)
+ ::
++ mint
~/ %mint
|= {gol/type gen/hoon}
|= {mel/vair ruf/hoon wad/chap dom/(map @ tomb)}
^- {p/type q/nock}
=+ dan=^$(gen ruf, gol %noun)
- =+ toc=(core p.dan [%gold p.dan wad [~ dom]])
- =+ dez=(hope(sut toc) dom)
+ =+ dez=(mine(sut p.dan) dom)
:- (nice (core p.dan mel p.dan wad [dez dom]))
(cons [%1 dez] q.dan)
--
