mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-03 12:42:48 +03:00
adds list +join gate to stdlib
This commit is contained in:
parent
8356ce737f
commit
5758bad98a
@ -555,6 +555,17 @@
|
||||
|@ ++ $ ?:(*? ~ [i=(snag 0 a) t=$])
|
||||
--
|
||||
a
|
||||
:: +join: construct a new list, placing .sep between every pair in .lit
|
||||
::
|
||||
++ join
|
||||
|* [sep=* lit=(list)]
|
||||
=. sep `_?>(?=(^ lit) i.lit)`sep
|
||||
?~ lit ~
|
||||
=| out=(list _?>(?=(^ lit) i.lit))
|
||||
|- ^+ out
|
||||
?~ t.lit
|
||||
(flop [i.lit out])
|
||||
$(out [sep i.lit out], lit t.lit)
|
||||
::
|
||||
:: +bake: convert wet gate to dry gate by specifying argument mold
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user