~ chicken-core (chicken-5) 00d3ee7c58af409de131c3132ba9d77c2e3a106e


commit 00d3ee7c58af409de131c3132ba9d77c2e3a106e
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Fri Jun 10 14:43:08 2011 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Fri Jun 10 14:43:08 2011 +0200

    added some notes to scrutinizer source code regarding type-check generation

diff --git a/scrutinizer.scm b/scrutinizer.scm
index eb685c23..8e247cb1 100755
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -700,6 +700,10 @@
 				      escaping-procedures
 				      (not unsafe))
 			     (debugging 'x "checks argument-types" dest) ;XXX
+			     ;; [1] this is subtle: we don't want argtype-checks to be 
+			     ;; generated for toplevel defs other than user-declared ones. 
+			     ;; But since the ##compiler#declared-type mark is set AFTER 
+			     ;; the lambda has been walked (see below, [2]), nothing is added.
 			     (generate-type-checks! n dest vars inits))
 			   (list
 			    (append
@@ -750,6 +754,8 @@
 					  (get db var 'local-value))))
 			(when (eq? val (first subs))
 			  (debugging '|I| (sprintf "(: ~s ~s)" var rt))
+			  ;; [2] sets property, but lambda has already been walked,
+			  ;; so no type-checks are generated (see also [1], above)
 			  (mark-variable var '##compiler#declared-type)
 			  (mark-variable var '##compiler#type rt))))
 		    (when b
Trap