Arrays / collections with literal syntax - fixed size?

Randal L. Schwartz merlyn at
Sun Jan 6 19:55:34 UTC 2008

>>>>> "itsme213" == itsme213  <itsme213 at> writes:

itsme213>   PWDisk on:
itsme213>     (self data: theData
itsme213>         footer: (OrderedCollection with: 1 with: 2))
itsme213> vs.

What are "1" and "2"?  There's too much magic happening here.

That belongs behind a method, to make it hidden and subclassable:

PWDisk on: (self data: theData footer: self defaultFooter)

And even *that's* a bit too noisy for me.

Generally, if you hit parens, you're probably due for a refactoring.
Two sets of parens, definitely due.

#defaultFooter defined as

  ^{ 1 . 2 }

but even the 1 and 2 are mysterious constants there.  If they have
meaning, they should be constants or something:

  ^{ self beBold . self beCrazy }

or whatever the meanings are.

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at> <URL:>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See for onsite and open-enrollment Perl training!

More information about the Squeak-dev mailing list