Loading object.py +52 −36 Original line number Diff line number Diff line Loading @@ -165,9 +165,9 @@ class Error(Object): def __repr__(self): return str(self) def describe(self): a = super().describe() a.update(self.e.__dict__) return a attrs = super().describe() attrs.update(self.e.__dict__) return attrs _gensym_counter = 8385 Loading Loading @@ -267,9 +267,10 @@ class Symbol(Object): else: raise PyleArgTypeError(self, 'cxr', 'list') def describe(self): a = super(Symbol, self).describe() a["props"] = self._props return a attrs = super().describe() attrs["props"] = self._props return attrs def init_symbol(): global Nil, T, ImmutableSymbol, FunctionSymbol, NamePropSymbol, IdPropSymbol Loading Loading @@ -335,13 +336,18 @@ class Macro(Function): finally: backtoEnvironment(savedEnv) def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), "name": self.name, "params": self.params, attrs = super().describe() attrs.update({ "name": self.name, "params": self.params, "minargs": Number(self.minargs), "maxargs": Number(self.maxargs), "synopsis": self.synopsis(), "docstring": self._docstring, "body": self.body, "docstring": self._docstring, "body": self.body, }) return attrs # this is used for parameter bindings on function calls and variable # bindings in let/let*; destructuring binds will go here, too Loading Loading @@ -434,14 +440,19 @@ class Form(Function): finally: backtoEnvironment(savedEnv) def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), "env": self.env, "name": self.name, "params": self.params, attrs = super().describe() attrs.update({ "env": self.env, "name": self.name, "params": self.params, "minargs": Number(self.minargs), "maxargs": Number(self.maxargs), "synopsis": self.synopsis(), "special": p2l(self.special), "docstring": self._docstring, "body": self.body, "docstring": self._docstring, "body": self.body, }) return attrs class Builtin(Function): def __init__(self, name, code, minargs, maxargs, special): Loading @@ -467,7 +478,8 @@ class Builtin(Function): def synopsis(self): return self._synopsis def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), attrs = super().describe() attrs.update({ "name": self.name, "minargs": Number(self.minargs), "maxargs": Number(self.maxargs), Loading @@ -475,6 +487,7 @@ class Builtin(Function): "special": p2l(self.special), "docstring": self._docstring, }) return attrs envcount = 0 Loading Loading @@ -531,10 +544,13 @@ class Environment(Object): def level(self): return self._level def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), "level": self._level, "parent": self._parent, attrs = super().describe() attrs.update({ "level": self._level, "parent": self._parent, "vars": p2l(self._map), }) return attrs symbolTable = {} Loading Loading @@ -613,9 +629,9 @@ class Number(Object): def numValue(self): return self._value def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), "value": self, }) attrs = super().describe() attrs["value"] = self return attrs escapeSpecials = { "\a": "\\a", "\b": "\\b", "\f": "\\f", "\n": "\\n", Loading Loading @@ -651,9 +667,9 @@ class String(Object): def strValue(self): return self._value def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), "value": self, }) attrs = super().describe() attrs["value"] = self return attrs class Pair(Object): def __init__(self, car, cdr): Loading Loading
object.py +52 −36 Original line number Diff line number Diff line Loading @@ -165,9 +165,9 @@ class Error(Object): def __repr__(self): return str(self) def describe(self): a = super().describe() a.update(self.e.__dict__) return a attrs = super().describe() attrs.update(self.e.__dict__) return attrs _gensym_counter = 8385 Loading Loading @@ -267,9 +267,10 @@ class Symbol(Object): else: raise PyleArgTypeError(self, 'cxr', 'list') def describe(self): a = super(Symbol, self).describe() a["props"] = self._props return a attrs = super().describe() attrs["props"] = self._props return attrs def init_symbol(): global Nil, T, ImmutableSymbol, FunctionSymbol, NamePropSymbol, IdPropSymbol Loading Loading @@ -335,13 +336,18 @@ class Macro(Function): finally: backtoEnvironment(savedEnv) def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), "name": self.name, "params": self.params, attrs = super().describe() attrs.update({ "name": self.name, "params": self.params, "minargs": Number(self.minargs), "maxargs": Number(self.maxargs), "synopsis": self.synopsis(), "docstring": self._docstring, "body": self.body, "docstring": self._docstring, "body": self.body, }) return attrs # this is used for parameter bindings on function calls and variable # bindings in let/let*; destructuring binds will go here, too Loading Loading @@ -434,14 +440,19 @@ class Form(Function): finally: backtoEnvironment(savedEnv) def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), "env": self.env, "name": self.name, "params": self.params, attrs = super().describe() attrs.update({ "env": self.env, "name": self.name, "params": self.params, "minargs": Number(self.minargs), "maxargs": Number(self.maxargs), "synopsis": self.synopsis(), "special": p2l(self.special), "docstring": self._docstring, "body": self.body, "docstring": self._docstring, "body": self.body, }) return attrs class Builtin(Function): def __init__(self, name, code, minargs, maxargs, special): Loading @@ -467,7 +478,8 @@ class Builtin(Function): def synopsis(self): return self._synopsis def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), attrs = super().describe() attrs.update({ "name": self.name, "minargs": Number(self.minargs), "maxargs": Number(self.maxargs), Loading @@ -475,6 +487,7 @@ class Builtin(Function): "special": p2l(self.special), "docstring": self._docstring, }) return attrs envcount = 0 Loading Loading @@ -531,10 +544,13 @@ class Environment(Object): def level(self): return self._level def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), "level": self._level, "parent": self._parent, attrs = super().describe() attrs.update({ "level": self._level, "parent": self._parent, "vars": p2l(self._map), }) return attrs symbolTable = {} Loading Loading @@ -613,9 +629,9 @@ class Number(Object): def numValue(self): return self._value def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), "value": self, }) attrs = super().describe() attrs["value"] = self return attrs escapeSpecials = { "\a": "\\a", "\b": "\\b", "\f": "\\f", "\n": "\\n", Loading Loading @@ -651,9 +667,9 @@ class String(Object): def strValue(self): return self._value def describe(self): return p2l({ "type": self.__class__.__name__, "id": id(self), "value": self, }) attrs = super().describe() attrs["value"] = self return attrs class Pair(Object): def __init__(self, car, cdr): Loading