krfkeith / slate-language

Automatically exported from code.google.com/p/slate-language
MIT License
1 stars 0 forks source link

inconsistent array new behavior #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
ExtensibleArray new &capacity: 5. "is an empty array"
Array new &capacity: 5. "has 5 elements"

Original issue reported on code.google.com by google@timmy.tmbx.com on 20 Mar 2010 at 2:18

GoogleCodeExporter commented 9 years ago
This is also true in Smalltalk-80, via newSize:, not that it justifies the 
behavior 
necessarily.

The attribute &capacity:/#capacity should indicate the number of elements that 
can be 
held, rather than the #size which is the number of elements actually held, so 
there 
was at least a design decision to distinguish those because of cases like this.

Original comment by BrianTRice on 26 May 2010 at 5:40