This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: What is 'The Transcript' ?
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
It's not immediately obvious to people coming to Smalltalk for the first time. But their beloved shell scripting environments, such as bash and ksh, are exactly what the Transcript is.
The Transcript is designed more as a 'free' area though, that isn't driven by hitting 'enter'. Although, it could be - since most information that is pumped out to the Transcript is very like the sort of output that is pumped out by shell programs.
The Transcript does not work as a stdin/stdout though. Perhaps it should! There's been a couple of blog entries about putting objects on to the Transcript "The easy way". I disagree with them.
Instead of putting this 'text' stuff on to a Transcript - if you have an object, put the object on the Transcript. Why? Well if we're in a stdin/stdout type environment with objects, then reading from the Transcript will procure you an object! not some piece of text.
There's more to it than that. The Transcript then become a visitor pattern and it chooses what kind of presentation to apply to things. If you wanted a 'source code' version then you can get your '' double quoting effect. If you want a human readable Transcript then everything will be peachy. But the Transcript will be able to map things back to the original object given to it - and let you click on it and act on it.
Let's take this further. There has been requests for a stdin/stdout Smalltalk environment in VisualWorks. This, to me, is just another facets of the visitor pattern in a Transcript for stdin/stdout. IMHO, it's time we revisited the metaphor of the Transcript to make it something -more- than what it is.
I know how I'd achieve an object Transcript - I'd use WithStyle to do it.