[OT] C++ and Smalltalk fun
Torsten.Bergmann at phaidros.com
Torsten.Bergmann at phaidros.com
Thu Dec 4 13:06:55 UTC 2003
Yet again I showed Smalltalk to a C++/C# programmer.
I started with unary, binary and keyword messages.
After some basic examples he was not yet impressed.
To keep his eyes on the screen I told him that Transcript
is comparable to stdout in C++ andto convince him from
the open nature of Squeak I did the following:
Smalltalk at: #stdout put: Transcript
I added a method into TranscriptStream looking like
this:
<< aCollection
self show: aCollection
So we could easily write:
stdout << 'Hello' << 'World'
in a Workspace. I also showed him blocks and the implementation
of language constructs. I told him that Pascal has repeat-until
loop build into the language. C++ and Smalltalk dont have one -
the difference is that Smalltalk is able to have one without
changing the compiler or asking the vendor for it - we just
added a method #repeatUntil: to BlockContext.
He is now more interested in Smalltalk and wants to learn it.
Hopefully he uses Transcript instead of stdout in the future ;)
Have fun
Torsten
More information about the Squeak-dev
mailing list
|