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
Computer program
(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!
====Lisp==== [[Lisp (programming language)|Lisp]] (1958) stands for "LISt Processor".<ref name="ArtOfLisp">{{cite book | last1=Jones | first1=Robin | last2=Maynard | first2=Clive | last3=Stewart | first3=Ian | title=The Art of Lisp Programming | date=December 6, 2012 | publisher=Springer Science & Business Media | isbn=9781447117193 | page=2}}</ref> It is tailored to process [[List (abstract data type)|lists]]. A full structure of the data is formed by building lists of lists. In memory, a [[tree data structure]] is built. Internally, the tree structure lends nicely for [[Recursion (computer science)|recursive]] functions.<ref name="cpl_3rd-ch9-220">{{cite book | last = Wilson | first = Leslie B. | title = Comparative Programming Languages, Third Edition | publisher = Addison-Wesley | year = 2001 | page = 220 | isbn = 0-201-71012-9 }}</ref> The syntax to build a tree is to enclose the space-separated [[Element (mathematics)|elements]] within parenthesis. The following is a [[list]] of three elements. The first two elements are themselves lists of two elements: <code>((A B) (HELLO WORLD) 94)</code> Lisp has functions to extract and reconstruct elements.<ref name="cpl_3rd-ch9-221">{{cite book | last = Wilson | first = Leslie B. | title = Comparative Programming Languages, Third Edition | publisher = Addison-Wesley | year = 2001 | page = 221 | isbn = 0-201-71012-9 }}</ref> The function <code>head()</code> returns a list containing the first element in the list. The function <code>tail()</code> returns a list containing everything but the first element. The function <code>cons()</code> returns a list that is the concatenation of other lists. Therefore, the following expression will return the list <code>x</code>: <code>cons(head(x), tail(x))</code> One drawback of Lisp is when many functions are nested, the parentheses may look confusing.<ref name="cpl_3rd-ch9-230"/> Modern Lisp [[Integrated development environment|environments]] help ensure parenthesis match. As an aside, Lisp does support the ''imperative language'' operations of the assignment statement and goto loops.<ref name="cpl_3rd-ch9-229">{{cite book | last = Wilson | first = Leslie B. | title = Comparative Programming Languages, Third Edition | publisher = Addison-Wesley | year = 2001 | page = 229 | isbn = 0-201-71012-9 }}</ref> Also, ''Lisp'' is not concerned with the [[datatype]] of the elements at compile time.<ref name="cpl_3rd-ch9-227">{{cite book | last = Wilson | first = Leslie B. | title = Comparative Programming Languages, Third Edition | publisher = Addison-Wesley | year = 2001 | page = 227 | isbn = 0-201-71012-9 }}</ref> Instead, it assigns (and may reassign) the datatypes at [[Runtime (program lifecycle phase)|runtime]]. Assigning the datatype at runtime is called [[Name binding#Binding time|dynamic binding]].<ref name="cpl_3rd-ch9-222">{{cite book | last = Wilson | first = Leslie B. | title = Comparative Programming Languages, Third Edition | publisher = Addison-Wesley | year = 2001 | page = 222 | isbn = 0-201-71012-9 }}</ref> Whereas dynamic binding increases the language's flexibility, programming errors may linger until late in the [[software development process]].<ref name="cpl_3rd-ch9-222"/> Writing large, reliable, and readable Lisp programs requires forethought. If properly planned, the program may be much shorter than an equivalent ''imperative language'' program.<ref name="cpl_3rd-ch9-230"/> ''Lisp'' is widely used in [[artificial intelligence]]. However, its usage has been accepted only because it has ''imperative language'' operations, making unintended side-effects possible.<ref name="cpl_3rd-ch9-241"/>
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
Computer program
(section)
Add topic