This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Smalltalk for Specific Domains
Feed Title: Richard Demers Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rademers-rss.xml
Feed Description: Richard Demers on Smalltalk
One of the beauties of Smalltalk, besides its elegant simplicity, is the ease with which the language can be extended by any programmer. New control structures, new data structures -- define your own -- Smalltalk's metalanguage facilities make it easy. But it could be easier still. Some minor syntax changes could make it possible to define grammars more tailored to various domains. This is one of the ways in which I hope Smalltalk will evolve.
Here is an idea I read on comp.lang.smalltalk (sorry I don't remember the author). Today if you want to support variations on a keyword message -- which is fairly common -- you need to define methods for each variation, most of which simply call the most complete variation. For example, a:b:c: and a:b: and a:c: and a:c:b: and etc.
What if it were possible for some of the arguments of a keyword message to take default values -- without being specified in a message? Or if the order of keywords could vary? Or if keyword aliases could be used?
I'm not saying this is a change that absolutely should be made to Smalltalk, just that it is one that should be seriously considered - and have a chance at becoming part of the base language.