3 ms·
To build on this, related to the theme of blocks: Smalltalk syntax is almost entirely free of magical constructs that you can't easily replicate in user code (o
by arnsholt 7y ago
To build on this, related to the theme of blocks: Smalltalk syntax is almost entirely free of magical constructs that you can't easily replicate in user code (off the top of my head `self`, `super`, the `[]` syntax for blocks, and compile-time literals can't be replicated), literally everything in Smalltalk is messages to objects (or method calls on objects in contemporary OO terms); thus a conditional which would be `if() { ... } else { ... }` in an Algol language is done by passing the `ifTrue:ifFalse:` message to a boolean object. Thus, if you need a custom control structure, you can implement them yourself and it'll be just like any other control structure in the language.