[usocket-devel] bugs in trunk: condition.lisp, usocket.lisp

Chun Tian (binghe) binghe.lisp at gmail.com
Sun Jul 27 17:48:29 UTC 2008


Hi, Erik

When I try to compile recent usocket trunk code, two issues found:

In condition.lisp, the (define-condition insufficient-implementation)  
cannot compiled on LispWorks:

**++++ Error in (SUBFUNCTION
                  (DEFCLASS USOCKET:INSUFFICIENT-IMPLEMENTATION)
                  (DEFINE-CONDITION USOCKET:INSUFFICIENT- 
IMPLEMENTATION)):
   FUNCTION is defined as an ordinary function #<Function  
SYSTEM::UNDEFINED-FEXPR-FUNCTION 20259C4A>

I checked CLHS ( http://www.lispworks.com/documentation/HyperSpec/Body/s_fn.htm 
  ), it says FUNCTION is a "Special Operator" which serves as a  
function:
(defun adder (x) (function (lambda (y) (+ x y))))
(setq add3 (adder 3)) (funcall add3 5) => 8
So you define it into a slot reader will cause symbol conflict with  
Common Lisp itself. LispWorks is quite strict, other CLs just pass it.
I suggest you use FUNCTION-OF instead of FUNCTION, like this:
(define-condition insufficient-implementation (error)
   ((feature :initarg :feature :reader feature)
    (function :initarg :function :reader function-of))
   (:documentation "The ancestor of all errors usocket may generate
because of insufficient support from the underlying implementation
with respect to the arguments given to `function'.

One call may signal several errors, if the caller allows processing
to continue.
"))
With this change, I can compile and load on LispWorks now. But I don't  
know where else you use this reader function. Please review this, and  
make some change for LispWorks.
Thanks,
--binghe




More information about the usocket-devel mailing list