Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
7b9ecf78
Commit
7b9ecf78
authored
Oct 09, 2014
by
Glenn Morris
Browse files
* doc/lispref/control.texi: Avoid overfull hbox.
parent
52b16eb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
doc/lispref/control.texi
doc/lispref/control.texi
+7
-7
No files found.
doc/lispref/control.texi
View file @
7b9ecf78
...
...
@@ -328,13 +328,13 @@ lexical binding):
@example
(defun evaluate (exp env)
(pcase exp
(`(add ,x ,y)
(+ (evaluate x env) (evaluate y env)))
(`(call ,fun ,arg)
(funcall (evaluate fun env) (evaluate arg env)))
(`(fn ,arg ,body)
(lambda (val)
(evaluate body (cons (cons arg val) env))))
((pred numberp)
exp)
((pred symbolp)
(cdr (assq exp env)))
(_
(error "Unknown expression %S" exp))))
(`(add ,x ,y) (+ (evaluate x env) (evaluate y env)))
(`(call ,fun ,arg) (funcall (evaluate fun env) (evaluate arg env)))
(`(fn ,arg ,body) (lambda (val)
(evaluate body (cons (cons arg val) env))))
((pred numberp) exp)
((pred symbolp) (cdr (assq exp env)))
(_ (error "Unknown expression %S" exp))))
@end example
Where @code{`(add ,x ,y)} is a pattern that checks that @code{exp} is a three
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment