From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23223 invoked by alias); 9 Oct 2013 01:51:37 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 22932 invoked by uid 89); 9 Oct 2013 01:51:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: meguro.gcd.org Received: from meguro.gcd.org (HELO meguro.gcd.org) (163.43.176.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Wed, 09 Oct 2013 01:51:34 +0000 Received: (qmail 27497 invoked by uid 10); 9 Oct 2013 10:51:30 +0900 Received: (qmail 3067 invoked by uid 0); 9 Oct 2013 01:51:06 -0000 Received: from unknown (HELO maczuka.gcd.org) (192.168.2.1) by 192.168.2.2 with SMTP; 9 Oct 2013 01:51:06 -0000 Received: (qmail 20718 invoked from network); 9 Oct 2013 01:51:06 -0000 Received: from unknown (HELO localhost) (192.168.2.1) by maczuka.gcd.org with SMTP; 9 Oct 2013 01:51:06 -0000 Date: Wed, 09 Oct 2013 01:51:00 -0000 Message-Id: <20131009.105106.389956539.kaz@maczuka.gcd.org> To: kawa@sourceware.org Subject: Re: kawa 1.14: java.io.PrintWriter prints everything as "true" From: Ito Kazumitsu In-Reply-To: <5253AEAA.6030605@bothner.com> References: <20131008.131857.433844808.kaz@maczuka.gcd.org> <5253AEAA.6030605@bothner.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-q4/txt/msg00009.txt.bz2 From: Per Bothner Subject: Re: kawa 1.14: java.io.PrintWriter prints everything as "true" Date: Tue, 08 Oct 2013 00:05:14 -0700 > * Try using the latest Subversion of Kawa - it's possible the fix > I checked in for your previous bug report may be relevant. I tried the latest Subversion of Kawa, but it did not help. > * Simplify your script as much as you can. For example: I succeeded in simplifying the script significantly. > * Try removing the --no-warn-unknown-member flags - that warning > tells you useful information. > > * If you're adventurous, try adding the --debug-print-final-expr > flag. That tells you how Kawa has analyzed your code - i.e. > what it looks like just before bytecode generation. Here it is. $ cat test.scm (define wtr (java.io.PrintWriter (java.io.OutputStreamWriter (java.lang.System:.out) "UTF-8"))) (define (print-it) (wtr:println "PRINT ME")) (print-it) (wtr:flush) $ java -cp kawa-1.14.1-svn.jar kawa.repl --debug-print-final-expr --script test.scm [Compiling final atInteractiveLevel$1 to atInteractiveLevel$1: (Module/atInteractiveLevel$1/1/ (Declarations: wtr/15/fl:40809) (Define line:1:1 /Declaration[wtr/15] (Apply => ClassType java.io.PrintWriter line:2:4 (Quote java.io.PrintWriter java.io.PrintWriter.(java.io.Writer) ::gnu.expr.PrimProcedure) (Quote class java.io.PrintWriter ::class) (Apply => ClassType java.io.OutputStreamWriter line:3:8 (Quote java.io.OutputStreamWriter java.io.OutputStreamWriter.(java.io.OutputStream,java.lang.String) ::gnu.expr.PrimProcedure) (Quote class java.io.OutputStreamWriter ::class) (Apply => ClassType java.io.PrintStream line:3:36 (Quote # ::gnu.kawa.reflect.SlotGet) (Quote ClassType java.lang.System ::class-type) (Quote Field:java.lang.System.out ::gnu.bytecode.Field)) (Quote "UTF-8" ::java.lang.String)))))] test.scm:5:6: warning - no known slot 'println' in java.lang.Object [Compiling final atInteractiveLevel$2 to atInteractiveLevel$2: (Module/atInteractiveLevel$2/6/ (Declarations: print-it/26/fl:408c8::gnu.mapping.Procedure) (Define line:4:1 /Declaration[print-it/26] (Lambda/print-it/8/fl:3 line:4:9 () (Apply [tailcall] line:5:5 (Ref/15/Declaration[applyToArgs/2]) (Apply line:5:6 (Quote # ::gnu.kawa.functions.GetNamedPart) (Ref/13/Declaration[wtr/15]) (Quote println ::gnu.mapping.SimpleSymbol)) (Quote "PRINT ME" ::java.lang.String)))))] [Compiling final atInteractiveLevel$3 to atInteractiveLevel$3: (Module/atInteractiveLevel$3/10/ () (Apply [tailcall] line:6:1 (Ref/17/Declaration[print-it/26])))] test.scm:7:2: warning - no known slot 'flush' in java.lang.Object [Compiling final atInteractiveLevel$4 to atInteractiveLevel$4: (Module/atInteractiveLevel$4/11/ () (Apply [tailcall] line:7:1 (Ref/24/Declaration[applyToArgs/2]) (Apply line:7:2 (Quote # ::gnu.kawa.functions.GetNamedPart) (Ref/22/Declaration[wtr/15]) (Quote flush ::gnu.mapping.SimpleSymbol))))] true