hoon: add +rev

This commit is contained in:
Alex Shelkovnykov 2023-09-04 15:26:03 -06:00
parent 4af4ac7296
commit 49935059b7

View File

@ -292,6 +292,16 @@
%+ add $(i +(i), b t.b)
(lsh [bloq (mul step i)] (end [bloq step] i.b))
::
++ rev :: reverse block order
~/ %rev
|= [boz=bloq len=@ud dat=@]
~> %sham.%rev
^- @
=. dat (end [boz len] dat)
%+ lsh
[boz (sub len (met boz dat))]
(swp boz dat)
::
++ rip :: disassemble
~/ %rip
|= [a=bite b=@]