[bug] 1 instVarAt: 1 put: 1.

John M McIntosh johnmci at smalltalkconsulting.com
Thu Aug 14 04:48:58 UTC 2003


On Wednesday, August 13, 2003, at 03:16  PM, Andreas Raab wrote:

> Hi,
>
> While we can consider this a bug, it is certainly the case that you  
> should
> ask an object about its instSize before attempting this. E.g.,
>
> 	Object instSize => 0 "no instVars"
> 	Point instSize => 2 "two instVars"

I'm not sure I agree with that, it's like asking an array for it's size  
and verifying the index value of the
at: or at:put: you are doing. We don't do that and rely on the fact  
that an boundary check will occur.
Same thing should happen here.  Either throw the

  errorSubscriptBounds: index
	"Create an error notification that an improper integer was used as an  
index."
or the
	self error: (self class name) , 's are not indexable'

based on the primitive failure recovery code, much like in Object>at:

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===



More information about the Squeak-dev mailing list