|
|
|
|
|
by stcredzero
5173 days ago
|
|
"Here is what my DSL can look like with Blocks in Smalltalk"
(condition)
ifTrue: [ ... ]
ifFalse: [ ... ]
ifMaybe: [ ... ]
You can accomplish the same thing with named functions and function pointers, but it makes the DSL very awkward to use. Imagine if you had to write all of your conditional logic (if-then and if-then-else and switch) using the names of functions defined elsewhere. That would be much less readable than being able to write block of code inline. |
|