mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-06 23:16:29 +03:00
add +slam:wa and tests
This commit is contained in:
parent
82bf90df3f
commit
1c3ea0b188
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:a4a8e1daf0bfe86d5fc4ef7060b0c6a6c2678a344787926f14bb4b8cfabe8752
|
oid sha256:54dae6825ebdcd680241ebcee83fbd4263c8f3dd71adf0009700e79d99c3be2c
|
||||||
size 9549390
|
size 9627570
|
||||||
|
@ -17290,6 +17290,14 @@
|
|||||||
=+ new=(~(mint ut sut) %noun gen)
|
=+ new=(~(mint ut sut) %noun gen)
|
||||||
[new +>+<.$(mit (~(put by mit) [sut gen] new))]
|
[new +>+<.$(mit (~(put by mit) [sut gen] new))]
|
||||||
::
|
::
|
||||||
|
++ slam :: ++slam, cached
|
||||||
|
|= [gat=vase sam=vase]
|
||||||
|
^- [vase worm]
|
||||||
|
=/ sut=type [%cell p.gat p.sam]
|
||||||
|
=/ gen=hoon [%cnsg [%$ ~] [%$ 2] [%$ 3] ~]
|
||||||
|
=^ new=type +>+<.$ (play sut gen)
|
||||||
|
[[new (slum q.gat q.sam)] +>+<.$]
|
||||||
|
::
|
||||||
++ slap :: ++slap, cached
|
++ slap :: ++slap, cached
|
||||||
|= {vax/vase gen/hoon}
|
|= {vax/vase gen/hoon}
|
||||||
^- {vase worm}
|
^- {vase worm}
|
||||||
|
33
pkg/arvo/tests/sys/hoon/vases.hoon
Normal file
33
pkg/arvo/tests/sys/hoon/vases.hoon
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/+ *test
|
||||||
|
|%
|
||||||
|
++ test-slam-wa ^- tang
|
||||||
|
::
|
||||||
|
;: weld
|
||||||
|
%+ expect-eq
|
||||||
|
!>(7)
|
||||||
|
-:(~(slam wa *worm) !>(add) !>([3 4]))
|
||||||
|
::
|
||||||
|
%+ expect-eq
|
||||||
|
!>(~[3 2 1])
|
||||||
|
-:(~(slam wa *worm) !>(flop) !>(~[1 2 3]))
|
||||||
|
::
|
||||||
|
=| =worm
|
||||||
|
=^ res1 worm (~(slam wa worm) !>(flop) !>(`(list @)`~[1 2 3]))
|
||||||
|
=/ worm1 worm
|
||||||
|
=^ res2 worm (~(slam wa worm) !>(flop) !>(`(list @)`~[4 5 6]))
|
||||||
|
::
|
||||||
|
;; weld
|
||||||
|
%+ expect-eq
|
||||||
|
res1
|
||||||
|
!>(`(list @)`~[3 2 1])
|
||||||
|
::
|
||||||
|
%+ expect-eq
|
||||||
|
res2
|
||||||
|
!>(`(list @)`~[6 5 4])
|
||||||
|
::
|
||||||
|
%+ expect-eq
|
||||||
|
worm
|
||||||
|
worm1
|
||||||
|
==
|
||||||
|
==
|
||||||
|
--
|
Loading…
Reference in New Issue
Block a user