Symbol and Array printOn:
Lex Spoon
lex at cc.gatech.edu
Thu Jan 13 05:08:12 UTC 2000
Stephane Ducasse <ducasse at iam.unibe.ch> wrote:
> Hi Bolot
>
> Thanks for the explanation
> But #() is for literal array and {} or Array are for dynamic array so where is
> the problem.
> I agree with David Smith and Bert.
>
{} is cool, but only if the array's contents have storeString which is
self-evaluating. This would implicity mean doing storeString instead of
printString on the contents of the array, which could actually be
pretty annoying even when it's valid. (I'd rather see something
like "a Form (400x300x16)" than the storeString of a huge form, even
if the form is a member of an array.)
So for symbols, the # notation is easy. For arrays, it is far more involved.
It would be greatly simplified, though, if constant arrays were
to produce instants of a LiteralArray class instead of the generic Array.
As a bonus, we could take the opportunity to override at:put: for
LiteralArrays so that they cannot be modified.
Lex
More information about the Squeak-dev
mailing list
|