~ chicken-core (chicken-5) 9735828be82aad9edeaa0cd47331133018037388


commit 9735828be82aad9edeaa0cd47331133018037388
Author:     Evan Hanson <evhan@foldling.org>
AuthorDate: Tue Feb 2 23:36:35 2016 +1300
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Tue Mar 8 22:52:34 2016 +1300

    Unset `standalone-executable` when a unit declaration is encountered

diff --git a/batch-driver.scm b/batch-driver.scm
index ead86869..ac8a35bf 100644
--- a/batch-driver.scm
+++ b/batch-driver.scm
@@ -584,7 +584,7 @@
 							  (or profile-name #t)))
 			     '() )
 			 exps0
-			 (if (or unit-name dynamic)
+			 (if (not standalone-executable)
 			     '()
 			     cleanup-forms)
 			 '((##core#undefined)))))
diff --git a/core.scm b/core.scm
index d9e12cb1..d1078a14 100644
--- a/core.scm
+++ b/core.scm
@@ -1458,7 +1458,8 @@
 	(let ((u (stripu (cadr spec))))
 	  (when (and unit-name (not (eq? unit-name u)))
 	    (warning "unit was already given a name (new name is ignored)"))
-	  (set! unit-name u)))
+	  (set! unit-name u)
+	  (set! standalone-executable #f)))
        ((standard-bindings)
 	(if (null? (cdr spec))
 	    (set! standard-bindings default-standard-bindings)
Trap