2014-08-29 13:16 GMT+02:00 Sven Van Caekenberghe <[email protected]>:

>
> On 29 Aug 2014, at 12:53, Göran Krampe <[email protected]> wrote:
>
> > Hey!
> >
> > Just for some "food for thought", you may want to read the parts under
> heading "Literal Smalltalk arrays" and the section following - "Sidestory:
> Adding literal Dictionaries to Smalltalk?"
> >
> > ...at:
> >
> >
> http://goran.krampe.se/2012/05/08/literal-arrays-vs-json-vs-ston-vs-tirade/
> >
> > regards, Göran
>
> Yes, that is a good write up, touching on all kinds of aspects, balanced
> too.
> Pretty complicated subject, right ? ;-)
> As you mention it is quite hard to reach an agreement.
> Objectives/goals are different for everybody.
>

Yes, a good read as well.


>
> Since we had those discussions long ago, I've actually grown quite used to
> writing
>
> { #foo->1. #bar->2 } asDictionary
>
> I know it is not super efficient, or super compact, but I can certainly
> live with it.
>

I know. But I was a bit sad, when porting SmaCC from Dolphin to Pharo, to
have to remove all the literals optimisations John Brant has added in the
code generation, such as:

^ [ Dictionary new at: #foo put: #a; at: #bar put: #b; yourself ] once [1]

and:

##(Character value: 16rXXXX) [2]

(I have a framework of thought where it would be possible, for the pharo
compiler, to track and optimise such methods as [1] without requiring the
"once" above, but I have no idea if the gain would be worth the pain)

Thierry

Reply via email to