by jepler · 4y ago · 0 comments
When they wanted their programs executed by a computer, their editor -Edwin- matched parens, exactly like how one would do it today, or even easier with things like Paredit.
It's not so obvious in Python when you make an indentation error in a complicated if/elif/else structure.
if (A) { if (A) {
B B
C --> C
} D
D E
E }
Imagine that is 300 lines long and BCDE contain their own nesting and such.We can do a "git diff -w" and just see that the closing brace moved and that there are no changes in D and E.
Do the same in Python and "git diff -w" comes up empty.
What's more challenging in Scheme, as Abelson and Sussman teach it, is the use of recursion instead of looping and in particular understanding that recursion is only equivalent to looping when the recursion is in "tail position", i.e. when there is nothing left for the calling function to do except return to its own caller.
Common Lisp style tends to use looping, not recursion.