Andreas Fuchs <asf@...> writes:
> sb-bsd-sockets now uses the sb-grovel API for its
> groveling. Additionally, I synched sb-grovel's and sb-bsd-sockets's
> groveling files (they were slightly different) and integrated the patch
> Krystof sent to this list a few weeks ago, removing the gcc
> warnings. The attached patch contains the current bit-field groveling
> stuff, too.
> Hope you like it.
I like most of it. I certainly like its intent :-) Some comments,
linearly in order in the patch:
> #+sbcl (:shadowing-import-from "SB-KERNEL" with-array-data)
I know this isn't in your patch, but I'm going to draw attention to it
anyway: what is this meant to be doing?
> ! (let ((ent (sb-grovel::foreign-vector (sockint::getprotobyname name) 1
It looks like FOREIGN-VECTOR wants to be exported from SB-GROVEL...
> ! (sb-sys:sap+ (sockint::array-data-address sockaddr)
> ! (if (sb-grovel::foreign-nullp h) (name-service-error "gethostbyname"))
... and likewise ARRAY-DATA-ADDRESS and FOREIGN-NULLP.
> ! (require :sb-grovel)
I think, in full generality, this wants to be
(eval-when (:compile-toplevel :load-toplevel :execute)
so that should people start compiling their .asd files, it will
continue to work.
> ! (format stream "printf(\"(defconstant size-of-int %d)\\\n\",sizeof (int));~%")
> ! (format stream "printf(\"(defconstant size-of-char %d)\\\n\",sizeof (char));~%")
> ! (format stream "printf(\"(defconstant size-of-long %d)\\\n\",sizeof (long));~%")
I believe that these want cl: prefixes; at least, when I tried your
patch compilation of SB-POSIX failed with
unhandled condition (of type COMMON-LISP:UNBOUND-VARIABLE):
The variable SIZE-OF-INT is unbound.
> ! (t (error 'operation-error :operation operation :component component)))))
And that was my mistake^Wtrap to see if anyone was reading my original
patch properly... should probably read
(error 'operation-error :operation op :component component).
Other than these, it looks good. Dan, do you want to comment on the
package exporting issues? Specifically, what should packages using
sb-grovel be using?
http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge)