3 ms·
There's always the classic from 1988, which completely blew my mind when I came across it a couple of years later: "Building a backtracking facility in smallta
by mpweiher 10y ago
There's always the classic from 1988, which completely blew my mind when I came across it a couple of years later:
"Building a backtracking facility in smalltalk without kernel support"[1]
Languages like Snobol, Prolog, and Icon were designed with backtracking facilities from the outset and these facilities are deeply intertwined with the implementation. Retrofitting a backtracking facility in a language that wasn't designed for it has never been achieved. We report on an experiment to retrofit Smalltalk with a backtracking facility. The facility is provided through a small number of primitives written in the language (no modifications to the kernel were made). The ability to do this is a direct result of the power provided by the objectification of contexts.
I'll leave the qualitative analysis of which is easier or more concise to others.
[1] http://dl.acm.org/citation.cfm?doid=62084.62094&CFID=739328395&CFTOKEN=98039752 http://dl.acm.org/citation.cfm?doid=62084.62094&CFID=7393283...