This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: learning scheme with kawa
- From: Per Bothner <per at bothner dot com>
- To: Debabrata Pani <debabrata dot pani at gmail dot com>, kawa at sourceware dot org
- Date: Sun, 25 Oct 2015 11:36:07 -0700
- Subject: Re: learning scheme with kawa
- Authentication-results: sourceware.org; auth=none
- References: <CAKJw4fdTWByFgD9LW9L2cXSneX9fh7tWHes=jGtYZYL=fVPw2w at mail dot gmail dot com>
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/