Python 3 fixes

This commit is contained in:
cclauss
2018-10-17 01:48:46 +02:00
parent 1697ee1c43
commit 6a8e87e17b
13 changed files with 140 additions and 116 deletions

View File

@@ -6,6 +6,11 @@ from __future__ import division
import math
import operator as op
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
################ Types
Symbol = str # A Lisp Symbol is implemented as a Python str
@@ -96,7 +101,7 @@ def repl(prompt='lis.py> '):
"A prompt-read-eval-print loop."
while True:
val = eval(parse(raw_input(prompt)))
if val is not None:
if val is not None:
print(lispstr(val))
def lispstr(exp):