[cxml-devel] ... and another

David Lichteblau david at lichteblau.com
Fri Apr 22 09:08:36 UTC 2011


Quoting Marco Antoniotti (marcoxa at cs.nyu.edu):
> 
> On Apr 21, 2011, at 16:54 , David Lichteblau wrote:
> 
> > Quoting Marco Antoniotti (marcoxa at cs.nyu.edu):
> >> Always on LWM.  I assume this has to do with UNICODE or not support, but the example in the docs is misleading.
> >> 
> >> 
> >> CL-USER 37 > (defparameter *source* (cxml:make-source "<example>text</example>"))
> > 
> > That example should work in any implementation with Unicode support.
> > 
> > Backtrace?
> > Value of *features*?
> > 
> 
> 
> Here they are.  I suspect that LWM does not support UNICODE.

It supports Unicode, but LispWorks has slighly weird subtypes of
CHARACTER, and sometimes code insists on one subtype over the other.

In this case, I'm afraid the argument to MAKE-SOURCE needs to be a
string made up of LW:SIMPLE-CHAR rather than CHARACTER.

Things to try:

;; returns T on other Lisps, but might go wrong on LispWorks:
(typep "<example>text</example>" '(vector runes:rune))

;; possible workaroud
(cxml:make-source (coerce "<example>text</example>"
                          '(simple-array runes:rune)))

Sorry about that, but I gave up on trying to fix all of these little
issues related to lw:simple-char a long time ago.  We have to assume
lw:simple-char at some point (for a presumably good reason which I can't
recall any more), and then that assumption trickles down.

So: "the example works in any implementation with Unicode support [IF
the object behind the printed representation of the string has the right
shape]".  Not ideal, I admit that.


d.




More information about the cxml-devel mailing list