From: Kyle R. B. <kyl...@gm...> - 2005-07-18 04:26:35
|
This patch introduces a new variable dclass-verbose which is initially set to #t to preserve existing behavior. When set to #f the printing of diagnostic information to the default output port is disabled. I'm not sure what the procedure is for submitting patches. It is both in-line in the email as well as attached. This is my first patch for JScheme, I'm basically a novice in both scheme and JScheme so any and all criticism is welcome and appreciated. Best regards, Kyle R. Burton --=20 ---------------------------------------------------------------------------= --- Wisdom and Compassion are inseparable. -- Christmas Humphreys kyl...@gm... =20 http://www.neverlight.com/~mortis ---------------------------------------------------------------------------= --- -- diff -uNr jscheme-7.1/src/dclass/dclass.html jscheme-krb/src/dclass/dclass.= html --- jscheme-7.1/src/dclass/dclass.html 2002-04-06 14:01:01.000000000 -0500 +++ jscheme-krb/src/dclass/dclass.html 2005-07-18 00:22:16.000000000 -0= 400 @@ -179,6 +179,19 @@ (public int hashCode () 0))</pre> =20 <hr> +<h2>Controlling the Output of Diagnostic Information</h2> +<p>By default <tt>(define-class)</tt> emits diagnostic informaiton +about the classes it is generating (including a full dump of the Java +source for the class). To disable this output, set the global +dclass-verbose to false (<tt>#f</tt>). + +<pre> + (load "src/dclass.scm") + (set! dclass-verbose #f) +</pre> + + +<hr> <h2>Issues</h2> =20 <p> Fields must be declared public for Scheme to access them in an diff -uNr jscheme-7.1/src/dclass/dclass.scm jscheme-krb/src/dclass/dclass.s= cm --- jscheme-7.1/src/dclass/dclass.scm 2004-02-04 16:36:37.000000000 -05= 00 +++ jscheme-krb/src/dclass/dclass.scm 2005-07-18 00:09:51.000000000 -04= 00 @@ -18,6 +18,12 @@ ;;; Root directory of where compiled *.class files should go. (define dclass-class-base dclass-src-base) =20 +(define dclass-verbose #t) +(define (dclass-display . things) + "Use display to print messages to the console if dclass-verbose is true.= " + (if dclass-verbose + (apply display things))) + ;;; Classpath to use by javac (define dclass-classpath (apply string-append @@ -92,7 +98,7 @@ (java.io.File. src-base (.toString java-file))) (define (open-src-file name) (let ((f (make-src-file dclass-src-base (class->file (.toString name))= ))) - (display (string-append "Writing Java code for " name " to " f "\n"= )) + (dclass-display {Writing Java code for [name] to [f]\n}) (.mkdirs (File. (.getParent f))) (java.io.PrintWriter. (java.io.BufferedWriter. (java.io.FileWriter. f))))) @@ -106,8 +112,8 @@ (port (open-src-file name))) (emit result port) (.close port) - (emit result (current-output-port)) - (display (string-append "Compiling Java code for " name "\n")) + (if dclass-verbose (emit result (current-output-port))) + (dclass-display {Compiling Java code for [name]\n}) (out (run (cmd javac -classpath ,dclass-classpath -d ,dclass-class-base -sourcepath ,dclass-src-base |