math: fix stack effect for unless-zero and when-zero.

char-rename
John Benediktsson 2017-05-03 18:13:37 -07:00
parent e44104c8d2
commit 0f52366466
2 changed files with 4 additions and 4 deletions

View 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"
}
} ;

View 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 ;