zuse: make +drop-pole produce a unit

Both +drop-list and +drop-map produce units instead of crashing. This makes
+drop-pole match that behavior, producing a unit of the resulting tuple.
This commit is contained in:
Fang 2020-06-28 20:50:21 +02:00
parent f7930aaa83
commit 0ecd108f98
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -5923,12 +5923,26 @@
~
(some (~(run by lum) need))
:: :: ++drop-pole:unity
++ drop-pole :: unit tuple
|* but/(pole (unit))
?~ but !!
?~ +.but
u:->.but
[u:->.but (drop-pole +.but)]
++ drop-pole :: collapse to tuple
|^ |* pul=(pole (unit))
?: (test-pole pul) ~
(some (need-pole pul))
::
++ test-pole
|* pul=(pole (unit))
^- ?
?~ pul &
?| ?=(~ -.pul)
?~(+.pul | (test-pole +.pul))
==
::
++ need-pole
|* pul=(pole (unit))
?~ pul !!
?~ +.pul
u:->.pul
[u:->.pul (need-pole +.pul)]
--
--
:: ::::
:::: ++format :: (2d) common formats