From 465f22a918ea6cf56f9f6c0c769090afd0bef57e Mon Sep 17 00:00:00 2001 From: johncburnham Date: Thu, 1 May 2014 21:16:40 -0700 Subject: [PATCH] added ++fil and ++swap --- arvo/hoon.hoon | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 40bdd1e20c..cf2a4542c7 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -821,6 +821,15 @@ |= [a=bloq b=@ c=@] (mod c (bex (mul (bex a) b))) :: +++ fil :: fill bloqstream + |= [a=bloq b=@ c=@] + =+ n=0 + =+ d=c + |- ^- @ + ?: =(n b) + (rsh a 1 d) + $(d (add c (lsh a 1 d)), n +(n)) +::: ++ lsh :: left-shift ~/ %lsh |= [a=bloq b=@ c=@] @@ -866,6 +875,8 @@ ~/ %rsh |= [a=bloq b=@ c=@] (div c (bex (mul (bex a) b))) +++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order +:: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2cB, bit logic :: ::