AW: [FYI] Java vs Squeak/Smalltalk
Andreas Raab
Andreas.Raab at gmx.de
Sat Jan 19 01:48:44 UTC 2002
These classes are _not_ primitive types but rather homogenous data sets
and that just means they contain only objects of one kind. In other
words, they are equivalent to some "Array subclass: ArrayOfBytes" with
ArrayOfBytes>>at: index put: value
(value isInteger and:[value between: 0 and: 255])
ifFalse:[self errorImproperStore: value].
^self basicAt: index put: value
Since you could implement ByteArray in exactly the way seen above there
is nothing "primitive" about it, just transparent optimizations.
Cheers,
- Andreas
> -----Ursprüngliche Nachricht-----
> Von: squeak-dev-admin at lists.squeakfoundation.org
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] Im
> Auftrag von Joerg Beekmann
> Gesendet: Freitag, 18. Januar 2002 12:56
> An: squeak-dev at lists.squeakfoundation.org
> Betreff: RE: [FYI] Java vs Squeak/Smalltalk
>
>
>
>
> >Everything is an object ( no primitive types which are not objects ).
> >Therefore, no need to understand language constructs which
> separate the
> >two. As far as the programmer is concerned, there is nothing in the
> >environment which appears to be of a fundamentally different
> character from
> >everything else.
>
>
> Almost but not quite true. For example the following shows
> the primative
> types poking through:
>
> (ByteArray new: 5) at: 1 put: 8
> v.s.
> (ByteArray new: 5) at: 1 put: 'foo'
>
>
> Joerg
>
>
>
>
More information about the Squeak-dev
mailing list
|