3 ms·
I looked at the Norvig lis.py code and took the time to understand every line. It's a clever program and taught me a few new Python tricks. The main reason he c
by deadsy 16y ago
I looked at the Norvig lis.py code and took the time to understand every line. It's a clever program and taught me a few new Python tricks. The main reason he can get it down to so few lines of code is that he leans back on the capabilities of Python. E.g. garbage collection, arbitrary objects stored in hierarchical lists, lambdas, use of dictionaries for the environment/symbol table. If you try the same thing with a language like C you either need library support or more lines of original code.