3 ms·
> It's said that Lisp programmers often work by first building a domain-specific language for solving their problem, then solving the problem in that new langua
by stcredzero 14y ago
> It's said that Lisp programmers often work by first building a domain-specific language for solving their problem, then solving the problem in that new language.
This is precisely how good Smalltalkers operated. It was very doable, because even constructs like conditional logic and "looping" (really iterators) were just ordinary calls. For example, if you wanted to implement "fuzzy logic" in Smalltalk it would just take a mere minutes to implement some methods like:
ifTrue:ifFalse:ifMaybe:
Then define a Maybe class and use it as the Maybe value and park some methods like that on it. Then this would let you write code like:
result
ifTrue: [ "condition 1" ]
ifFalse: [ "something else" ]
ifMaybe: [
"handle maybe"
].