Full functionality.
This commit is contained in:
@@ -132,6 +132,13 @@ class Lisp:
|
||||
else:
|
||||
raise ValueError("Undefined variable: " + str(arguments[0]))
|
||||
return arguments[0]
|
||||
case "MAPCAR":
|
||||
if len(arguments) != 3:
|
||||
raise ValueError("Expected 3 arguments")
|
||||
result = []
|
||||
for i in range(0, min(len(arguments[1]), len(arguments[2]))):
|
||||
result.append(self.evaluate([arguments[0], arguments[1][i], arguments[2][i]]))
|
||||
return result
|
||||
case _:
|
||||
if operation in self.env.keys():
|
||||
if type(self.env[operation]) == Function:
|
||||
|
||||
Reference in New Issue
Block a user