]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences: fix stack effect declarations for when-empty and unless-empty
authorAlexander Ilin <alex.ilin@protonmail.com>
Thu, 6 Oct 2022 14:03:18 +0000 (16:03 +0200)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 7 Oct 2022 22:21:39 +0000 (17:21 -0500)
core/sequences/sequences.factor

index 91e231b1903cc90498a8998eaeed112834ae2391..b3c5564764e2f9fdf0eaa2d5babaa742c4bfda36 100644 (file)
@@ -31,9 +31,8 @@ M: sequence shorten 2dup length < [ set-length ] [ 2drop ] if ; inline
 : if-empty ( ..a seq quot1: ( ..a -- ..b ) quot2: ( ..a seq -- ..b ) -- ..b )
     [ dup empty? ] [ [ drop ] prepose ] [ ] tri* if ; inline
 
-: when-empty ( seq quot -- ) [ ] if-empty ; inline
-
-: unless-empty ( seq quot -- ) [ ] swap if-empty ; inline
+: when-empty ( ... seq quot: ( ... -- obj ) -- ... seq/obj ) [ ] if-empty ; inline
+: unless-empty ( ... seq quot: ( ... seq -- ... ) -- ... ) [ ] swap if-empty ; inline
 
 : delete-all ( seq -- ) 0 swap set-length ;