Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Lisp (programming language)
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
===Lists=== A Lisp list is written with its elements separated by [[Whitespace character|whitespace]], and surrounded by parentheses. For example, {{Lisp2|(1 2 foo)}} is a list whose elements are the three ''atoms'' {{Lisp2|1}}, {{Lisp2|2}}, and [[foo|{{#tag:syntaxhighlight|foo|lang=Lisp|inline=1}}]]. These values are implicitly typed: they are respectively two integers and a Lisp-specific data type called a "symbol", and do not have to be declared as such. The empty list {{Lisp2|()}} is also represented as the special atom {{Lisp2|nil}}. This is the only entity in Lisp which is both an atom and a list. Expressions are written as lists, using [[Polish notation|prefix notation]]. The first element in the list is the name of a function, the name of a macro, a lambda expression or the name of a "special operator" (see below). The remainder of the list are the arguments. For example, the function {{Lisp2|list}} returns its arguments as a list, so the expression <syntaxhighlight lang="Lisp"> (list 1 2 (quote foo)) </syntaxhighlight> evaluates to the list {{Lisp2|(1 2 foo)}}. The "quote" before the {{Lisp2|foo}} in the preceding example is a "special operator" which returns its argument without evaluating it. Any unquoted expressions are recursively evaluated before the enclosing expression is evaluated. For example, <syntaxhighlight lang="Lisp"> (list 1 2 (list 3 4)) </syntaxhighlight> evaluates to the list {{Lisp2|(1 2 (3 4))}}. The third argument is a list; lists can be nested.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Lisp (programming language)
(section)
Add topic