Hacker News new | ask | show | jobs
by tengwar2 1427 days 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.?
2 comments

I 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.
I'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".