22 new updates

agree at carltonfields.com agree at carltonfields.com
Wed Mar 31 16:58:27 UTC 1999


I don't know if this is a radical change in the semantics per se, but certainly the status quo ante was not inconsistent or incoherent and did not obviously require a change as I saw it.  By having non-indexed objects share the trait with indexed objects of 0 size of responding the same way to each of these operations:

	object size			0
	object at: anyIndex		error
	object replaceFrom: 0		(or copyFrom:to: for strings)
		to: -1
		with: anyObject
		startingAt: 1

Doesn't seem to lead to any singularities in semantics, and has some nice properties of making certain typechecking unnecessary in practice.  The downside, of course, is that errors in reasoning may not be caught unless there *is* an error.

One possible singularity is that SmallIntegers do not continuously scale from their indexable Large Integer counterparts.  (A two-chunk SmallInteger arguably should have a non-zero size, and perhaps even respond to at: in a manner that would be logically consistent with LargeIntegers that might represent the small numbers).  For example:

	10000000000000 size  			is 6, and
	(10000000000000 / 1000) size 		is 5, but
	(10000000000000 / 10000) size 		is 0!

Is it the latter issue, or some subtle performance issue that is driving this change?

-----Original Message-----
From:	MIME :duane at cmu.edu Sent:	Wednesday, March 31, 1999 11:16 AM
To:	squeak at cs.uiuc.edu
Subject:	Re: 22 new updates

>>At 7:29 Uhr -0800 30.03.1999, Dan Ingalls wrote:
>>> 123 size no longer responds with 0.
>>> nil size no longer responds with 0.

That seems like a radical change in the semantics.  Size seems to be
everywhere defined to be the number of indexable variables in the receiver;
so 0 seems like that right answer for objects  that have no indexable
variables.



 << File: ENVELOPE.TXT >> 





More information about the Squeak-dev mailing list