Skip to content
Snippets Groups Projects
Commit 302cad4c authored by 2269767's avatar 2269767
Browse files

__repr__ voor Variable

parent eb5cd981
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,8 @@ class Variable(LambdaTerm): ...@@ -22,7 +22,8 @@ class Variable(LambdaTerm):
def __init__(self, symbol): def __init__(self, symbol):
self.symbol = symbol self.symbol = symbol
def __repr__(self): raise NotImplementedError def __repr__(self):
return f"Variable('{self.symbol}')"
def __str__(self): def __str__(self):
return str(self.symbol) return str(self.symbol)
...@@ -57,4 +58,4 @@ class Application(LambdaTerm): ...@@ -57,4 +58,4 @@ class Application(LambdaTerm):
def reduce(self): raise NotImplementedError def reduce(self): raise NotImplementedError
print(str(Variable('x'))) print(repr(Variable('x')))
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment