diff --git a/core/math/math-docs.factor b/core/math/math-docs.factor index 45adc8ab22..c37e788efa 100644 --- a/core/math/math-docs.factor +++ b/core/math/math-docs.factor @@ -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" } } ; diff --git a/core/math/math.factor b/core/math/math.factor index 62aadea546..0e556d6109 100644 --- a/core/math/math.factor +++ b/core/math/math.factor @@ -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 ;