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
Computer program
(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!
====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"/>
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)