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


Right, after the Internet failure, I'm back online!

The implementation of DEFPACKAGE has implied implementing lots of
other bits of missing functionality. Here are some of the headaches I
had while I was offline.

Am I missing something about the implementation of PUSH? My first attempt was

(defmacro (push x lst)
  `(setq ,lst (cons ,x ,lst)))

I realised that isn't going to work for all cases. It seems like I
need to know the "setf expansion" lst before going any further, but of
course we don't have SETF, and even if we did, I'm not sure if I've
completely misunderstood something. The hyperspec is quite pedantic
about the order of evaluation of this form, so I'm weary to just go
ahead and use Java.

SETQ doesn't seem to be working from with LET:

(let ((res nil))
  (setq res 5)
  res) ;=> nil

However, SET! does work, which I know I probably shouldn't be using,
but I wanted to try getting further on DEFPACKAGE after spending a
while on this bug.

Then another one bit me

PRIMITIVE-THROW isn't working in CL:

(primitive-throw (<java.io.IOException>:new
 ((format #f "cannot delete ~a" file):toString)))
/dev/stdin:2:18: warning - no field or setter 'new' in class java.io.IOException
java.io.IOException
	at atInteractiveLevel$2.run(stdin:2)
	...

I wanted a better exception framework than ERROR, but I couldn't get
the above to work. Works fine in Scheme of course. Spent a while on
this one, couldn't fix it, littered my code with terrible error
messages using ERROR alone.

Got bitten again,

Kawa doesn't handle supplied-p parameters, so writing code like this
seems impossible:

(defun f (x y &key (test #'eql testp) (test-not nil notp))
  (when (and testp notp)
    (error "cant supply both")))

Kawa currently expects a type parameter in this place (the processing
is done l 235 in Lambda.java). I assume setting the value of the TESTP
and NOTP declarations to NIL if the compiler has to automatically set
the values to NIL would be the method.

I also noticed a weird bit of behaviour (noticed whilst puzzling over
why my PUSH wasn't working):

#|kawa:4|# '(1 . ())
(1)
#|kawa:5|# '(1 . nil)
(1 . nil)
#|kawa:6|# (eq '() nil)
t

So, I'm currently trying my best to implement DEFPACKAGE with the
stuff I have, as I've been unable to fix the above problems.

Charlie.


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