From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44105 invoked by alias); 25 Oct 2015 18:36:55 -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 44095 invoked by uid 89); 25 Oct 2015 18:36:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 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; Sun, 25 Oct 2015 18:36:53 +0000 Received: from [10.9.9.207] (helo=mailfront03.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1ZqQ9x-0001DM-V8; Sun, 25 Oct 2015 19:36:50 +0100 Received: from 70-36-239-58.dsl.dynamic.fusionbroadband.com ([70.36.239.58] helo=toshie.bothner.com) by mailfront03.runbox.com with esmtpsa (uid:757155 ) (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) id 1ZqQ9M-0004ZD-87; Sun, 25 Oct 2015 19:36:12 +0100 Subject: Re: learning scheme with kawa To: Debabrata Pani , kawa@sourceware.org References: From: Per Bothner Message-ID: <562D2117.4050405@bothner.com> Date: Sun, 25 Oct 2015 18:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2015-q4/txt/msg00018.txt.bz2 On 10/25/2015 10:59 AM, Debabrata Pani wrote: > Is this a known discrepancy in the behavior of kawa? > > Are we violating any RNRS rule when we do this ? It's a Kawa feature that is misbehaving. As a work-around, try using require instead of load: (require “reciprocal.ss”) This causes the whole file to be processed as a unit, so the definition of shorter? is visible when compiling shorter. The gory details: The "feature" is that Kawa has special handling when it sees TYPE? . If there is no known definitions of TYPE?, but there is a known definition of TYPE then it will convert the TYPE? to '(lambda (obj) (instance? obj TYPE))' In this case, the Kawa compiler sees shorter?, there is (yet) no definition of shorter?, but there is one of shorter, so it does the above transformation. I think this is a Kawa bug. It should only convert TYPE? to (lambda (obj) (instance? obj TYPE)) when TYPE is actually bound to a class or a type. I'll have to think about the best way to do this. -- --Per Bothner per@bothner.com http://per.bothner.com/