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

Variable __init__ en __str__ werken

parent e202125b
No related branches found
No related tags found
No related merge requests found
...@@ -19,11 +19,13 @@ class LambdaTerm: ...@@ -19,11 +19,13 @@ class LambdaTerm:
class Variable(LambdaTerm): class Variable(LambdaTerm):
"""Represents a variable.""" """Represents a variable."""
def __init__(self, symbol): raise NotImplementedError def __init__(self, symbol):
self.symbol = symbol
def __repr__(self): raise NotImplementedError def __repr__(self): raise NotImplementedError
def __str__(self): raise NotImplementedError def __str__(self):
return str(self.symbol)
def substitute(self, rules): raise NotImplementedError def substitute(self, rules): raise NotImplementedError
...@@ -54,3 +56,5 @@ class Application(LambdaTerm): ...@@ -54,3 +56,5 @@ class Application(LambdaTerm):
def substitute(self, rules): raise NotImplementedError def substitute(self, rules): raise NotImplementedError
def reduce(self): raise NotImplementedError def reduce(self): raise NotImplementedError
print(str(Variable('x')))
\ 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