From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7011 invoked by alias); 18 Dec 2014 18:19:18 -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 7000 invoked by uid 89); 18 Dec 2014 18:19:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail.theptrgroup.com Received: from mail.theptrgroup.com (HELO mail.theptrgroup.com) (71.178.251.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Dec 2014 18:19:16 +0000 Received: from [10.11.21.14] (unknown [10.11.21.14]) by mail.theptrgroup.com (Postfix) with ESMTPS id 19E463A0FE for ; Thu, 18 Dec 2014 13:19:14 -0500 (EST) From: Jamison Hope Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: strange int->boolean behavior Message-Id: <72768B2F-733F-4F37-BB02-880E16C2E855@theptrgroup.com> Date: Thu, 18 Dec 2014 18:19:00 -0000 To: "kawa@sourceware.org list" Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) X-IsSubscribed: yes X-SW-Source: 2014-q4/txt/msg00144.txt.bz2 Sometimes, a primitive 0 is false: #|kawa:1|# (->boolean (->int 3)) Exception in thread "main" java.lang.Error: unsupported CodeAttr.emitConvert at gnu.bytecode.CodeAttr.emitConvert(CodeAttr.java:2006) [...] #|kawa:1|# (if (->int 3) "YES" "NO") YES #|kawa:2|# (if (->int 0) "YES" "NO") YES #|kawa:3|# (define (f x::int) ::string (if x "YES" "NO")) #|kawa:4|# (f 3) YES #|kawa:5|# (f 0) NO #|kawa:6|# (disassemble f) In class atInteractiveLevel$3 Method name:"f" public static Signature: (int)java.lang.CharSequence Attribute "Code", length:70, max_stack:1, max_locals:1, code_length:14 0: iload_0 1: ifeq 10 4: getstatic 7: goto 13 10: getstatic 13: areturn I get similar results with the other primitive types. If I'm following thi= ngs correctly, it's ConditionalTarget#compileFromStack which is treating ze= ro as false? -- Jamison Hope The PTR Group www.theptrgroup.com