Fix formatting issues in eval documentation

This commit is contained in:
Peter Norvig
2026-08-31 17:23:14 -07:00
committed by GitHub
parent 8672ec00d9
commit 6adb699d55

View File

@@ -100,7 +100,7 @@
"source": [ "source": [
"## The core of Lisp: eval \n", "## The core of Lisp: eval \n",
"\n", "\n",
"Here is the core of the interpreter, `eval`. It takes as input an expression, `exp`, and an **environment** that specifies the values of variables. It returns the value of the expression. These few lines are what what [Alan Kay called](https://queue.acm.org/detail.cfm?id=1039523) \"the Maxwell's Equations of Software.\"\n" "Here is the core of the interpreter, `eval`. It takes as input an expression, `exp`, and an **environment** that specifies the values of variables. It returns the value of the expression. These few lines are what [Alan Kay called](https://queue.acm.org/detail.cfm?id=1039523) \"the Maxwell's Equations of Software.\"\n"
] ]
}, },
{ {
@@ -117,7 +117,7 @@
" return exp\n", " return exp\n",
" case Symbol(): # variable evaluates to its value in environment\n", " case Symbol(): # variable evaluates to its value in environment\n",
" return env[exp]\n", " return env[exp]\n",
" case ('define', Symbol(name), val): # definition adds name to the environment\n", " case ('define', Symbol(name), val): # definition adds name to the environment\n",
" env[name] = eval(val, env)\n", " env[name] = eval(val, env)\n",
" return name\n", " return name\n",
" case (proc, *args): # procedure call\n", " case (proc, *args): # procedure call\n",