<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks...<div><br></div><div><br><div><div>On Apr 22, 2011, at 05:08 , David Lichteblau wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Quoting Marco Antoniotti (<a href="mailto:marcoxa@cs.nyu.edu">marcoxa@cs.nyu.edu</a>):<br><blockquote type="cite"><br></blockquote><blockquote type="cite">On Apr 21, 2011, at 16:54 , David Lichteblau wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Quoting Marco Antoniotti (<a href="mailto:marcoxa@cs.nyu.edu">marcoxa@cs.nyu.edu</a>):<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Always on LWM. I assume this has to do with UNICODE or not support, but the example in the docs is misleading.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">CL-USER 37 > (defparameter *source* (cxml:make-source "<example>text</example>"))<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">That example should work in any implementation with Unicode support.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Backtrace?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Value of *features*?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Here they are. I suspect that LWM does not support UNICODE.<br></blockquote><br>It supports Unicode, but LispWorks has slighly weird subtypes of<br>CHARACTER, and sometimes code insists on one subtype over the other.<br><br>In this case, I'm afraid the argument to MAKE-SOURCE needs to be a<br>string made up of LW:SIMPLE-CHAR rather than CHARACTER.<br><br>Things to try:<br><br>;; returns T on other Lisps, but might go wrong on LispWorks:<br>(typep "<example>text</example>" '(vector runes:rune))<br></div></blockquote><div><br></div><div>NIL</div><div><br></div><div><br></div><br><blockquote type="cite"><div><br>;; possible workaroud<br>(cxml:make-source (coerce "<example>text</example>"<br> '(simple-array runes:rune)))<br></div></blockquote><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><div><font class="Apple-style-span" face="'Courier New'">CL-USER 14 > (cxml:make-source (coerce "<example>text</example>"</font></div><div><font class="Apple-style-span" face="'Courier New'"> '(simple-array runes:rune)))</font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'">Error: Cannot coerce "<example>text</example>" to type (SIMPLE-ARRAY RUNES:RUNE).</font></div><div><font class="Apple-style-span" face="'Courier New'"> 1 (abort) Return to level 0.</font></div><div><font class="Apple-style-span" face="'Courier New'"> 2 Return to top loop level 0.</font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'">Type :b for backtrace or :c <option number> to proceed.</font></div><div><font class="Apple-style-span" face="'Courier New'">Type :bug-form "<subject>" for a bug report template or :? for other options.</font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'">CL-USER 15 : 1 > :b</font></div><div><font class="Apple-style-span" face="'Courier New'">Call to ERROR</font></div><div><font class="Apple-style-span" face="'Courier New'">Call to COERCE</font></div><div><font class="Apple-style-span" face="'Courier New'">Call to EVAL</font></div><div><font class="Apple-style-span" face="'Courier New'">Call to CAPI::CAPI-TOP-LEVEL-FUNCTION</font></div><div><font class="Apple-style-span" face="'Courier New'">Call to CAPI::INTERACTIVE-PANE-TOP-LOOP</font></div><div><font class="Apple-style-span" face="'Courier New'">Call to MP::PROCESS-SG-FUNCTION</font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'">CL-USER 16 : 1 > </font></div></div><div><br></div><br><blockquote type="cite"><div><br>Sorry about that, but I gave up on trying to fix all of these little<br>issues related to lw:simple-char a long time ago. We have to assume<br>lw:simple-char at some point (for a presumably good reason which I can't<br>recall any more), and then that assumption trickles down.<br><br>So: "the example works in any implementation with Unicode support [IF<br>the object behind the printed representation of the string has the right<br>shape]". Not ideal, I admit that.<br></div></blockquote></div><div><br></div>Ok.<div><br></div><div>What about adding something along the lines of the following in "closure-common/characters.lisp"?</div><div><br></div><div><font class="Apple-style-span" face="'Courier New'">(eval-when (:load-toplevel :compile-toplevel :execute)</font></div><div><font class="Apple-style-span" face="'Courier New'"> (unless (eq *default-character-element-type* 'lw:simple-char)</font></div><div><font class="Apple-style-span" face="'Courier New'"> (cerror "Set the default sting character element type to LW:SIMPLE-CHAR."</font></div><div><font class="Apple-style-span" face="'Courier New'"> "The current default character element type is ~A." *default-character-element-type*)</font></div><div><font class="Apple-style-span" face="'Courier New'"> (set-default-character-element-type 'lw:simple-char))))</font></div><div><br></div><div>Going over the LW mailing list archives it appears that the above would work, provided that the <span class="Apple-style-span" style="font-family: 'Courier New'; ">set-default-character-element-type</span> call is the only one in the image.</div><div><br></div><div>I am also bugging the LW folks on this. </div><div><br></div><div>Cheers</div><div>--</div><div>Marco</div><div><br></div><div><br></div><div><br><div>--<br>Marco Antoniotti<br><br></div><br></div></div></body></html>