Thanks! I'm about to leave town, but should be able to review and commit this by next Wednesday.
On Fri, 2008-02-22 at 10:13 +0100, Leslie P. Polzer wrote: > > However, I wonder if it possible for you to turn whatever made you > > notice it into a test-case? It is possible that this bug exists on the > > LISP you are using and not mine, but in any case we should use each such > > bug as an opportunity to expand the suite of automated tests. > > It was hard, but I managed to add one. It won't work on all implementations > since the spec doesn't guarantee a way to generate a non-simple string. > > It's very plain to see that the old code was wrong. In a branch where VAR > was guaranteed to be a STRING it used SCHAR, which is only defined for > SIMPLE-STRING (a subtype of STRING). I wonder how it could get away > with that for so long. > > > > As you will see, we have a tiny number of tests around unicode issues, > > which arose out of my using some Esperanto stuff. However, I am sure > > our tests are not sufficient. > > It would appear so :) > > > > The ideal thing would be to write a test, see that it fails without our > > patch, and then that it and all the other relevant tests are green with > > the patch in place. > > I don't know how other Lisps handle this string stuff, but on SBCL (1.0.14, > probably earlier versions, too) the new test will fail. Note that if you > have a Lisp where the test doesn't fail (despite incorrect use of SCHAR), > you won't have any problems with the erroneous code, either. > > Now, attached are three patch files containing the following: > > * the new test case > > * the fix > > * a refactoring of the UTF{16,32}LE serializers > > If you want multiple revisions in one file in the future, please say so. > > Leslie > > -- > My personal blog: http://blog.viridian-project.de/ _______________________________________________ elephant-devel site list elephant-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/elephant-devel