Hi.
I've tried to compile & use xmls 1.2 in unicode-enabled SBCL (1.0.6),
but RESOLVE-ENTITY function choked on """ entity with following
error:
debugger invoked on a TYPE-ERROR in thread #<THREAD "initial
thread" {BAD5A49}>:
The value "quot;" is not of type (SIMPLE-ARRAY BASE-CHAR (*)).
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(XMLS::RESOLVE-ENTITY "quot;")
I investigated this problem a bit, and found that for unicode-enabled
SBCL (with default external format UTF-8), string passed to RESOLVE-
ENTITY has type (SIMPLE-ARRAY CHARACTER (5)); not exactly declared
SIMPLE-BASE-STRING. As I've read in CLHS, SIMPLE-BASE-STRING is the
same as (SIMPLE-ARRAY BASE-CHAR (*)) so there's type mismatch.
I've conditionalized RESOLVE-ENTITY parameter type declaration using:
#-(and sbcl sb-unicode) (declare (type simple-base-string ent))
and that made the problem go away (at least for my class of inputs).
However I don't feel like that's "proper" solution. Can someone
suggest what should be done in this situation? Maybe some checking of
(unexported) sb-impl::*default-external-format*? I'd really like to
hear some opinions on what to do with this and maybe find better
solution (if there is one) and contribute back to XMLS project.
BTW. Drew Crampsie e-mail on XMLS project page is dead, so I don't
know how to contact XMLS current maintainer.
Thanks
Tomasz
scooter <··············@gmail.com> wrote:
> I investigated this problem a bit, and found that for unicode-enabled
> SBCL (with default external format UTF-8), string passed to RESOLVE-
> ENTITY has type (SIMPLE-ARRAY CHARACTER (5)); not exactly declared
> SIMPLE-BASE-STRING. As I've read in CLHS, SIMPLE-BASE-STRING is the
> same as (SIMPLE-ARRAY BASE-CHAR (*)) so there's type mismatch.
In SBCL with unicode support, all string literals are of the type
(SIMPLE-ARRAY CHARACTER (*)), not SIMPLE-BASE-STRING. The right
declaration to use in this situation would be SIMPLE-STRING, which is
the union of all one-dimensional simple arrays whose element type is a
subtype of character.
External formats are not relevant to this issue.
--
Juho Snellman
On Thu, 21 Jun 2007 19:21:58 +0000, scooter wrote:
> BTW. Drew Crampsie e-mail on XMLS project page is dead, so I don't
> know how to contact XMLS current maintainer.
I'm no longer the maintainer of XMLS, i've long since passed the
torch. If you email me (·····@tech.coop) i'll pass along the email address
of the new maintainer.
drewc
--
Posted via a free Usenet account from http://www.teranews.com