From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9852 invoked by alias); 26 Oct 2015 03:43:12 -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 9834 invoked by uid 89); 26 Oct 2015 03:43:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-io0-f171.google.com Received: from mail-io0-f171.google.com (HELO mail-io0-f171.google.com) (209.85.223.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 26 Oct 2015 03:43:10 +0000 Received: by iofz202 with SMTP id z202so173341907iof.2 for ; Sun, 25 Oct 2015 20:43:08 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.107.129.218 with SMTP id l87mr33097228ioi.181.1445830988103; Sun, 25 Oct 2015 20:43:08 -0700 (PDT) Received: by 10.36.202.132 with HTTP; Sun, 25 Oct 2015 20:43:08 -0700 (PDT) In-Reply-To: <562D2117.4050405@bothner.com> References: <562D2117.4050405@bothner.com> Date: Mon, 26 Oct 2015 03:43:00 -0000 Message-ID: Subject: Re: learning scheme with kawa From: Debabrata Pani To: Per Bothner Cc: kawa@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-q4/txt/msg00019.txt.bz2 Thank you for the information, Per. On changing the method name shorter? -> is_shorter? it works fine. Of course your suggestion to modify the behavior makes sense as well. Regards, Debabrata Pani On Mon, Oct 26, 2015 at 12:06 AM, Per Bothner wrote: > > > 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 =E2=80=9Creciprocal.ss=E2=80=9D) > > 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/