From 330780c44d207786fdfbfada4c6e1582745c4a2a Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 8 Dec 2016 13:57:19 +0000 Subject: [PATCH] Issue #13 - Allow compilation of code with local `if` --- scheme/cyclone/macros.sld | 2 +- scheme/cyclone/transforms.sld | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scheme/cyclone/macros.sld b/scheme/cyclone/macros.sld index 3f31a09b..182812f3 100644 --- a/scheme/cyclone/macros.sld +++ b/scheme/cyclone/macros.sld @@ -125,7 +125,7 @@ (if (and val (not (member expr bv))) (clean val bv) expr))) - ((if? expr) + ((if-syntax? expr) `(if ,(clean (if->condition expr) bv) ,(clean (if->then expr) bv) ,(if (if-else? expr) diff --git a/scheme/cyclone/transforms.sld b/scheme/cyclone/transforms.sld index 84e9bad7..a9670457 100644 --- a/scheme/cyclone/transforms.sld +++ b/scheme/cyclone/transforms.sld @@ -529,7 +529,7 @@ ,@(expand (define->exp exp) env rename-env)))) ((set!? exp) `(set! ,(expand (set!->var exp) env rename-env) ,(expand (set!->exp exp) env rename-env))) - ((if? exp) `(if ,(expand (if->condition exp) env rename-env) + ((if-syntax? exp) `(if ,(expand (if->condition exp) env rename-env) ,(expand (if->then exp) env rename-env) ,(if (if-else? exp) (expand (if->else exp) env rename-env) @@ -850,7 +850,7 @@ ((lambda? exp) (difference (reduce union (map search (lambda->exp exp)) '()) (lambda-formals->list exp))) - ((if? exp) (union (search (if->condition exp)) + ((if-syntax? exp) (union (search (if->condition exp)) (union (search (if->then exp)) (search (if->else exp))))) ((define? exp) (union (list (define->var exp))