Allow local to have same identifier as a prim

Allow a local variable to use the same identifier as a primitive, by renaming the local and shadowing the primitive within that scope.
This commit is contained in:
Justin Ethier 2016-07-15 22:43:56 -04:00
parent c23d3c4a7a
commit f00929971d

View file

@ -1194,7 +1194,9 @@
,(if->then new-ast)))
(else
new-ast))))
((prim-call? ast)
((and (prim-call? ast)
;; Not a primitive if the identifier has been redefined
(not assoc (car ast) renamed))
(let ((converted
(cons (car ast)
(map (lambda (a) (convert a renamed))