[BUG][FIX] XML parser example fails

Peter van Rooijen peter at vanrooijen.com
Tue Dec 14 15:21:50 UTC 2004


Boris Gaertner wrote:

[snip]

>    (NameDelimiters at: char asciiValue)
>    (DigitTable at: char asciiValue)
> 
> This assumes an index range from 0 to 255 and will inevitably
> crash when the character (Character value: 0)  is ever read.
> 
> I fixed that, too - call me a pedant if you think I am one!

Not at all :-) I think you are quite right!

Such lookup-arrays are exactly the type of thing that one wants to have 
a primitive for that implements

atZeroBasedIndex:, so as to avoid the + 1 addition.

BTW one could use a byte-array or a bit-array to get the same effect 
with (~32 times) less memory use.

[snip]

Cheers,

Peter

> Greetings,
> Boris



More information about the Squeak-dev mailing list