Re: :pointer-self and LispWorks

Edi Weitz <[email protected]> 12 Aug 2003 17:29:12 +0200
Newsgroups gmane.lisp.uffi.general
Message-ID <[email protected]>
On Tue, 12 Aug 2003 08:59:55 -0600, Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> wrote:

> deref-array, for example, can coerce the type for lispworks as
> mentioned. However, for CMUCL, that requires some casting as you
> your example shows. It's not a great idea to make every call to
> deref-array cast for cmucl as some calls may not require casting.

Oops, just did that. I realize that the CMUCL docs say

  "Note that the result is not eq to the argument, but does refer to
   the same data bits."

which I understand to imply that a new object is generated for each
cast. Hmmm, not good...

(It'd certainly be better in CMUCL to coerce/cast once _before_ you
loop through a big array.)

> It's probably reasonable to add a cast-pointer macro to UFFI. Feel
> free to look more at this. Patches gladly accepted.

The problem seems to be that LW (and, as far as I understand, also
ACL) can coerce "on-the-fly" while dereferencing. So the whole thing
will be a bit asymmetric. (Or maybe it already was if my assumption
about ACL is right.)

I might think about this a bit and come up with a proposal (but
probably not today) although I won't be able to extend this to
OpenMCL, MCL, and SCL. I'm not sure about SBCL either. Depends on the
quality of their docs... :)

Cheers,
Edi.