~ chicken-core (chicken-5) 5d4f12e23b8ac38ea8f33e06bb1e8d790e2b40be


commit 5d4f12e23b8ac38ea8f33e06bb1e8d790e2b40be
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Sun Apr 3 18:47:33 2016 +0200
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Sun Apr 3 18:47:33 2016 +0200

    Remove define-macro style define-syntax in internal definitions
    
    This was undocumented and unsupported, and complicated the code of
    "##sys#canonicalize-body".
    
    Signed-off-by: Evan Hanson <evhan@foldling.org>

diff --git a/NEWS b/NEWS
index 40ac6d48..018145bb 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,10 @@
     namespace.
   - Added support for list-style library names.
 
+- Syntax expander
+  - Removed support for (define-syntax (foo e r c) ...) inside lambdas,
+    which was undocumented and not officially supported anyway.
+
 4.10.2
 
 - Security fixes
diff --git a/expand.scm b/expand.scm
index 43c090e7..18e3599c 100644
--- a/expand.scm
+++ b/expand.scm
@@ -533,20 +533,11 @@
 		     (symbol? (caar body))
 		     (comp 'define-syntax (caar body)))
 		(let ((def (car body)))
-		  (loop 
-		   (cdr body) 
-		   (cons (cond ((pair? (cadr def)) ; DEPRECATED
-				`(define-syntax ; (the first element is actually ignored)
-				   ,(caadr def)
-				   (##sys#er-transformer
-				    (##core#lambda ,(cdadr def) ,@(cddr def)))))
-			       ;; insufficient, if introduced by different expansions, but
-			       ;; better than nothing:
-			       ((eq? (car def) (cadr def))
-				(defjam-error def))
-			       (else def))
-			 defs) 
-		   #f)))
+		  ;; This check is insufficient, if introduced by
+		  ;; different expansions, but better than nothing:
+		  (when (eq? (car def) (cadr def))
+		    (defjam-error def))
+		  (loop (cdr body) (cons def defs) #f)))
 	       (else (loop body defs #t))))))
     (define (expand body)
       ;; Each #t in "mvars" indicates an MV-capable "var".  Non-MV
Trap