There is many more stupid things to do than to read words of one of the best if not the best:
(An ((Even Better) Lisp) Interpreter (in Python))

sergent commented: Pretty beast! +7

I worked on Norvig's code to make it generic enough to run in both Python 2 and Python 3. I had also done my own multiline input earlier for the basic first version and adapted it to run in both environments. I attach those files to this message I linked the thread in Norvig's own site.

Together is also my tail recursive version of factorial, which new can optimize as regular loop and therefore manage any debth of recursion. Standard test file is also in zip and runs without errors.

Also I modified to take single argument from command line, so you can run for example

lispy factorial.lsp

if you have py added to PATHEXT in Windows, to get print of 5000! by the recursive function.

Here also snapshot of my multiline prompting with parenthesis counting in action.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.