4 ms·
I'm very much a beginner with Smalltalk but have used C since K&R. I'm having difficulty with the statement that Slang is a dialect of Smalltalk which "does not
by tengwar2 4y ago
I'm very much a beginner with Smalltalk but have used C since K&R. I'm having difficulty with the statement that Slang is a dialect of Smalltalk which "does not have blocks (except for a few control structures), message sending or even objects." How can you have even a subset of Smalltalk without these? Even something as basic as an "if" statement uses all three. I see the examples, but they don't shed much light. Or is the grammar wrong, so the sentence is intended to say that the C output does not have objects etc.?
- Jtsummers 4y agoI'm not sure about objects, but at least for control structures like "if" the answer is in your quote: > (except for a few control structures) Blocks are available specifically for those limited control structures, like "if".
- erik_seaberg 4y agoI think they’re saying ifTrue: is an intrinsic in their transpiler, so the method call is skipped and replaced with a C statement. They could have chosen instead to generate C code that actually invokes a method on a receiver (using whatever their calling convention is for methods), which would be slower but monkey-patching would work as usual.