Re: LIST-TABLES problem on LispWorks

"Bill Atkins" <[email protected]> Mon, 14 Aug 2006 00:58:09 -0400
Newsgroups gmane.lisp.clsql.devel
Message-ID <[email protected]>
On 8/14/06, Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> wrote:
> Bill Atkins wrote:
> > Yes, my mistake.
>
> Thanks for confirming, your help with porting to LW5 is much appreciated.
>
> > It does.  I was looking for :lispworks5 originally and must have missed it.
>
> Very good, I'll incorporate the change in UFFI with the :lispworks5
> item in *features*. But, I'll hold off releasing a new version of
> UFFI/CLSQL until you have some time to look at the string conversion.

I think I've pinned it down.  The problem was in FAST-NATIVE-TO-STRING
in uffi/src/strings.lisp .  I added a reader conditional for
:lispworks5 and now I can use LIST-TABLES, SELECT, etc. without any
apparent issues.  I changed the reader conditionals on the defun so
that they look like this:

#+(or (and lispworks (not lispworks5)) (and allegro (not ics)))
(defun fast-native-to-string (s len)
  (declare (optimize (speed 3) (space 0) (safety 0) (compilation-speed 0))
	   (type char-ptr-def s))
  (let* ((len (or len (strlen s)))
         (str (make-string len)))
    (declare (fixnum len)
	     (type (simple-array #+lispworks base-char
                                 #-lispworks (signed-byte 8) (*)) str))
    (dotimes (i len str)
      (setf (aref str i)
	(uffi:deref-array s '(:array :char) i)))))

#+(or (and allegro ics) lispworks5)
(defun fast-native-to-string (s len)
  (declare (optimize (speed 3) (space 0) (safety 0) (compilation-speed 0))
	   (type char-ptr-def s))
  (let* ((len (or len (strlen s)))
         (str (make-string len)))
      (dotimes (i len str)
        (setf (schar str i) (code-char (uffi:deref-array s '(:array
:unsigned-byte) i))))))

The only changes are in the reader conditionals before each defun.

> Thanks again for the help.

Thanks for CLSQL!

> --
> Kevin Rosenberg
> [email protected]
>
>


-- 
Bill Atkins