[ANN] [UPDATES] Squeak 3.4 now in beta

Valloud Andres Andres.Valloud at oya.state.or.us
Fri Dec 6 19:05:29 UTC 2002


Hello.

> Oh dear. The Unix guys really have been far-sighted when they created (or
maybe adopted) the single-rooted path name hierarchy. It's _so_ much simpler
to use than everything else out there ... No wonder it was adopted for URLs,
too. Can't we just do the same? That is, use Unix/URL-like notation in the
image and let the VM worry about mapping that to platform path names?

It's simple and homogeneous.  Of course it should work, as opposed to Java's
59 reserved words.

Here's something that just crossed my mind.  Make / a binary message.  So
/usr/bin/gcc/gcc becomes:

	Root / 'usr' / 'bin' / 'gcc' / 'gcc'

To have extra meaningfulness without resorting to parentheses, use keyword
messages:

	Root / 'usr' / 'bin' / 'gcc' streamForFileNamed: 'gcc'
	Root / 'usr' / 'bin' / 'gcc' hasFileNamed: 'gcc'
	Root / 'usr' / 'bin' hasFolderNamed: 'gcc'
	Root foldersDo: aBlock

The pattern is to use binary messages to aggregate and keyword ones to
actually do something when you reach the point of interest.  The keyword
selectors would have to be extremely well chosen.

Now I also realize that Root could just be the empty string which would
indicate absolute names, as opposed to names whose first component is not
empty hence they're relative.

In my experience, applying this pattern to blocks and the binary comma
message produces interesting things such as

	[x], [y], [z]
		ifAllTrue:
		ifAnyTrue:
		otherwise:

Or (remember nil class == UndefinedObject):

	[x], [y], [z]
		ifAllDefined:
		ifAnyDefined:
		otherwise:

Not to mention

isWhatever
	"^(x1 or: [x2]) or: [y1 and: [y2]]"

	^[x1], [x2] orAllOf: [y1], [y2]

Note how parentheses, nesting, and superfluous logical connectors are
eliminated.  It works really well.

Andres.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20021206/660f52e1/attachment.htm


More information about the Squeak-dev mailing list