Arrays / collections with literal syntax - fixed size?

David Mitchell david.mitchell at gmail.com
Mon Jan 7 00:55:11 UTC 2008


Of course, in Squeak, you can create your own variants using implicit
self, new literals, etc. Dig into Compiler-Kernel.

I was sitting with (I think) Rob Withers at the first CampSmalltalk
when Chris Grindstaff showed us how to add literal ByteArrays. I was
coming from VisualAge and it seemed important to me.

But, at the end of the week, it didn't seem it was worth sheparding
through Squeak Central (might have even been called the Squeak Team
back then). It was easier to just update the cross platform code for
the project to use non-literal byte arrays. (I think along the lines
of:

#() asByteArray

Getting anyone to use them is tricky because of the installed base. I
mean, Seaside doesn't use braces for compatibility with other
Smalltalks.

On Jan 6, 2008 3:38 PM, itsme213 <itsme213 at hotmail.com> wrote:
> "Randal L. Schwartz" <merlyn at stonehenge.com> wrote
>
> > itsme213>         footer: (OrderedCollection with: 1 with: 2))
> >
> > What are "1" and "2"?  There's too much magic happening here.
>
> Replace them with anything else. The point was
>   OrderedCollection with:.. vs. [ ... ]
> or Dictionary ... or {..}asDictionary vs. {a=>b, c=>d}
>
> All in the context of painless light-weight DSL-like expression. Even the
> simple [optional "self"] makes quite a difference.
>
> Don't misunderstand, I would find it hard to give up the ST image, Seaside
> and kin, and their productivity.
>
> > Generally, if you hit parens, you're probably due for a refactoring.
> > Two sets of parens, definitely due.
>
> Nice advice, thanks!
>
> - Sophie
>
>
>
>
>



More information about the Squeak-dev mailing list