3 ms·
The thing I love about smalltalk is that the language grammar has about 7 rules in it and everything else is defined as passing messages to objects. Want to ad
by rahoulb 4y ago
The thing I love about smalltalk is that the language grammar has about 7 rules in it and everything else is defined as passing messages to objects.
Want to add a method? You send the class a message and pass it a block with the method contents.
Want define a class? You send the parent class the subclass message.
Want an if statement? You evaluate a Boolean in a block and send it the ifTrue or ifFalse messages.
It means that sometimes it reads a bit strange, but there's a purity to it I love. Plus if you don't like it you can just define your own methods - for example I once did an (unfinished) library for GNU Smalltalk that gave it a more traditional if statement and loop constructs.