]> gitweb.factorcode.org Git - factor.git/commitdiff
math: fix stack effect for unless-zero and when-zero.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 4 May 2017 01:13:37 +0000 (18:13 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 4 May 2017 01:13:37 +0000 (18:13 -0700)
core/math/math-docs.factor
core/math/math.factor

index 45adc8ab22cc76557a21593cea9a371b048e3270..c37e788efa039df97b175b235d06b02abf068108 100644 (file)
@@ -299,12 +299,12 @@ HELP: unless-zero
 { $examples "This word is equivalent to " { $link if-zero } " with an empty first quotation:"
     { $example
     "USING: sequences math prettyprint ;"
-    "3 [ ] [ sq ] if-zero ."
+    "3 [ ] [ sq . ] if-zero"
     "9"
     }
     { $example
     "USING: sequences math prettyprint ;"
-    "3 [ sq ] unless-zero ."
+    "3 [ sq . ] unless-zero"
     "9"
     }
 } ;
index 62aadea546232d24723b00b6cf45fdd06c2a2c43..0e556d6109783e19aab427db7613d6cf57f934c9 100644 (file)
@@ -152,9 +152,9 @@ GENERIC: neg? ( x -- ? )
 : if-zero ( ..a n quot1: ( ..a -- ..b ) quot2: ( ..a n -- ..b ) -- ..b )
     [ dup zero? ] [ [ drop ] prepose ] [ ] tri* if ; inline
 
-: when-zero ( ..a n quot: ( ..a -- ..b ) -- ..b ) [ ] if-zero ; inline
+: when-zero ( ... n quot: ( ... -- ... x ) -- ... x ) [ ] if-zero ; inline
 
-: unless-zero ( ..a n quot: ( ..a n -- ..b ) -- ..b ) [ ] swap if-zero ; inline
+: unless-zero ( ... n quot: ( ... n -- ... ) -- ... ) [ ] swap if-zero ; inline
 
 UNION: integer fixnum bignum ;