From f00929971d2bb851a33dfa2abd0446e5a1125da1 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 15 Jul 2016 22:43:56 -0400 Subject: [PATCH] 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. --- scheme/cyclone/transforms.sld | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scheme/cyclone/transforms.sld b/scheme/cyclone/transforms.sld index fda4a1b2..84d83e18 100644 --- a/scheme/cyclone/transforms.sld +++ b/scheme/cyclone/transforms.sld @@ -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))