Re: Coercing pointers

Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> Thu, 14 Aug 2003 12:08:53 -0600
Newsgroups gmane.lisp.uffi.general
Message-ID <[email protected]>
--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Edi Weitz wrote:
> > Do LW not have an :unsigned-char type?
> They have but it behaves like a number, don't know why:

I suppose their justification is their is no concept of an unsigned
character in lisp.

> If you'd modify ENSURE-CHAR-CHARACTER for this case it had to make a
> runtime decision which probably wouldn't be a good idea.

Hmm, what's so bad about
#+lispworks
(defmacro ensure-char-character (obj)
  `(if (characterp ,obj) ,obj (code-char ,obj)))

Just the run-time overhead? I think that I'm happy enough with this on
Lispworks as I don't know of a better way to regularize their
difference of dereferencing a :char and :unsigned-char.

We can still add the deref-char-pointer to provide an optimized
dereferencing returning a lisp character.

--=20
Kevin Rosenberg
kevin-HJRc7zDS/[email protected]

--2oS5YaxWCcQjTEyO
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/O9A1ES7N8sSjgj4RAr/RAJ4gmQpaoVXMMJO73mOTpk382NifLwCeKL3I
G9Q+IsavxBsumAi/eMy0lGI=
=3ESG
-----END PGP SIGNATURE-----

--2oS5YaxWCcQjTEyO--