libera/#lisp - IRC Chatlog
Search
14:57:59
x8dcc
Hello again. I have changed what you recommended me yesterday. I added an eval_args() function which is equivalent to SICP's list-of-values, and I call it on the arguments from `eval' before passing them to `apply'
14:58:36
x8dcc
However, my `quote' issue still remains. I am having a lot of trouble understanding how quoted expressions are passed through functions.
15:16:40
reb
x8dcc: Have you taken a look at: https://norvig.com/lispy.html The article describes how to write a Lisp interpreter in Python. In Norvig's code various special forms are handled directly by eval, including "if", "lambda", and "quote".
15:46:18
dbotton
https://www.reddit.com/r/lisp/comments/1c6zq1m/quick_start_of_a_game_in_clog_inspired_by_the/
16:39:53
x8dcc
reb: In both versions (lis.py and lispy.py), eval returns expr[1] for quotes. It's consistent with everything I have read about quotes, but I still feel like I am missing some key detail. If (quote +) evaluates to +, why wouldn't ((quote +)) work?
16:40:54
x8dcc
In my head it would evaluate the first element of the list, since it's a quote it would return the symbol + which would be looked up in the environment and found as a primitive
16:42:46
x8dcc
I know it's not the case, but it makes sense to me by looking at how the python example is implemented