Archive for September, 2007

Rethinking the comma

Sunday, September 2nd, 2007

This is a follow-up to the post about message chains from a few days ago. Like any syntax-related issue, the choice of the operator is one of those delightful things that encourage a lively exchange of opinions by virtue of being easy to have an opinion about. I ended the post half-seriously considering “:)”, but here is an interesting thought experiment.

Suppose we abolish a comma as a binary message. A + could just as well work as a generic “join these two things” message a comma usually is. Instead, suppose that the comma becomes the new chain operator. Here is what it would look like.

something thingsAt: aKey, includes: aThing,
    ifTrue: [...]
    ifFalse: [...]

This fits nicely with the original Smalltalk idea of using natural language punctuation for message control, and continues the line-up of a period and a semicolon by being the weakest message separator of them all.