[cl-serializer-devel] Two issues, one resolved, for CL-SERIALIZER in Allegro 8.1

Attila Lendvai attila.lendvai at gmail.com
Thu Aug 13 00:10:19 UTC 2009


> #1. (SETF LOGBITP) is not defined in ACL 8.1 (nor in CLISP), and as
> far as I can tell isn't part of the standard nor can be portably
> defined.
>
> I'm changing (SETF (LOGBITP x y) z)
> to (SETF y (DPB z (BYTE 1 x) y)      (2 places).
> Maybe (SETF LDB) is better?


Levy is in the middle of a big refactor/cleanup of all our projects,
so i don't want to commit this before syncing up:

(defmacro bit-value (index integer)
  `(logbitp index integer))

(define-setf-expander bit-value (index integer &environment env)
  (multiple-value-bind (temps vals stores store-form access-form)
      (get-setf-expansion integer env)
    (with-unique-names (ind store)
      (bind ((stemp (first stores)))
        (values `(,ind , at temps)
                `(,index , at vals)
                (list store)
                `(let ((,stemp (dpb (if ,store 1 0) (byte 1 ,ind)
,access-form)))
                   ,store-form
                   ,store)
                `(logbitp ,ind ,access-form))))))



> #2. It seems that cl-serializer assumes that objects of type
> BASE-CHAR must be 8-bit characters, and thus can be encoded in a
> single byte. But this isn't the case in Allegro, where (TYPEP
> (CODE-CHAR 257) 'BASE-CHAR) is true. I didn't find a good way to
> get into the type detection logic to cause multi-byte characters to
> do the right thing. Suggestions?


my first take on this is that on platforms where there's no difference
between character and base-char, there's no point in fooling around
with simple-base-string's, which are optimizations anyway. so, some #+
magic could get rid of this optimization where it is pointless
anyway...

-- 
 attila




More information about the cl-serializer-devel mailing list