This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: learning scheme with kawa




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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]