From 7ef313c5e1722a3daa77b5bd92cdfe2d7ba35661 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Thu, 3 Jun 2021 12:13:22 -0500 Subject: [PATCH 1/2] hoon: add +sink, a slow (but faster than dunk) type printing --- pkg/arvo/sys/hoon.hoon | 77 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index d84d3a35c..1cf76a379 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -8764,6 +8764,7 @@ %peek peek %repo repo %rest rest + %sink sink %tack tack %toss toss %wrap wrap @@ -10838,7 +10839,7 @@ |- ^- type ?~ lov sut $(lov t.lov, sut (face i.lov sut)) - :: :: + :: ++ sint :: reduce by reference |= $: :: hod: expand holds :: @@ -10911,6 +10912,80 @@ %- ~(gas in *(set type)) (turn leg |=([p=type q=hoon] (play(sut p) q))) :: + ++ sink + ~/ %sink + |^ ^- cord + ?- sut + %void 'void' + %noun 'noun' + [%atom *] + %+ rap 3 + :~ 'atom ' + p.sut + ' ' + ?~(q.sut '~' u.q.sut) + == + :: + [%cell *] + %+ rap 3 + :~ 'cell ' + (scot %p (mup p.sut)) + ' ' + (scot %p (mup q.sut)) + == + :: + [%face *] + %+ rap 3 + :~ 'face ' + ?@ p.sut + p.sut + (scot %p (mup p.sut)) + ' ' + (scot %p (mup q.sut)) + == + :: + [%fork *] + %+ rap 3 + :~ 'fork ' + (scot %p (mup p.sut)) + == + :: + [%hint *] + %+ rap 3 + :~ 'hint ' + (scot %p (mup p.sut)) + ' ' + (scot %p (mup q.sut)) + == + :: + [%hold *] + %+ rap 3 + :~ 'hold ' + (scot %p (mup p.sut)) + ' ' + (scot %p (mup q.sut)) + == + :: + [%core *] + %+ rap 3 + :~ 'core ' + (scot %p (mup p.sut)) + ' ' + ?~(p.p.q.sut '~' u.p.p.q.sut) + ' ' + q.p.q.sut + ' ' + r.p.q.sut + ' ' + (scot %p (mup q.q.sut)) + ' ' + (scot %p (mup p.r.q.sut)) + == + == + :: + ++ mup |=(* `@p`(mug +<)) + -- + :: ++ take |= [vit=vein duz=$-(type type)] ^- (pair axis type) From b6206728cc9933f66b51d5e481e28f5c5fca9293 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Fri, 4 Jun 2021 16:06:40 -0500 Subject: [PATCH 2/2] hoon: make +sink more concise --- pkg/arvo/sys/hoon.hoon | 65 ++++++++---------------------------------- 1 file changed, 12 insertions(+), 53 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 1cf76a379..9d1daf25f 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -10916,60 +10916,19 @@ ~/ %sink |^ ^- cord ?- sut - %void 'void' - %noun 'noun' - [%atom *] - %+ rap 3 - :~ 'atom ' - p.sut - ' ' - ?~(q.sut '~' u.q.sut) - == - :: - [%cell *] - %+ rap 3 - :~ 'cell ' - (scot %p (mup p.sut)) - ' ' - (scot %p (mup q.sut)) - == - :: - [%face *] - %+ rap 3 - :~ 'face ' - ?@ p.sut - p.sut - (scot %p (mup p.sut)) - ' ' - (scot %p (mup q.sut)) - == - :: - [%fork *] - %+ rap 3 - :~ 'fork ' - (scot %p (mup p.sut)) - == - :: - [%hint *] - %+ rap 3 - :~ 'hint ' - (scot %p (mup p.sut)) - ' ' - (scot %p (mup q.sut)) - == - :: - [%hold *] - %+ rap 3 - :~ 'hold ' - (scot %p (mup p.sut)) - ' ' - (scot %p (mup q.sut)) - == + %void 'void' + %noun 'noun' + [%atom *] (rap 3 'atom ' p.sut ' ' ?~(q.sut '~' u.q.sut) ~) + [%cell *] (rap 3 'cell ' (mup p.sut) ' ' (mup q.sut) ~) + [%face *] (rap 3 'face ' ?@(p.sut p.sut (mup p.sut)) ' ' (mup q.sut) ~) + [%fork *] (rap 3 'fork ' (mup p.sut) ~) + [%hint *] (rap 3 'hint ' (mup p.sut) ' ' (mup q.sut) ~) + [%hold *] (rap 3 'hold ' (mup p.sut) ' ' (mup q.sut) ~) :: [%core *] %+ rap 3 :~ 'core ' - (scot %p (mup p.sut)) + (mup p.sut) ' ' ?~(p.p.q.sut '~' u.p.p.q.sut) ' ' @@ -10977,13 +10936,13 @@ ' ' r.p.q.sut ' ' - (scot %p (mup q.q.sut)) + (mup q.q.sut) ' ' - (scot %p (mup p.r.q.sut)) + (mup p.r.q.sut) == == :: - ++ mup |=(* `@p`(mug +<)) + ++ mup |=(* (scot %p (mug +<))) -- :: ++ take