|
|
|
|
|
by matheusmoreira
15 days ago
|
|
Yeah, I didn't get it either until I implemented my own lisp. > the difficult thing I’ve found over the years is that Lisp is sort of unexplainable I've found that getting rid of the parentheses helps. f(x)
(f x)
["f", "x"]
(print (< 10 20))
["print", ["<", 10, 20]]
Lisp code is just normal Python lists which get evaluated by an interpreter function. Like this: code = ["print", ["<", 10, 20]]
def eval(code):
# magic
eval(code)
True
Filling out that eval function is a great way to learn lisp.These articles are very good and accessible: https://www.norvig.com/lispy.html https://norvig.com/lispy2.html |
|