Integer division only please.
This commit is contained in:
parent
8c65046420
commit
fbdd79a8db
|
|
@ -70,8 +70,7 @@ ALIASES = (
|
||||||
('and', ['&']),
|
('and', ['&']),
|
||||||
('bool', ['truthy']),
|
('bool', ['truthy']),
|
||||||
('mul', ['*']),
|
('mul', ['*']),
|
||||||
('floordiv', ['/floor', '//']),
|
('floordiv', ['/floor', '//', '/', 'div']),
|
||||||
('truediv', ['/', 'div']),
|
|
||||||
('mod', ['%', 'rem', 'remainder', 'modulus']),
|
('mod', ['%', 'rem', 'remainder', 'modulus']),
|
||||||
('eq', ['=']),
|
('eq', ['=']),
|
||||||
('ge', ['>=']),
|
('ge', ['>=']),
|
||||||
|
|
@ -1165,7 +1164,10 @@ def dip(stack, expression, dictionary):
|
||||||
... Q x
|
... Q x
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
try:
|
||||||
(quote, (x, stack)) = stack
|
(quote, (x, stack)) = stack
|
||||||
|
except ValueError:
|
||||||
|
raise StackUnderflowError
|
||||||
expression = (x, expression)
|
expression = (x, expression)
|
||||||
return stack, concat(quote, expression), dictionary
|
return stack, concat(quote, expression), dictionary
|
||||||
|
|
||||||
|
|
@ -1425,7 +1427,7 @@ for F in (
|
||||||
BinaryBuiltinWrapper(operator.mul),
|
BinaryBuiltinWrapper(operator.mul),
|
||||||
BinaryBuiltinWrapper(operator.pow),
|
BinaryBuiltinWrapper(operator.pow),
|
||||||
BinaryBuiltinWrapper(operator.sub),
|
BinaryBuiltinWrapper(operator.sub),
|
||||||
BinaryBuiltinWrapper(operator.truediv),
|
## BinaryBuiltinWrapper(operator.truediv),
|
||||||
|
|
||||||
UnaryBuiltinWrapper(bool),
|
UnaryBuiltinWrapper(bool),
|
||||||
UnaryBuiltinWrapper(operator.not_),
|
UnaryBuiltinWrapper(operator.not_),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue