From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3402 invoked by alias); 9 Oct 2013 05:56:59 -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 3385 invoked by uid 89); 9 Oct 2013 05:56:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 09 Oct 2013 05:56:57 +0000 Received: from [10.9.9.207] (helo=mailfront03.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1VTmlP-0006c1-UM; Wed, 09 Oct 2013 07:56:52 +0200 Received: from 70-36-239-203.dsl.dynamic.sonic.net ([70.36.239.203] helo=localhost.localdomain) by mailfront03.runbox.com with esmtpsa (uid:757155 ) (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) id 1VTmlE-0002Jy-0V; Wed, 09 Oct 2013 07:56:40 +0200 Message-ID: <5254F014.4080203@bothner.com> Date: Wed, 09 Oct 2013 05:56:00 -0000 From: Per Bothner User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: Ito Kazumitsu CC: kawa@sourceware.org Subject: Re: kawa 1.14: java.io.PrintWriter prints everything as "true" References: <20131008.131857.433844808.kaz@maczuka.gcd.org> <5253AEAA.6030605@bothner.com> <20131009.105106.389956539.kaz@maczuka.gcd.org> In-Reply-To: <20131009.105106.389956539.kaz@maczuka.gcd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-q4/txt/msg00010.txt.bz2 On 10/08/2013 06:51 PM, Ito Kazumitsu wrote: > I succeeded in simplifying the script significantly. Indeed, that is a helpful testcase. Thanks. The bug war introduced 2013-06-02 when fixing Savannah bug #39047 "Wrong incompatible type (boolean) with expected int". Specifically the changes in the compare method in LangPrimType.java. "Fixing" that method fixes your bug, but causes other issues I'm looking at. The underlying issue is that Scheme allows any value to used as a boolean. Kawa generalizes this so that any value can be converted to boolean - which then leads to some awkwardness with overload resolution: Which is the "more specific method" of: PrintWriter#println(boolean) PrintWriter#println(Object) They are equally general, in that any value can be converted to boolean, and any value can be converted to Object. I think we have this ok when it comes to compile-time method selection (bug #39047 was partly about fixing this), but it may be harder to get it right for run-time method selection. However, I will keep looking at the problem. To work around the problem you can do: (define-constant wtr (java.io.PrintWriter (java.io.OutputStreamWriter (java.lang.System:.out) "UTF-8"))) or: (define wtr ::java.io.PrintWriter (java.io.PrintWriter (java.io.OutputStreamWriter (java.lang.System:.out) "UTF-8"))) -- --Per Bothner per@bothner.com http://per.bothner.com/