Hi all,

Attached are two small patches I created whilst working on #1441.
The don't fix any real bugs, but they clean up the code.  One is
basically a cleanup of dead code that's never being executed, the
other cleans up a potential pitfall.

This _could_ also go into chicken-4 (and might be needed if we end
up deciding to "fix" #1441), but for now let's apply to master only.

Cheers,
Peter
From 821e2cf368d80847a6d1f85373840b85ffe3b80a Mon Sep 17 00:00:00 2001
From: Peter Bex <[email protected]>
Date: Sat, 24 Feb 2018 11:16:55 +0100
Subject: [PATCH 1/2] Do not strip syntax when handling let-syntax

This is not necessary and may (may!) break things.  It's asking for
trouble, though I haven't managed to build a test case where this
makes a difference yet.
---
 core.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/core.scm b/core.scm
index f5dfd650..f9014c4b 100644
--- a/core.scm
+++ b/core.scm
@@ -819,7 +819,7 @@
 					     se
 					     (##sys#ensure-transformer
 					      (##sys#eval/meta (cadr b))
-					      (strip-syntax (car b)))))
+					      (car b))))
 					  (cadr x) )
 				     se) )
 			       (ln (or (get-line x) outer-ln)))
@@ -835,7 +835,7 @@
 					   #f
 					   (##sys#ensure-transformer
 					    (##sys#eval/meta (cadr b))
-					    (strip-syntax (car b)))))
+					    (car b))))
 					(cadr x) ) )
 			       (se2 (append ms se))
 			       (ln (or (get-line x) outer-ln)) )
@@ -889,7 +889,7 @@
 				(##sys#cons
 				 (##sys#ensure-transformer
 				  (##sys#eval/meta body)
-				  (strip-syntax var))
+				  var)
 				 (##sys#current-environment))))
 			  (walk
 			   (if ##sys#enable-runtime-macros
@@ -916,7 +916,7 @@
 					(and (pair? (cdr b))
 					     (cons (##sys#ensure-transformer
 						    (##sys#eval/meta (cadr b))
-						    (strip-syntax (car b)))
+						    (car b))
 						   se))
 					(##sys#get name '##compiler#compiler-syntax) ) ) )
 				   (cadr x)))
-- 
2.11.0

From 27045dd20c639812bf48277c425638c5912ced28 Mon Sep 17 00:00:00 2001
From: Peter Bex <[email protected]>
Date: Sat, 24 Feb 2018 11:21:39 +0100
Subject: [PATCH 2/2] Drop renaming code that was never possibly being used

This was changed a while ago, and it turns out that the "fix" was
actually disabling some code because assq will return a pair, not a
symbol, so the symbol? check would always fail.

The code in the else branch that would always trigger is duplicated in
the main cond's else branch, so we can drop the entire assq cond
clause.
---
 expand.scm | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/expand.scm b/expand.scm
index 2dfa6ae2..5a68247d 100644
--- a/expand.scm
+++ b/expand.scm
@@ -850,17 +850,6 @@
 		(lambda (a) 
 		  (dd `(RENAME/RENV: ,sym --> ,(cdr a)))
 		  (cdr a)))
-	       ((assq sym se) =>
-		(lambda (a)
-		  (cond ((symbol? a)
-			 (dd `(RENAME/SE: ,sym --> ,a))
-			 (set! renv (cons (cons sym a) renv))
-			 a)
-			(else
-			 (let ((a2 (macro-alias sym se)))
-			   (dd `(RENAME/SE/MACRO: ,sym --> ,a2))
-			   (set! renv (cons (cons sym a2) renv))
-			   a2)))))
 	       (else
 		(let ((a (macro-alias sym se)))
 		  (dd `(RENAME: ,sym --> ,a))
-- 
2.11.0

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to