Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
M-expression
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Examples == The definitions for the functions apply and eval from the Lisp 1.5 Manual, page 13. apply[fn;x;a] = [atom[fn] β [eq[fn;CAR] β caar[x]; eq[fn;CDR] β cdar[x]; eq[fn;CONS] β cons[car[x];cadr[x]]; eq[fn;ATOM] β atom[car[x]]; eq[fn;EQ] β eq[car[x];cadr[x]]; T β apply[eval[fn;a];x;a]]; eq[car[fn];LAMBDA] β eval[caddr[fn];parlis[cadr[fn];x;a]]; eq[car[fn];LABEL] β apply[caddr[fn];x;cons[cons[cadr[fn];caddr[fn]];a]]] eval[e;a] = [atom[e] β cdr[assoc[e;a]]; atom[car[e]] β [eq[car[e],QUOTE] β cadr[e]; eq[car[e];COND] β evcon[cdr[e];a]; T β apply[car[e];evlis[cdr[e];a];a]]; T β apply[car[e];evlis[cdr[e];a];a]] Using the function eval on an s-expression. eval[(EQ (QUOTE A) (CAR (CONS (QUOTE A) (QUOTE (B C D)))));NIL]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)