[BUG?] Byte arrays don't fail on too large values

Stefan Matthias Aust sma at 3plus4.de
Sun May 7 18:21:32 UTC 2000


Should a byte array throw an error if you try to store something less than 
0 or greater than 255 into it?  I think, it should.  But it doesn't. The 
expression

(ByteArray new: 1) at: 1 put: 257; yourself

happily answers

#[1]

Or at least it would if it'd support the usual literal form for byte arrays 
:-( But you get the idea.  It seems to stores just the 8 least significant 
bits.


bye
--
Stefan Matthias Aust  //  Bevor wir fallen, fallen wir lieber auf





More information about the Squeak-dev mailing list