[squeak-dev] isSelfEvaluating (was: Re: The Trunk: Collections-nice.173.mcz)

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Oct 30 23:13:36 UTC 2009


2009/10/30 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
> 2009/10/30 Eliot Miranda <eliot.miranda at gmail.com>:
> currently it is a 3 stages rocket:
>
> Array with: 1. -> #(1)
> Array with: 1 at 2. -> {1 at 2}
> Array with: OrderedCollection new. -> an Array(an OrderedCollection())
>
>> prints as { OrderedCollection () } than #(OrderedCollection ()).  The first
>> is a syntax error but the second is completely ambiguous (i.e. evaluates to
>>  #(#OrderedCollection #())).
>> So I don't see the need to provide isSelfEvaluating.  isLiteral gives you
>> all that you need to avoid printing an Array as a literal when it isn't.
>>  And if you've drunk the braces kool aid (which I have, while studying my
>> agrippa) you're happy with Arrays printing themselves as brace constructs
>> naively even when the naive print produces non-code.
>
> That's a fair and simple approach.
>

I gave it a try, now every Array print as #( ... ) if literal, { ... } otherwise
Please vote



More information about the Squeak-dev mailing list