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: GSOC | Extending Common Lisp support


On 04/27/2012 07:52 AM, Charles Turner wrote:
On 27 April 2012 07:20, Helmut Eller<eller.helmut@gmail.com> wrote:
 From a philosophical point of view, type declarations in Lisp don't
change the semantics, i.e. a program with declarations should produce
the same results as the program without (though it could be more
efficient or give extra warnings).  It's also in line with tradition to
emit a warning at compile time but still generate code that will raise
an runtime error.  IMO Kawa acts quite gracefully here.

My problem with this philosophy, or at least Kawa's interpretation of it, is that it leaves us with inconsistent error messages. For instance,

(let ((x :: integer 10.5))
   (+ x 1))

couple of warning, and then a type error. This is nice.

(let ((x :: gnu.lists.Sequence 10))
   (car x))

couple of warnings, and then a ClassCastException, this isn't so nice IMO.

Maybe WrongType should extend ClassCastException. I.e. WrongType is a more
informative ClassCastException, generated by the Kawa runtime rather than the JVM.
Though that might confuse code that expects ClassCastException to have a specific
message format. (Still, they would confused by WrongType also!)


The error handing for car is different (IIRC) because it goes through
the code for GenericProc.  That could/should be made better - but improving
GenericProc should probably be done in terms of using invokedynamic which
I'm not ready to tackle yet!
--
	--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]