This is the mail archive of the kawa@sources.redhat.com 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: define-procedure with several lambda forms?


Hoehle, Joerg-Cyril wrote:

I'm having trouble with define-procedure when trying to define more than a method.

The manual is a little misleading here. It just says:


  (However, the current implementation of selecting the "best" method
  is not reliable if there is more than one @var{method} )

I replaced it by the following to (the CVS version of) the manual:

  Note:  The current implementation of selecting the "best" method
  is not reliable if there is more than one method.
  It can select depending on argument count, and it can select between
  primitive Java methods.  However, it cannot yet do what you probably
  hope for: select between different Scheme procedures based on
  parameter types.

The problem is currently there is no solid way that Kawa "remembers" the parameter types of a lambda method. If you pass PrimProcedure objects to define-procedure (or make-procedure) it works better, because Kawa can at least look at the method argument types.

The general problem is having the compiler generate code to represent the parameter type list, and check it (efficiently). I haven't had time to do this. It is desirable not only for resolving generic methods, but also for better error messages and improving static type checking.
--
--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]