Base 256: that's an implementation detail. Little-endian: that's an implementation detail. My Smalltalk uses base 65536 native-endian and takes some care not to let Smalltalk code find out. (Not least because on 64-bit machines I want to use base 2**32.) For *private* methods, depending on otherwise hidden implementation details is fair enough. My Smalltalk picked up a convention from Squeak -- or rather, from the Squeak mailing list -- that a 'pvt' prefix on a selector makes it truly private and *enforces* that. Pharo does not seem to have anything similar, and #at: is the epitome of a selector in extremely wide general use. Since #digitAt: exists -- and is what the integer classes use -- it is practically certain that #at: is sent to an integer only by mistake.
On Wed, 13 Mar 2019 at 17:18, K K Subbu <[email protected]> wrote: > On 12/03/19 9:25 AM, Richard O'Keefe wrote: > > Squeak where (20 factorial at: 1) answers 0 (oh dear oh dear oh > > dear). > > Richard, > > Could you please elaborate on why this is an error? > > Large integers are place value encoded (base 256 little endian) and > stored in byte arrays, so they need #at:/#at:put: (as private methods). > Place value encoding is not architecture-specific so it doesn't affect > portability of an image. > > Regards .. Subbu > >
