Type inference of Joy expressions.

More remains to be done but it seems to work.
This commit is contained in:
Simon Forman
2018-06-29 13:19:12 -07:00
parent 6ca59847ab
commit 4406a6620b
25 changed files with 1867 additions and 4593 deletions
+8 -8
View File
@@ -156,7 +156,7 @@ def concat(quote, expression):
# RuntimeError: maximum recursion depth exceeded
# on quotes longer than sys.getrecursionlimit().
## return (quote[0], concat(quote[1], expression)) if quote else expression
return (quote[0], concat(quote[1], expression)) if quote else expression
# Original implementation.
@@ -165,13 +165,13 @@ def concat(quote, expression):
# In-lining is slightly faster (and won't break the
# recursion limit on long quotes.)
temp = []
while quote:
item, quote = quote
temp.append(item)
for item in reversed(temp):
expression = item, expression
return expression
## temp = []
## while quote:
## item, quote = quote
## temp.append(item)
## for item in reversed(temp):
## expression = item, expression
## return expression