summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2017-11-15 02:57:07 -0500
committerOwen Jacobson <owen@grimoire.ca>2017-11-15 02:57:31 -0500
commitf09bb41676d507c1176dfef7168fc04b1fce4a53 (patch)
treed1c892313089ed572226346f6de441057946f56c
parent70e2b5db72de0882728907c05686961d5d7eb19c (diff)
Fixed binding errors with builtin types "str", "int", and "decimal".
I forgot about wrapping. Fixes #2
-rw-r--r--actinide/types.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/actinide/types.py b/actinide/types.py
index 17f7a3f..bae0547 100644
--- a/actinide/types.py
+++ b/actinide/types.py
@@ -58,11 +58,13 @@ def display_boolean(value):
# These are fixed-precision numbers with no decimal part, obeying common notions
# of machine integer arithmetic. They support large values.
-integer = bind('integer', int)
+@fn
+def integer(value):
+ return int(value)
@fn
def integer_p(value):
- return isinstance(value, integer)
+ return isinstance(value, int)
@fn
def read_integer(value):
@@ -78,11 +80,13 @@ def display_integer(value):
#
# These are variable-precision numbers, which may have a decimal part.
-decimal = bind('decimal', Decimal)
+@fn
+def decimal(value):
+ return Decimal(value)
@fn
def decimal_p(value):
- return isinstance(value, decimal)
+ return isinstance(value, Decimal)
@fn
def read_decimal(value):
@@ -98,11 +102,13 @@ def display_decimal(value):
#
# Sequences of characters.
-string = bind('string', str)
+@fn
+def string(value):
+ return string(Value)
@fn
def string_p(value):
- return not symbol_p(value) and isinstance(value, string)
+ return not symbol_p(value) and isinstance(value, str)
@fn
def read_string(value):
@@ -127,7 +133,7 @@ class Symbol(object):
def __hash__(self):
return hash(self.value)
def __str__(self):
- return f"{self.value}"
+ return self.value
def __repr__(self):
return f'Symbol({repr(self.value)})'