Lisp interpreter in python

I'm curious how the Peter Norvig Lisp interpreter works. You can define functions in this Lisp interpreter ... how does it work? I am new and just wanted a simple explanation.

There is one part that can be connected where she says

elif x[0] == 'define':         # (define var exp)
        (_, var, exp) = x

http://norvig.com/lispy.html

+3
source share
1 answer

In this case, x[0]is define, x[1]is the name of the variable, and x[2]is the expression. Thus, in Python, it _, var, exp = xis a “destructuring destination” that destroys an array xinto its constituent elements and assigns them to variables on the left side.

+3
source

All Articles