https://en.wikipedia.org/w/api.php?action=feedcontributions&feedformat=atom&user=PuercoPop Wikipedia - User contributions [en] 2024-11-06T20:51:04Z User contributions MediaWiki 1.44.0-wmf.1 https://en.wikipedia.org/w/index.php?title=Mmap&diff=848901493 Mmap 2018-07-05T03:47:27Z <p>PuercoPop: Removed unnecesary conector</p> <hr /> <div>{{lowercase|title=mmap}}<br /> In [[computing]], '''&lt;code&gt;mmap(2)&lt;/code&gt;''' is a [[POSIX]]-compliant [[Unix]] [[system call]] that maps files or devices into memory. It is a method of [[memory-mapped file]] I/O. It implements [[demand paging]], because file contents are not read from disk initially and do not use physical RAM at all. The actual reads from disk are performed in a &quot;[[lazy evaluation|lazy]]&quot; manner, after a specific location is accessed. After the memory is no longer needed, it is important to &lt;code&gt;munmap(2)&lt;/code&gt; the pointers to it. Protection information can be managed using &lt;code&gt;mprotect(2)&lt;/code&gt;, and special treatment can be enforced using &lt;code&gt;madvise(2)&lt;/code&gt;.<br /> <br /> In [[Linux]], [[Mac OS X]] and the [[BSD]]s, &lt;code&gt;mmap&lt;/code&gt; can create several types of mappings.<br /> <br /> ==History==<br /> &lt;code&gt;mmap&lt;/code&gt; and associated systems calls were designed as part of the [[Berkeley Software Distribution]] (BSD) version of Unix. Their API was already described in the 4.2BSD System Manual, even though it was neither implemented in that release, nor in 4.3BSD.&lt;ref&gt;{{cite report |author1=[[Bill Joy|William Joy]] |author2=Eric Cooper |author3=[[Bob Fabry|Robert Fabry]] |author4=[[Samuel Leffler]] |author5=[[Marshall Kirk McKusick|Kirk McKusick]] |author6=David Mosher |title=4.2BSD System Manual |year=1983 |publisher=[[Computer Systems Research Group]], [[University of California, Berkeley]]}}&lt;/ref&gt; [[Sun Microsystems]] had implemented this very API, though, in their [[SunOS]] operating system. The BSD developers at [[University of California, Berkeley|U.C. Berkeley]] requested Sun to donate its implementation, but these talks never led to any transfer of code; 4.3BSD-Reno was shipped instead with an implementation based on the virtual memory system of [[Mach (kernel)|Mach]].&lt;ref name=&quot;opensources&quot;&gt;{{cite encyclopedia |title=Twenty Years of Berkeley Unix: From AT&amp;T-Owned to Freely Redistributable |first=Marshall Kirk |last=McKusick |authorlink=Marshall Kirk McKusick |encyclopedia=Open Sources: Voices from the Open Source Revolution |year=1999 |publisher=O'Reilly}}&lt;/ref&gt;<br /> <br /> == File-backed and anonymous ==<br /> ''File-backed mapping'' maps an area of the process's [[virtual memory]] to files; i.e. reading those areas of memory causes the file to be read. It is the default mapping type.<br /> <br /> ''Anonymous mapping'' maps an area of the process's virtual memory not backed by any file. The contents are initialized to zero.&lt;ref&gt;{{cite web |url=https://www.kernel.org/doc/man-pages/online/pages/man2/mmap.2.html |title=mmap(2) - Linux manual page}}&lt;/ref&gt; In this respect an anonymous mapping is similar to &lt;code&gt;[[malloc]]&lt;/code&gt;, and is used in some &lt;code&gt;malloc(3)&lt;/code&gt; implementations for certain allocations. However, anonymous mappings are not part of the POSIX standard, though implemented by almost all operating systems by the &lt;code&gt;MAP_ANONYMOUS&lt;/code&gt; and &lt;code&gt;MAP_ANON&lt;/code&gt; flags.<br /> <br /> == Memory visibility ==<br /> If the mapping is ''shared'' (the &lt;code&gt;MAP_SHARED&lt;/code&gt; flag is set), then it is preserved across a [[Fork (computing)|fork(2)]] system call. This means that writes to a mapped area in one process are immediately visible in all related (parent, child or sibling) processes. If the mapping is ''shared'' and backed by a file (not &lt;code&gt;MAP_ANONYMOUS&lt;/code&gt;) the underlying file media is only guaranteed to be written after it is msync(2)'ed.<br /> <br /> If the mapping is ''private'' (the &lt;code&gt;MAP_PRIVATE&lt;/code&gt; flag is set), the changes will neither be seen by other processes nor written to the file.<br /> <br /> A process reading from or writing to the underlying file will not always see the same data as a process that has mapped the file, since the segment of the file is copied into RAM and periodically flushed to disk. Synchronization can be forced with the &lt;code&gt;[[msync]]&lt;/code&gt; system call.<br /> <br /> mmap(2)ing files can significantly reduce memory overhead for applications accessing the same file; they can share the memory area the file encompasses, instead of loading the file for each application that wants access to it. This means that mmap(2) is sometimes used for [[Interprocess Communication]] (IPC). On modern [[operating system]]s mmap(2) is typically preferred to the [[System V]] IPC [[Shared memory (interprocess communication)|Shared Memory]] facility.<br /> <br /> The main difference between System V shared memory (shmem) and memory mapped I/O (mmap) is that SystemV shared memory is persistent: unless explicitly removed by a process, it is kept in memory and remains available until the system is shut down. mmap'd memory is not persistent between application executions (unless it is backed by a file).<br /> <br /> == Example of usage under the C programming language ==<br /> &lt;syntaxhighlight lang=&quot;c&quot;&gt;<br /> #include &lt;sys/types.h&gt;<br /> #include &lt;sys/mman.h&gt;<br /> #include &lt;err.h&gt;<br /> #include &lt;fcntl.h&gt;<br /> #include &lt;stdio.h&gt;<br /> #include &lt;stdlib.h&gt;<br /> #include &lt;string.h&gt;<br /> #include &lt;unistd.h&gt;<br /> <br /> /* Does not work on OS X, as you can't mmap over /dev/zero */<br /> int main(void)<br /> {<br /> const char str1[] = &quot;string 1&quot;;<br /> const char str2[] = &quot;string 2&quot;;<br /> pid_t parpid = getpid(), childpid;<br /> int fd = -1;<br /> char *anon, *zero;<br /> <br /> if ((fd = open(&quot;/dev/zero&quot;, O_RDWR, 0)) == -1)<br /> err(1, &quot;open&quot;);<br /> <br /> anon = (char*)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0);<br /> zero = (char*)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);<br /> <br /> if (anon == MAP_FAILED || zero == MAP_FAILED)<br /> errx(1, &quot;either mmap&quot;);<br /> <br /> strcpy(anon, str1);<br /> strcpy(zero, str1);<br /> <br /> printf(&quot;PID %d:\tanonymous %s, zero-backed %s\n&quot;, parpid, anon, zero);<br /> switch ((childpid = fork())) {<br /> case -1:<br /> err(1, &quot;fork&quot;);<br /> /* NOTREACHED */<br /> case 0:<br /> childpid = getpid();<br /> printf(&quot;PID %d:\tanonymous %s, zero-backed %s\n&quot;, childpid, anon, zero);<br /> sleep(3);<br /> <br /> printf(&quot;PID %d:\tanonymous %s, zero-backed %s\n&quot;, childpid, anon, zero);<br /> munmap(anon, 4096);<br /> munmap(zero, 4096);<br /> close(fd);<br /> return EXIT_SUCCESS;<br /> }<br /> <br /> sleep(2);<br /> strcpy(anon, str2);<br /> strcpy(zero, str2);<br /> <br /> printf(&quot;PID %d:\tanonymous %s, zero-backed %s\n&quot;, parpid, anon, zero);<br /> munmap(anon, 4096);<br /> munmap(zero, 4096);<br /> close(fd);<br /> return EXIT_SUCCESS;<br /> }<br /> &lt;/syntaxhighlight&gt;<br /> <br /> sample output:<br /> &lt;pre&gt;&lt;nowiki&gt;<br /> PID 22475: anonymous string 1, zero-backed string 1<br /> PID 22476: anonymous string 1, zero-backed string 1<br /> PID 22475: anonymous string 2, zero-backed string 2<br /> PID 22476: anonymous string 2, zero-backed string 2<br /> &lt;/nowiki&gt;&lt;/pre&gt;<br /> <br /> == See also ==<br /> * [[Virtual memory]] for when there is more address space than physical memory<br /> * [[Paging]] for the implementation of virtual memory<br /> * [[Page cache]] for a disk caching mechanism utilized by mmap<br /> * [[Demand paging]] for a scheme implemented by mmap<br /> <br /> == References and further reading ==<br /> {{Reflist}}<br /> *[http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html Description from POSIX standard]<br /> *Differences:<br /> **[http://www.freebsd.org/cgi/man.cgi?query=mmap FreeBSD]<br /> **[http://illumos.org/man/2/mmap illumos]<br /> **[https://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/mmap.2.html Mac OS X]<br /> **[http://docs.oracle.com/cd/E23824_01/html/821-1463/mmap-2.html#scrolltoc Solaris]<br /> **[https://archive.is/20070310090003/http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?debug=0&amp;manpage=/usr/share/man/man2.Z/mmap.2 HP-UX]<br /> **[http://www.qnx.com/developers/docs/6.4.1/neutrino/lib_ref/m/mmap.html QNX]<br /> *Windows<br /> **[http://msdn.microsoft.com/en-us/library/aa366761.aspx MapViewOfFile] win32 function is somewhat equivalent to mmap.<br /> *More example source code:<br /> ** [https://github.com/simonhf/sharedhashfile SharedHashFile], An open source, shared memory hash table implemented using mmap().<br /> <br /> {{IPC}}<br /> <br /> [[Category:Inter-process communication]]<br /> [[Category:C POSIX library]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Eduardo_Uribe&diff=841917795 Eduardo Uribe 2018-05-18T23:07:18Z <p>PuercoPop: Fix typo</p> <hr /> <div>{{Infobox football biography<br /> | name = Eduardo Uribe<br /> | image = <br /> | fullname = Eduardo Alberto Uribe Oshiro<br /> | birth_date = {{Birth date and age|1985|9|2|df=yes}} <br /> | birth_place = [[Lima]], [[Peru]]<br /> | height = {{height|m=1.80|precision=0}}<br /> | currentclub = [[Carlos A. Mannucci]]<br /> | clubnumber = <br /> | position = [[Midfielder]]<br /> | youthyears1 = <br /> | youthclubs1 = [[Alianza Lima]]<br /> | years1 = 2003–2005 <br /> | years2 = 2005–2006 <br /> | years3 = 2007–2008 <br /> | years4 = 2009–2010<br /> | years5 = 2011<br /> | years6 = 2012 <br /> | years7 = 2013<br /> | years8 = 2014<br /> | years9 = 2015<br /> | years10 = 2016<br /> | years11 = 2017–<br /> | clubs1 = [[Alianza Lima]] <br /> | clubs2 = [[Unión Huaral]] <br /> | clubs3 = [[Coronel Bolognesi]] <br /> | clubs4 = [[Alianza Lima]]<br /> | clubs5 = [[Juan Aurich]]<br /> | clubs6 = [[Real Garcilaso]]<br /> | clubs7 = [[Sporting Cristal]]<br /> | clubs8 = [[Universidad Técnica de Cajamarca|UT Cajamarca]]<br /> | clubs9 = [[FBC Melgar|Melgar]]<br /> | clubs10 = [[Alianza Lima]] <br /> | clubs11 = [[Carlos A. Mannucci]] <br /> | caps1 = | goals1 = 0<br /> | caps2 = | goals2 = 0 <br /> | caps3 = 75 | goals3 = 4 <br /> | caps4 = 55 | goals4 = 1 <br /> | caps5 = 26 | goals5 = 1 <br /> | caps6 = 45 | goals6 = 3<br /> | caps7 = 34 | goals7 = 0<br /> | caps8 = 27 | goals8 = 0<br /> | caps9 = 17 | goals9 = 2<br /> | caps10 = 30 | goals10 = 0<br /> | caps11 = 0 | goals11 = 0<br /> | pcupdate = 1 February 2014<br /> | nationalyears1 = <br /> | nationalteam1 = <br /> | nationalcaps1 = <br /> | nationalgoals1 = <br /> | ntupdate =<br /> | medaltemplates = {{Medal|Team| [[Juan Aurich]]}}<br /> {{Medal|W|[[Primera División Peruana|Peruvian League]]|[[2011 Torneo Descentralizado|2011]]}}<br /> {{Medal|Team| [[FBC Melgar]]}}<br /> {{Medal|W|[[Primera División Peruana|Peruvian League]]|[[2015 Torneo Descentralizado|2015]]}}<br /> }}<br /> <br /> '''Eduardo Alberto &quot;Lalo&quot; Uribe Oshiro''' (born 2 September 1985 in [[Lima]]) is a [[Peruvian]] [[association football|footballer]] currently playing for [[Carlos A. Mannucci]] in the [[Peruvian Segunda División]]. He mainly plays as a [[central midfielder]].<br /> <br /> ==Club career==<br /> <br /> {{Empty section|date=December 2012}}<br /> <br /> == Honours ==<br /> === Club ===<br /> ;[[Juan Aurich]]<br /> * [[Torneo Descentralizado]] (1): [[2011 Torneo Descentralizado|2011]]<br /> ;[[FBC Melgar|Melgar]]<br /> * [[Torneo Descentralizado]] (1): [[2015 Torneo Descentralizado|2015]]<br /> <br /> ==References==<br /> {{Reflist}}<br /> <br /> ==External links==<br /> * {{ESPN FC|72086}}<br /> * {{FootballDatabase.eu|eduardo.uribe.39231}}<br /> * {{Soccerway|eduardo-alberto-uribe/23477}}<br /> <br /> {{DEFAULTSORT:Uribe, Eduardo}}<br /> [[Category:1985 births]]<br /> [[Category:Living people]]<br /> [[Category:Sportspeople from Lima]]<br /> [[Category:Association football midfielders]]<br /> [[Category:Peruvian footballers]]<br /> [[Category:Alianza Lima footballers]]<br /> [[Category:Unión Huaral footballers]]<br /> [[Category:Coronel Bolognesi footballers]]<br /> [[Category:Juan Aurich footballers]]<br /> [[Category:Real Garcilaso footballers]]<br /> [[Category:Sporting Cristal footballers]]<br /> [[Category:Universidad Técnica de Cajamarca footballers]]<br /> [[Category:FBC Melgar footballers]]<br /> [[Category:Peruvian Primera División players]]<br /> <br /> <br /> {{Peru-footy-bio-stub}}</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Wish_(Unix_shell)&diff=839772065 Wish (Unix shell) 2018-05-05T15:31:13Z <p>PuercoPop: Fixed URL to the manpage</p> <hr /> <div>{{notability|Products|date=November 2016}}<br /> {{lowercase}}<br /> {{Infobox software<br /> | name = Wish<br /> | logo = &lt;!-- Image name is enough. --&gt;<br /> | logo alt = <br /> | logo caption = <br /> | screenshot = &lt;!-- Image name is enough. --&gt;<br /> | screenshot alt = <br /> | caption = <br /> | collapsible = &lt;!-- Any text here will collapse the screenshot. --&gt;<br /> | author = <br /> | developer = <br /> | released = &lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&gt;<br /> | discontinued = &lt;!-- Set to yes if software is discontinued, otherwise omit. --&gt;<br /> | ver layout = &lt;!-- simple (default) or stacked --&gt;<br /> | latest release version = <br /> | latest release date = &lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&gt;<br /> | latest preview version = <br /> | latest preview date = &lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&gt;<br /> | repo = &lt;!-- {{URL|example.org}} --&gt;<br /> | status = <br /> | programming language = <br /> | operating system = <br /> | platform = <br /> | size = <br /> | language = <br /> | language count = &lt;!-- Number only --&gt;<br /> | language footnote = <br /> | genre = <br /> | license = <br /> | alexa = <br /> | website = {{URL|http://linux.die.net/man/1/wish}}<br /> | standard = <br /> | AsOf = <br /> }}<br /> '''wish''' (Windowing Shell) is a [[Tcl]] interpreter extended with the [[Tk (software)|Tk commands]]&lt;ref&gt;{{Cite book<br /> | last1=Welch<br /> | first1=Brent B.<br /> | last2=Jones<br /> | first2=Ken<br /> | last3=Hobbs<br /> | first3=Jeffrey<br /> | date=2003 <br /> | title=Practical Programming in Tcl and Tk<br /> | url=<br /> | location=Upper Saddle River<br /> | publisher=Pearson Education, Inc. - Prentice Hall PTTR<br /> | page=25<br /> | edition=4th<br /> | isbn=0-13-038560-3<br /> }}&lt;/ref&gt; available for [[Unix-like]] [[operating system]]s with [[X Window System]], [[MacOS]], [[Microsoft Windows]]&lt;ref&gt;{{Cite web<br /> | url=https://www.activestate.com/activetcl<br /> | title=ActiveTcl<br /> | publisher=ActiveState}}&lt;/ref&gt;&lt;ref&gt;{{Cite web<br /> | url=http://wiki.tcl.tk/1866<br /> | title=Cygwin<br /> | date=2017-05-04<br /> }}&lt;/ref&gt; and [[Android (operating system)|Android]]&lt;ref&gt;{{Cite web<br /> | url=http://wiki.tcl.tk/39022<br /> | title=AndroWish<br /> | date=2013-12-04<br /> }}&lt;/ref&gt;. It provides developers with the facility to create [[Widget (GUI)|GUI widgets]] using the [[Tk (framework)|Tk toolkit]] in the [[Tcl]] programming language.&lt;ref&gt;<br /> {{Citation<br /> | title=Wish &amp;ndash; A Window-Based Shell for X<br /> | last=Gray<br /> | first=Mary<br /> | publisher=Computer Science Department, University of California, Berkeley<br /> | date=May 20, 1988<br /> | url=https://www2.eecs.berkeley.edu/Pubs/TechRpts/1988/CSD-88-420.pdf<br /> | access-date=November 8, 2016<br /> }}&lt;/ref&gt;&lt;ref&gt;{{Cite book<br /> | last=Flynt<br /> | first=Clif<br /> | date=2012-01-17<br /> | title=Tcl/Tk: A Developer's Guide<br /> | edition=3rd<br /> | url=<br /> | location=Elsevier<br /> | publisher=Morgan Kaufman<br /> | page=17<br /> | isbn=978-0-12-384717-1}}&lt;/ref&gt;<br /> <br /> wish is [[open source]] and is currently part of the [[Tcl/Tk]] programming suite.<br /> <br /> == Usage ==<br /> &lt;code&gt;wish&lt;/code&gt; can be run without parameters. Then the &lt;code&gt;%&lt;/code&gt; prompt is displayed and the interpreter awaits for commands entered interactively by the user. An empty window is opened in which the widgets created by user commands are displayed. This mode is suitable for experimenting.<br /> <br /> More often &lt;code&gt;wish&lt;/code&gt; is run with a name of a file containing a Tcl/Tk script as a parameter. It is also possible to run directly Tcl/Tk scripts; in [[Unix]] using the [[Shebang (Unix)|shebang]] construction; in [[Windows]] by associating the &lt;code&gt;.tcl&lt;/code&gt; extension with the wish program.<br /> <br /> == See also ==<br /> * [[Tcl/Tk]]<br /> <br /> == References ==<br /> {{reflist}}<br /> <br /> == External links ==<br /> * [http://linux.die.net/man/1/wish A man page for wish]<br /> <br /> {{Unix Shells}}<br /> <br /> [[Category:Software that uses Tk]]<br /> [[Category:Unix shells]]<br /> <br /> {{programming-software-stub}}</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Peephole_optimization&diff=839614202 Peephole optimization 2018-05-04T15:25:16Z <p>PuercoPop: /* Replacement rules */Minor style correction</p> <hr /> <div>In [[compiler theory]], '''peephole optimization''' is a kind of [[optimization (computer science)|optimization]] performed over a very small set of instructions in a segment of generated code. The set is called a &quot;peephole&quot; or a &quot;window&quot;. It works by recognising sets of instructions that can be replaced by shorter or faster sets of instructions.<br /> <br /> ==Replacement rules==<br /> Common techniques applied in peephole optimization:&lt;ref&gt;Crafting a Compiler with C++, Fischer/LeBlanc&lt;/ref&gt;<br /> * Null sequences – Delete useless operations.<br /> * Combine operations – Replace several operations with one equivalent.<br /> * Algebraic laws – Use algebraic laws to simplify or reorder instructions.<br /> * Special case instructions – Use instructions designed for special operand cases.<br /> * Address mode operations – Use address modes to simplify code.<br /> <br /> There can be other types of peephole optimizations.<br /> <br /> ==Examples==<br /> {{unreferenced section|date=March 2013}}<br /> ===Replacing slow instructions with faster ones===<br /> The following [[Java bytecode]]<br /> <br /> ...<br /> aload 1<br /> aload 1<br /> mul<br /> ...<br /> <br /> can be replaced by<br /> <br /> ...<br /> aload 1<br /> dup<br /> mul<br /> ...<br /> <br /> This kind of optimization, like most peephole optimizations, makes certain assumptions about the efficiency of instructions. For instance, in this case, it is assumed that the &lt;code&gt;dup&lt;/code&gt; operation (which duplicates and pushes the top of the [[stack (data structure)|stack]]) is more efficient than the &lt;code&gt;aload X&lt;/code&gt; operation (which loads a local [[Variable (programming)|variable]] identified as &lt;code&gt;X&lt;/code&gt; and pushes it on the stack).<br /> <br /> ===Removing redundant code===<br /> Another example is to eliminate redundant load stores.<br /> a = b + c;<br /> d = a + e;<br /> is straightforwardly implemented as<br /> <br /> &lt;source lang=&quot;asm&quot;&gt;<br /> MOV b, R0 # Copy b to the register<br /> ADD c, R0 # Add c to the register, the register is now b+c<br /> MOV R0, a # Copy the register to a<br /> MOV a, R0 # Copy a to the register<br /> ADD e, R0 # Add e to the register, the register is now a+e [(b+c)+e]<br /> MOV R0, d # Copy the register to d<br /> &lt;/source&gt;<br /> but can be optimised to<br /> &lt;source lang=&quot;asm&quot;&gt;<br /> MOV b, R0 # Copy b to the register<br /> ADD c, R0 # Add c to the register, which is now b+c (a)<br /> MOV R0, a # Copy the register to a<br /> ADD e, R0 # Add e to the register, which is now b+c+e [(a)+e]<br /> MOV R0, d # Copy the register to d<br /> &lt;/source&gt;<br /> <br /> ===Removing redundant stack instructions===<br /> If the compiler saves registers on the stack before calling a subroutine and restores them when returning, consecutive calls to subroutines may have redundant stack instructions.<br /> <br /> Suppose the compiler generates the following [[Z80]] instructions for each procedure call:<br /> <br /> &lt;source lang=&quot;asm&quot;&gt;<br /> PUSH AF<br /> PUSH BC<br /> PUSH DE<br /> PUSH HL<br /> CALL _ADDR<br /> POP HL<br /> POP DE<br /> POP BC<br /> POP AF<br /> &lt;/source&gt;<br /> <br /> If there were two consecutive subroutine calls, they would look like this:<br /> <br /> &lt;source lang=&quot;asm&quot;&gt;<br /> PUSH AF<br /> PUSH BC<br /> PUSH DE<br /> PUSH HL<br /> CALL _ADDR1<br /> POP HL<br /> POP DE<br /> POP BC<br /> POP AF<br /> PUSH AF<br /> PUSH BC<br /> PUSH DE<br /> PUSH HL<br /> CALL _ADDR2<br /> POP HL<br /> POP DE<br /> POP BC<br /> POP AF<br /> &lt;/source&gt;<br /> <br /> The sequence POP regs followed by PUSH for the same registers is generally redundant. In cases where it is redundant, a peephole optimization would remove these instructions. In the example, this would cause another redundant POP/PUSH pair to appear in the peephole, and these would be removed in turn. Removing all of the [[redundant code]] in the example above would eventually leave the following code:<br /> <br /> &lt;source lang=&quot;asm&quot;&gt;<br /> PUSH AF<br /> PUSH BC<br /> PUSH DE<br /> PUSH HL<br /> CALL _ADDR1<br /> CALL _ADDR2<br /> POP HL<br /> POP DE<br /> POP BC<br /> POP AF<br /> &lt;/source&gt;<br /> <br /> ==Implementation==<br /> Modern architectures typically allow for many hundreds of different kinds of peephole optimizations, and it is therefore often appropriate for [[compiler]] [[computer programming|programmers]] to implement them using a [[pattern matching]] [[algorithm]]. &lt;ref&gt;Compilers – Principles, Techniques, and Tools 2e, p560&lt;/ref&gt;<br /> <br /> ==See also==<br /> *[[Object code optimizer]]s, discussion in relation to general [[algorithmic efficiency]]<br /> *[[Capex Corporation]] – produced the [[COBOL]] [[program optimization|optimizer]], an early mainframe [[object code optimizer]] for [[IBM]] Cobol<br /> *[[Superoptimization]]<br /> <br /> ==References==<br /> &lt;references /&gt;<br /> <br /> ==External links==<br /> * [ftp://ftp.cs.princeton.edu/pub/lcc/contrib/copt.shar The copt general-purpose peephole optimizer by Christopher W. Fraser]<br /> * [http://portal.acm.org/citation.cfm?id=365000 The original paper]<br /> {{wti}}<br /> <br /> {{Compiler optimizations}}<br /> <br /> [[Category:Compiler optimizations]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Bitap_algorithm&diff=820002037 Bitap algorithm 2018-01-12T14:29:08Z <p>PuercoPop: /* Fuzzy searching */There is nothing intuitive about 1 and 0 representing true and false</p> <hr /> <div>The '''bitap algorithm''' (also known as the '''shift-or''', '''shift-and''' or '''Baeza-Yates–Gonnet''' algorithm) is an [[approximate string matching]] algorithm. The algorithm tells whether a given text contains a substring which is &quot;approximately equal&quot; to a given pattern, where approximate equality is defined in terms of [[Levenshtein distance]]{{snd}} if the substring and pattern are within a given distance ''k'' of each other, then the algorithm considers them equal. The algorithm begins by precomputing a set of [[bitmask]]s containing one bit for each element of the pattern. Then it is able to do most of the work with [[bitwise operation]]s, which are extremely fast.<br /> <br /> The bitap algorithm is perhaps best known as one of the underlying algorithms of the [[Unix]] [[programming tool|utility]] [[agrep]], written by [[Udi Manber]], [[Sun Wu (computer scientist)|Sun Wu]], and [[Burra Gopal]]. Manber and Wu's original paper gives extensions of the algorithm to deal with fuzzy matching of general [[regular expression]]s.<br /> <br /> Due to the data structures required by the algorithm, it performs best on patterns less than a constant length (typically the [[word length]] of the machine in question), and also prefers inputs over a small alphabet. Once it has been implemented for a given alphabet and word length ''m'', however, its [[running time]] is completely predictable{{snd}}it runs in [[Big O notation|O]](''mn'') operations, no matter the structure of the text or the pattern.<br /> <br /> The bitap algorithm for exact string searching was invented by Bálint Dömölki in 1964{{ref|Domolki64}}{{ref|Domolki68}} and extended by R. K. Shyamasundar in 1977{{ref|shyamasundar77}}, before being reinvented in the context of fuzzy string searching by [[Udi Manber|Manber]] and [[Sun Wu (computer scientist)|Wu]] in 1991{{ref|Manber91}}{{ref|Manber92}} based on work done by [[Ricardo Baeza-Yates]] and [[Gaston Gonnet]].{{ref|BYG89}} The algorithm was improved by Baeza-Yates and [[Gonzalo Navarro|Navarro]] in 1996{{ref|BN96}} and later by [[Gene Myers]] for long patterns in 1998.{{ref|M99}}<br /> <br /> __TOC__<br /> <br /> ==Exact searching==<br /> The bitap algorithm for exact [[string searching algorithm|string searching]], in full generality, looks like this in pseudocode:<br /> <br /> '''algorithm''' bitap_search(text : string, pattern : string) '''returns''' string<br /> m := length(pattern)<br /> <br /> if m == 0<br /> return text<br /> <br /> /* Initialize the bit array R. */<br /> R := '''new''' array[m+1] '''of''' bit, initially all 0<br /> R[0] = 1<br /> <br /> '''for''' i = 0; i &lt; length(text); i += 1:<br /> /* Update the bit array. */<br /> '''for''' k = m; k &gt;= 1; k -= 1:<br /> R[k] = R[k-1] &amp; (text[i] == pattern[k-1])<br /> <br /> '''if''' R[m]:<br /> '''return''' (text+i - m) + 1<br /> <br /> '''return''' nil<br /> <br /> Bitap distinguishes itself from other well-known string searching algorithms in its natural mapping onto simple bitwise operations, as in the following modification of the above program. Notice that in this implementation, counterintuitively, each bit with value&amp;nbsp;zero indicates a match, and each bit with value&amp;nbsp;1 indicates a non-match. The same algorithm can be written with the intuitive semantics for 0 and 1, but in that case we must introduce another instruction into the [[inner loop]] to set &lt;code&gt;R |= 1&lt;/code&gt;. In this implementation, we take advantage of the fact that left-shifting a value shifts in zeros on the right, which is precisely the behavior we need.<br /> <br /> Notice also that we require &lt;code&gt;CHAR_MAX&lt;/code&gt; additional bitmasks in order to convert the &lt;code&gt;(text[i] == pattern[k-1])&lt;/code&gt; condition in the general implementation into bitwise operations. Therefore, the bitap algorithm performs better when applied to inputs over smaller alphabets.<br /> <br /> &lt;source lang=&quot;c&quot;&gt;<br /> #include &lt;string.h&gt;<br /> #include &lt;limits.h&gt;<br /> <br /> const char *bitap_bitwise_search(const char *text, const char *pattern)<br /> {<br /> int m = strlen(pattern);<br /> unsigned long R;<br /> unsigned long pattern_mask[CHAR_MAX+1];<br /> int i;<br /> <br /> if (pattern[0] == '\0') return text;<br /> if (m &gt; 31) return &quot;The pattern is too long!&quot;;<br /> <br /> /* Initialize the bit array R */<br /> R = ~1;<br /> <br /> /* Initialize the pattern bitmasks */<br /> for (i=0; i &lt;= CHAR_MAX; ++i)<br /> pattern_mask[i] = ~0;<br /> for (i=0; i &lt; m; ++i)<br /> pattern_mask[pattern[i]] &amp;= ~(1UL &lt;&lt; i);<br /> <br /> for (i=0; text[i] != '\0'; ++i) {<br /> /* Update the bit array */<br /> R |= pattern_mask[text[i]];<br /> R &lt;&lt;= 1;<br /> <br /> if (0 == (R &amp; (1UL &lt;&lt; m)))<br /> return (text + i - m) + 1;<br /> }<br /> <br /> return NULL;<br /> }<br /> &lt;/source&gt;<br /> <br /> ==Fuzzy searching==<br /> To perform fuzzy string searching using the bitap algorithm, it is necessary to extend the bit array ''R'' into a second dimension. Instead of having a single array ''R'' that changes over the length of the text, we now have ''k'' distinct arrays ''R''&lt;sub&gt;1..''k''&lt;/sub&gt;. Array ''R&lt;sub&gt;i&lt;/sub&gt;'' holds a representation of the prefixes of ''pattern'' that match any suffix of the current string with ''i'' or fewer errors. In this context, an &quot;error&quot; may be an insertion, deletion, or substitution; see [[Levenshtein distance]] for more information on these operations.<br /> <br /> The implementation below performs [[fuzzy matching]] (returning the first match with up to ''k'' errors) using the fuzzy bitap algorithm. However, it only pays attention to substitutions, not to insertions or deletions{{snd}}in other words, a [[Hamming distance]] of ''k''. As before, the semantics of 0 and 1 are reversed from their conventional meanings.<br /> <br /> &lt;source lang=&quot;c&quot;&gt;<br /> #include &lt;stdlib.h&gt;<br /> #include &lt;string.h&gt;<br /> #include &lt;limits.h&gt;<br /> <br /> const char *bitap_fuzzy_bitwise_search(const char *text, const char *pattern, int k)<br /> {<br /> const char *result = NULL;<br /> int m = strlen(pattern);<br /> unsigned long *R;<br /> unsigned long pattern_mask[CHAR_MAX+1];<br /> int i, d;<br /> <br /> if (pattern[0] == '\0') return text;<br /> if (m &gt; 31) return &quot;The pattern is too long!&quot;;<br /> <br /> /* Initialize the bit array R */<br /> R = malloc((k+1) * sizeof *R);<br /> for (i=0; i &lt;= k; ++i)<br /> R[i] = ~1;<br /> <br /> /* Initialize the pattern bitmasks */<br /> for (i=0; i &lt;= CHAR_MAX; ++i)<br /> pattern_mask[i] = ~0;<br /> for (i=0; i &lt; m; ++i)<br /> pattern_mask[pattern[i]] &amp;= ~(1UL &lt;&lt; i);<br /> <br /> for (i=0; text[i] != '\0'; ++i) {<br /> /* Update the bit arrays */<br /> unsigned long old_Rd1 = R[0];<br /> <br /> R[0] |= pattern_mask[text[i]];<br /> R[0] &lt;&lt;= 1;<br /> <br /> for (d=1; d &lt;= k; ++d) {<br /> unsigned long tmp = R[d];<br /> /* Substitution is all we care about */<br /> R[d] = (old_Rd1 &amp; (R[d] | pattern_mask[text[i]])) &lt;&lt; 1;<br /> old_Rd1 = tmp;<br /> }<br /> <br /> if (0 == (R[k] &amp; (1UL &lt;&lt; m))) {<br /> result = (text+i - m) + 1;<br /> break;<br /> }<br /> }<br /> <br /> free(R);<br /> return result;<br /> }<br /> &lt;/source&gt;<br /> <br /> ==External links and references==<br /> #{{note|Domolki64}} Bálint Dömölki, An algorithm for syntactical analysis, Computational Linguistics 3, Hungarian Academy of Science pp. 29–46, 1964.<br /> #{{note|Domolki68}} Bálint Dömölki, A universal compiler system based on production rules, BIT Numerical Mathematics, 8(4), pp 262&amp;ndash;275, 1968. {{doi|10.1007/BF01933436}}<br /> #{{note|shyamasundar77}} R. K. Shyamasundar, Precedence parsing using Dömölki's algorithm, International Journal of Computer Mathematics, 6(2)pp 105–114, 1977 <br /> #{{note|Manber91}} Udi Manber, Sun Wu. &quot;Fast text searching with errors.&quot; Technical Report TR-91-11. Department of Computer Science, [[University of Arizona]], Tucson, June 1991. ([ftp://ftp.cs.arizona.edu/agrep/agrep.ps.1.Z gzipped PostScript])<br /> #{{note|Manber92}} Udi Manber, Sun Wu. &quot;Fast text search allowing errors.&quot; ''[[Communications of the ACM]]'', 35(10): pp. 83&amp;ndash;91, October 1992, {{doi|10.1145/135239.135244}}.<br /> #{{note|BYG89}} Ricardo A. Baeza-Yates, Gastón H. Gonnet. &quot;A New Approach to Text Searching.&quot; ''Communications of the ACM'', 35(10): pp. 74&amp;ndash;82, October 1992.<br /> #{{note|BN96}} R. Baeza-Yates and G. Navarro. A faster algorithm for approximate string matching. In Dan Hirchsberg and Gene Myers, editors, ''Combinatorial Pattern Matching'' (CPM'96), LNCS 1075, pages 1&amp;ndash;23, Irvine, CA, June 1996.<br /> #{{note|M99}} G. Myers. &quot;A fast bit-vector algorithm for approximate string matching based on dynamic programming.&quot; ''Journal of the ACM'' 46 (3), May 1999, 395&amp;ndash;415. <br /> #[https://web.archive.org/web/20120122013152/http://www.cod5.ch/archive/l/libbitap.html libbitap], a free implementation that shows how the algorithm can easily be extended for most regular expressions. Unlike the code above, it places no limit on the pattern length.<br /> #Baeza-Yates. ''Modern Information Retrieval''. 1999. {{ISBN|0-201-39829-X}}.<br /> #[https://github.com/polovik/Algorithms/blob/master/bitap.py bitap.py] - Python implementation of Bitap algorithm with Wu-Manber modifications.<br /> <br /> {{Strings}}<br /> <br /> [[Category:String matching algorithms]]<br /> [[Category:Articles with example C code]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=List_of_rendering_APIs&diff=794293271 List of rendering APIs 2017-08-07T02:56:22Z <p>PuercoPop: Missing space after comma</p> <hr /> <div>'''Rendering [[API]]s''' typically provide just enough functionality to abstract a [[graphics accelerator]], focussing on [[rendering primitive]]s, state management, command lists/[[command buffer]]s; and as such differ from fully fledged [[3D graphics libraries]], [[3D engine]]s (which handle [[scene graph]]s, lights, animation, materials etc.), and GUI frameworks; Some provide fallback [[software rasteriser]]s, which were important for compatibility and adoption before graphics accelerators became widespread.<br /> <br /> Some have been extended to include support for [[compute shader]]s.<br /> <br /> [[Low level]] rendering APIs typically leave more responsibility with the user for resource [[memory management]], and require more verbose control, but have significantly lower [[CPU]] overhead,&lt;ref&gt;{{cite web|title=imagination shows off vullkan gains|url=http://www.bit-tech.net/news/hardware/2015/08/11/imagination-vulkan/1}}&lt;/ref&gt; ''and'' allow greater utilisation of [[multicore processor]]s.<br /> <br /> ==2D rendering APIs==<br /> <br /> * [[OpenVG]]<br /> * [[Direct2D]]<br /> * [[Quartz 2D]]<br /> * [[Simple Direct Media Layer]]<br /> * [[X11]]<br /> * [[Cairo (graphics)|Cairo]]<br /> * [[Skia Graphics Engine|Skia]]<br /> * [[Qt (software)|Qt GUI]] primitive rendering abstractions, on which Qt widgets are built<br /> * [[HTML5]] [[Canvas element]]<br /> <br /> == Offline rendering ==<br /> <br /> * [[RenderMan Interface Specification|RenderMan]] aimed at offline rendering for CG films. &lt;!--- not sure it fits in this list really ---&gt;<br /> <br /> == Software rasterising ==<br /> <br /> As of 2016, these are generally considered obsolete, but were still important during the transition to hardware acceleration:<br /> <br /> * [[Rendermorphic]]s<br /> * [[BRender]] by [[argonaut software]]<br /> * [[Surrender (software)|Surrender]]<br /> <br /> == 3D rendering APIs ==<br /> <br /> These libraries are designed explicitly to abstract 3D graphics hardware for [[Computer-aided design|CAD]] and [[video games]], with possible software fallbacks.<br /> <br /> === Cross platform, high level ===<br /> * [[OpenGL]] and the [[OpenGL Shading Language]]<br /> * [[OpenGL ES]] 3D API for embedded devices<br /> * [[OpenGL SC]] a version of openGL for safety critical systems.<br /> * [[RenderWare]] (combined game engine and cross platform rendering API. Became popular since the [[PlayStation 2]] had no rendering API, initially relying on [[bare metal]] programming.)<br /> <br /> === Cross platform, low level ===<br /> * [[Vulkan (API)|Vulkan]]<br /> <br /> === Vendor specific, high level ===<br /> <br /> * [[Direct3D]] (a subset of [[DirectX]])<br /> * [[Glide API]] for the pioneering [[3DFX]] accelerators<br /> * [[QuickDraw 3D]] developed by Apple Computer starting in 1995, abandoned in 1998<br /> * [[PSGL]] for the [[PlayStation 3]], designed to work in a manner similar to openGL<br /> <br /> === Vendor specific, low level ===<br /> * [[Direct3D 12]] (a subset of [[DirectX]])<br /> * [[Metal (API)|Metal]] developed by Apple.<br /> * [[Mantle (API)|Mantle]] developed by AMD.<br /> * [[LibGCM]] for the [[PlayStation 3]], a lower level API managing command lists directly<br /> * [[LibGXM]] for the [[PlayStation Vita]]<br /> * [[GNM (API)|LibGNM]] for the [[PlayStation 4]]<br /> * [[Redline]] , for the obsolete [[Rendition Verite]] accelerator<br /> * ''Kamui'' for the Dreamcast &lt;ref&gt;{{cite web|title=dreamcast development board|url=https://forum.beyond3d.com/threads/dreamcast-development-board.49555/}}kamui manual,naomi board,DC&lt;/ref&gt;<br /> <br /> {{reflist}}<br /> <br /> <br /> <br /> [[Category:Application programming interfaces]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=The_Whole_Truth_(2016_film)&diff=781597370 The Whole Truth (2016 film) 2017-05-22T05:03:26Z <p>PuercoPop: /* Plot */</p> <hr /> <div>{{Use mdy dates|date=March 2016}}<br /> {{Infobox film<br /> | name = The Whole Truth<br /> | image = TheWholeTruth 2016poster.jpg<br /> | alt = <br /> | caption = Theatrical release poster<br /> | director = [[Courtney Hunt]]<br /> | producer = {{Plainlist|<br /> * [[Likely Story|Anthony Bregman]]<br /> * Elon Dershowitz<br /> * [[Kevin Frakes]]<br /> }}<br /> | writer = [[Nicholas Kazan]]<br /> | starring = {{Plainlist|<br /> * [[Keanu Reeves]]<br /> * [[Renée Zellweger]]<br /> * [[Gugu Mbatha-Raw]]<br /> * [[Gabriel Basso]]<br /> * [[Jim Belushi]]<br /> }}<br /> | music = {{Plainlist|<br /> * {{Interlanguage link multi|Evgueni Galperine|fr}}<br /> * {{Interlanguage link multi|Sacha Galperine|fr}}<br /> }}<br /> | cinematography = Jules O'Loughlin<br /> | editing = Kate Williams<br /> | studio = {{Plainlist|<br /> * [[Atlas Entertainment]]<br /> * [[Likely Story]]<br /> * Merced Media Partners<br /> * PalmStar Media<br /> }}<br /> | distributor = [[Lionsgate Premiere]]<br /> | released = {{Film date|2016|10|21|United States}}<br /> | runtime = 93 minutes&lt;!--Theatrical runtime: 93:31--&gt;&lt;ref&gt;{{cite web | url=http://www.bbfc.co.uk/releases/whole-truth-film | title=''THE WHOLE TRUTH'' (15) | work=[[British Board of Film Classification]] | date=March 24, 2016 | accessdate=March 25, 2016}}&lt;/ref&gt;<br /> | country = United States<br /> | language = English<br /> | budget = <br /> | gross = <br /> }}<br /> '''''The Whole Truth''''' is a 2016 American [[Thriller (genre)|thriller film]] directed by [[Courtney Hunt]] and written by [[Nicholas Kazan]]. The film stars [[Keanu Reeves]], [[Gabriel Basso]], [[Gugu Mbatha-Raw]], [[Renée Zellweger]], and [[Jim Belushi]].<br /> <br /> Filming began on July 7, 2014 in [[New Orleans]].&lt;ref name=TheWrapProdStart&gt;{{cite web|author1=Linda Ge|title=Jim Belushi Joins Keanu Reeves, Renee Zellweger in Courtney Hunt’s ‘The Whole Truth’|url=http://www.thewrap.com/jim-belushi-joins-keanu-reeves-renee-zellweger-in-courtney-hunts-the-whole-truth/|publisher=The Wrap News Inc.|accessdate=3 October 2015|date=2014-07-10|quote=The film began production this week in New Orleans}}&lt;/ref&gt; The film was released on October 21, 2016.<br /> <br /> ==Plot==<br /> Defense attorney Richard Ramsay works on a tough case to defend 17 year-old Mike Lassiter, who is suspected of murdering his wealthy father. Ramsay enlists the help of a young lawyer Janelle, who is determined to find out the truth about what happened. Mike was mostly quiet during the trial, which makes Defense attorney Richard Ramsay's job harder. To make things even more difficult, all the witnesses in the murder case lie about the abusive father, including Mike. Mike claims that his mother was abused by his father. But even so, defense attorney Richard somehow manages to convince the jury that Mike is innocent. In the end, it is reveled that Richard is the killer after having an affair with Mike's mother.<br /> <br /> ==Cast==<br /> * [[Keanu Reeves]] as Richard Ramsay, a defense attorney<br /> * [[Renée Zellweger]] as Loretta Lassiter, Mike's mother<br /> * [[Gugu Mbatha-Raw]] as Janelle Brady, a younger lawyer<br /> * [[Gabriel Basso]] as Mike Lassiter, a seventeen-year-old suspected of murdering his father<br /> * [[Jim Belushi]] as Boone Lassiter, Mike's father&lt;ref name=&quot;Belushi&quot; /&gt;<br /> * Jim Klock as Leblanc, the prosecutor&lt;ref name=&quot;Klock&quot; /&gt;<br /> * [[Sean Bridgers]] as Arthur Westin<br /> * [[Christopher Berry]] as Jack Legrand<br /> <br /> ==Production==<br /> [[Daniel Craig]] was originally set to star since January 2014. In April, just a few days before filming was set to commence, he dropped out of the project for unknown reasons.&lt;ref&gt;{{cite news|title=Daniel Craig Abruptly Drops Out of 'The Whole Truth'|url=http://www.hollywoodreporter.com/news/daniel-craig-abruptly-drops-truth-694642|accessdate=4 October 2014|publisher=deadline|date=4 August 2014}}&lt;/ref&gt; Craig was replaced by [[Keanu Reeves]] in June.<br /> <br /> On July 10, 2014, [[Jim Belushi]] joined the cast of the film to play Mike's father, and Zellweger would play his mother.&lt;ref name=Belushi&gt;{{cite news|last1=Ge|first1=Linda|title=Jim Belushi Joins Keanu Reeves, Renee Zellweger in Courtney Hunt's ‘The Whole Truth’|url=http://www.thewrap.com/jim-belushi-joins-keanu-reeves-renee-zellweger-in-courtney-hunts-the-whole-truth/|accessdate=July 11, 2014|publisher=thewrap.com|date=July 10, 2014}}&lt;/ref&gt; On August 12, Jim Klock was added to the cast to play the prosecutor, who has a rock-solid case against the teen.&lt;ref name=Klock&gt;{{cite news|title=Jim Klock Joins ‘The Whole Truth’|url=http://deadline.com/2014/08/kathryn-morris-the-perfect-guy-jim-klock-the-whole-truth-818175/|accessdate=August 13, 2014|publisher=deadline.com|date=August 12, 2014}}&lt;/ref&gt;<br /> <br /> ===Filming===<br /> [[Principal photography]] of the film began on July 7, 2014, in [[New Orleans]], [[Louisiana]].&lt;ref&gt;{{cite news|title=ON THE SET FOR 7/07/14: Owen Wilson &amp; Kristen Wiff start relativity armored car project, Mel Gibson wraps on ''Blood Father'' |url=http://www.studiosystemnews.com/on-the-set-for-70714-owen-wilson-kristen-wiig-start-relativity-armored-car-project-mel-gibson-wraps-on-blood-father/|accessdate=July 11, 2014|publisher=studiosystemnews.com|date=July 7, 2014}}&lt;/ref&gt;&lt;ref name=&quot;Belushi&quot; /&gt; Previously the filming was slated to take place in [[Boston]].&lt;ref&gt;{{cite news|last1=Banks|first1=Paul|title=New Orleans courts The Whole Truth|url=http://www.kftv.com/news/2014/07/02/New-Orleans-courts-The-Whole-Truth|accessdate=July 14, 2014|publisher=kftv.com|date=July 2, 2014}}&lt;/ref&gt;<br /> <br /> ==References==<br /> {{Reflist}}<br /> <br /> ==External links==<br /> * {{IMDb title|3503406|The Whole Truth}}<br /> * {{Rotten Tomatoes|the_whole_truth_2016|The Whole Truth}}<br /> <br /> {{DEFAULTSORT:Whole Truth, The (2016 film)}}<br /> [[Category:2016 films]]<br /> [[Category:American films]]<br /> [[Category:English-language films]]<br /> [[Category:2010s drama films]]<br /> [[Category:2010s thriller films]]<br /> [[Category:American drama films]]<br /> [[Category:American thriller films]]<br /> [[Category:American thriller drama films]]<br /> [[Category:Courtroom films]]<br /> [[Category:Films directed by Courtney Hunt]]<br /> [[Category:Films set in Louisiana]]<br /> [[Category:Films set in New Orleans]]<br /> [[Category:Films shot in Louisiana]]<br /> [[Category:Films shot in New Orleans]]<br /> [[Category:Atlas Entertainment films]]<br /> [[Category:Lions Gate Entertainment films]]<br /> <br /> {{2010s-thriller-film-stub}}</div> PuercoPop https://en.wikipedia.org/w/index.php?title=The_Whole_Truth_(2016_film)&diff=781597218 The Whole Truth (2016 film) 2017-05-22T05:01:53Z <p>PuercoPop: /* Plot */ remove extra space before punctuation</p> <hr /> <div>{{Use mdy dates|date=March 2016}}<br /> {{Infobox film<br /> | name = The Whole Truth<br /> | image = TheWholeTruth 2016poster.jpg<br /> | alt = <br /> | caption = Theatrical release poster<br /> | director = [[Courtney Hunt]]<br /> | producer = {{Plainlist|<br /> * [[Likely Story|Anthony Bregman]]<br /> * Elon Dershowitz<br /> * [[Kevin Frakes]]<br /> }}<br /> | writer = [[Nicholas Kazan]]<br /> | starring = {{Plainlist|<br /> * [[Keanu Reeves]]<br /> * [[Renée Zellweger]]<br /> * [[Gugu Mbatha-Raw]]<br /> * [[Gabriel Basso]]<br /> * [[Jim Belushi]]<br /> }}<br /> | music = {{Plainlist|<br /> * {{Interlanguage link multi|Evgueni Galperine|fr}}<br /> * {{Interlanguage link multi|Sacha Galperine|fr}}<br /> }}<br /> | cinematography = Jules O'Loughlin<br /> | editing = Kate Williams<br /> | studio = {{Plainlist|<br /> * [[Atlas Entertainment]]<br /> * [[Likely Story]]<br /> * Merced Media Partners<br /> * PalmStar Media<br /> }}<br /> | distributor = [[Lionsgate Premiere]]<br /> | released = {{Film date|2016|10|21|United States}}<br /> | runtime = 93 minutes&lt;!--Theatrical runtime: 93:31--&gt;&lt;ref&gt;{{cite web | url=http://www.bbfc.co.uk/releases/whole-truth-film | title=''THE WHOLE TRUTH'' (15) | work=[[British Board of Film Classification]] | date=March 24, 2016 | accessdate=March 25, 2016}}&lt;/ref&gt;<br /> | country = United States<br /> | language = English<br /> | budget = <br /> | gross = <br /> }}<br /> '''''The Whole Truth''''' is a 2016 American [[Thriller (genre)|thriller film]] directed by [[Courtney Hunt]] and written by [[Nicholas Kazan]]. The film stars [[Keanu Reeves]], [[Gabriel Basso]], [[Gugu Mbatha-Raw]], [[Renée Zellweger]], and [[Jim Belushi]].<br /> <br /> Filming began on July 7, 2014 in [[New Orleans]].&lt;ref name=TheWrapProdStart&gt;{{cite web|author1=Linda Ge|title=Jim Belushi Joins Keanu Reeves, Renee Zellweger in Courtney Hunt’s ‘The Whole Truth’|url=http://www.thewrap.com/jim-belushi-joins-keanu-reeves-renee-zellweger-in-courtney-hunts-the-whole-truth/|publisher=The Wrap News Inc.|accessdate=3 October 2015|date=2014-07-10|quote=The film began production this week in New Orleans}}&lt;/ref&gt; The film was released on October 21, 2016.<br /> <br /> ==Plot==<br /> Defense attorney Richard Ramsay works on a tough case to defend 17 year-old Mike Lassiter, who is suspected of murdering his wealthy father. Ramsay enlists the help of a young lawyer Janelle, who is determined to find out the truth about what happened. Mike was mostly quiet during the trial, which makes Defense attorney Richard Ramsay's job harder. To make things even more difficult, all the witnesses in the murder case lie about the abusive father, including Mike. Mike claims that his mother was abused by his father. But even so, defense attorney Richard somehow manages to convince the jurys to find Mike innocent. In the end, it is reveled that Richard is the killer after having an affair with Mike's mother.<br /> <br /> ==Cast==<br /> * [[Keanu Reeves]] as Richard Ramsay, a defense attorney<br /> * [[Renée Zellweger]] as Loretta Lassiter, Mike's mother<br /> * [[Gugu Mbatha-Raw]] as Janelle Brady, a younger lawyer<br /> * [[Gabriel Basso]] as Mike Lassiter, a seventeen-year-old suspected of murdering his father<br /> * [[Jim Belushi]] as Boone Lassiter, Mike's father&lt;ref name=&quot;Belushi&quot; /&gt;<br /> * Jim Klock as Leblanc, the prosecutor&lt;ref name=&quot;Klock&quot; /&gt;<br /> * [[Sean Bridgers]] as Arthur Westin<br /> * [[Christopher Berry]] as Jack Legrand<br /> <br /> ==Production==<br /> [[Daniel Craig]] was originally set to star since January 2014. In April, just a few days before filming was set to commence, he dropped out of the project for unknown reasons.&lt;ref&gt;{{cite news|title=Daniel Craig Abruptly Drops Out of 'The Whole Truth'|url=http://www.hollywoodreporter.com/news/daniel-craig-abruptly-drops-truth-694642|accessdate=4 October 2014|publisher=deadline|date=4 August 2014}}&lt;/ref&gt; Craig was replaced by [[Keanu Reeves]] in June.<br /> <br /> On July 10, 2014, [[Jim Belushi]] joined the cast of the film to play Mike's father, and Zellweger would play his mother.&lt;ref name=Belushi&gt;{{cite news|last1=Ge|first1=Linda|title=Jim Belushi Joins Keanu Reeves, Renee Zellweger in Courtney Hunt's ‘The Whole Truth’|url=http://www.thewrap.com/jim-belushi-joins-keanu-reeves-renee-zellweger-in-courtney-hunts-the-whole-truth/|accessdate=July 11, 2014|publisher=thewrap.com|date=July 10, 2014}}&lt;/ref&gt; On August 12, Jim Klock was added to the cast to play the prosecutor, who has a rock-solid case against the teen.&lt;ref name=Klock&gt;{{cite news|title=Jim Klock Joins ‘The Whole Truth’|url=http://deadline.com/2014/08/kathryn-morris-the-perfect-guy-jim-klock-the-whole-truth-818175/|accessdate=August 13, 2014|publisher=deadline.com|date=August 12, 2014}}&lt;/ref&gt;<br /> <br /> ===Filming===<br /> [[Principal photography]] of the film began on July 7, 2014, in [[New Orleans]], [[Louisiana]].&lt;ref&gt;{{cite news|title=ON THE SET FOR 7/07/14: Owen Wilson &amp; Kristen Wiff start relativity armored car project, Mel Gibson wraps on ''Blood Father'' |url=http://www.studiosystemnews.com/on-the-set-for-70714-owen-wilson-kristen-wiig-start-relativity-armored-car-project-mel-gibson-wraps-on-blood-father/|accessdate=July 11, 2014|publisher=studiosystemnews.com|date=July 7, 2014}}&lt;/ref&gt;&lt;ref name=&quot;Belushi&quot; /&gt; Previously the filming was slated to take place in [[Boston]].&lt;ref&gt;{{cite news|last1=Banks|first1=Paul|title=New Orleans courts The Whole Truth|url=http://www.kftv.com/news/2014/07/02/New-Orleans-courts-The-Whole-Truth|accessdate=July 14, 2014|publisher=kftv.com|date=July 2, 2014}}&lt;/ref&gt;<br /> <br /> ==References==<br /> {{Reflist}}<br /> <br /> ==External links==<br /> * {{IMDb title|3503406|The Whole Truth}}<br /> * {{Rotten Tomatoes|the_whole_truth_2016|The Whole Truth}}<br /> <br /> {{DEFAULTSORT:Whole Truth, The (2016 film)}}<br /> [[Category:2016 films]]<br /> [[Category:American films]]<br /> [[Category:English-language films]]<br /> [[Category:2010s drama films]]<br /> [[Category:2010s thriller films]]<br /> [[Category:American drama films]]<br /> [[Category:American thriller films]]<br /> [[Category:American thriller drama films]]<br /> [[Category:Courtroom films]]<br /> [[Category:Films directed by Courtney Hunt]]<br /> [[Category:Films set in Louisiana]]<br /> [[Category:Films set in New Orleans]]<br /> [[Category:Films shot in Louisiana]]<br /> [[Category:Films shot in New Orleans]]<br /> [[Category:Atlas Entertainment films]]<br /> [[Category:Lions Gate Entertainment films]]<br /> <br /> {{2010s-thriller-film-stub}}</div> PuercoPop https://en.wikipedia.org/w/index.php?title=StumpWM&diff=762195628 StumpWM 2017-01-27T07:37:46Z <p>PuercoPop: properly reference License. Previously it pointed to ratpoison's license information</p> <hr /> <div>{{Infobox software<br /> | name = StumpWM<br /> | screenshot = [[File:Stumpwm.png|250px]]<br /> | caption = StumpWM, a [[window manager]] in [[Common Lisp]]<br /> | developer = Shawn Betts<br /> | programming_language = [[Common Lisp]]<br /> | operating_system = [[Unix-like]]<br /> | genre = [[Window manager]]<br /> | license = [[GPLv2]]+&lt;ref name=&quot;savannah&quot;&gt;{{Citation | url = https://github.com/stumpwm/stumpwm/blob/master/COPYING | title = StumpWM COPYING file}}.&lt;/ref&gt;<br /> | website = {{url|https://github.com/stumpwm/stumpwm}}<br /> }}<br /> <br /> '''StumpWM''' is a [[tiling window manager]] that was created when developer Shawn Betts found [[ratpoison]] growing increasingly [[software bloat|large]] and &quot;[[Lisp (programming language)|lispy]]&quot;. Intended as a successor to ratpoison, StumpWM is released under the terms of the [[GNU General Public License]], version 2 (GPLv2).&lt;ref name=&quot;savannah&quot;/&gt;<br /> <br /> As explained on the StumpWM wiki, the developers decided to largely re-implement ratpoison in [[Common Lisp]] using [[CLX (Common Lisp)|CLX]]:&lt;ref&gt;{{cite web |url=https://github.com/stumpwm/stumpwm/wiki/Background |title=Background |publisher=The StumpWM wiki |date=2006-10-05 |accessdate=2014-12-01}}&lt;/ref&gt;<br /> <br /> {{quote |StumpWM grew out of the authors' frustration with writing ratpoison in C. Very quickly we realized we were building into ratpoison lispy-[[emacs]] style paradigms. We had a [[Read-eval-print loop|REPL]] hanging off 'C-t&amp;nbsp;:', hooks, and a growing subset of Common Lisp in the implementation... It was clear what we ''really'' wanted was a window manager written in Lisp from the ground up with lots of room for customizing and real-time hacking.}}<br /> <br /> The authors describe StumpWM in the following terms:&lt;ref name=stumparch&gt;{{cite web|url=http://wiki.archlinux.org/index.php/Stumpwm|title=Stumpwm - ArchWiki}}&lt;/ref&gt;<br /> <br /> {{quote|StumpWM attempts to be customizable yet visually minimal. There are no window decorations, no icons, and no buttons. It does have various hooks to attach your personal customizations, and variables to tweak.}}<br /> <br /> ==Lisp and customization==<br /> StumpWM can be run in both [[Steel Bank Common Lisp]] (SBCL) and [[GNU]] [[CLISP]], with SBCL generally being preferred for better performance.&lt;ref name=stumparch/&gt; The [[SLIME]] environment is commonly used for applying real-time updates and customizations to StumpWM. There is also another program called ''stumpish'' (&quot;StumpWM Interactive Shell&quot;) that provides a standard way to interface with the window manager from a terminal.&lt;ref name=stumparch/&gt;<br /> <br /> Window manager customizations are stored in a ''.stumpwmrc'' file that is found in the home directory of each user. This file contains Lisp code for configuring StumpWM.&lt;ref name=stumparch/&gt;<br /> <br /> ==Development==<br /> StumpWM source code is hosted on [[Github]] and the [[version control system]] used is [[Git (software)|Git]].&lt;ref&gt;{{cite web|url=http://www.nongnu.org/stumpwm/download.html|title=The Stump Window Manager: Downloads}}&lt;/ref&gt; A mailing list is also available for StumpWM related issues&lt;ref&gt;{{cite web|url=https://lists.nongnu.org/mailman/listinfo/stumpwm-devel|title=Stump-devel}}&lt;/ref&gt;.<br /> <br /> ==See also==<br /> {{Portal|Free software}}<br /> * [[Sawfish (window manager)|Sawfish]], a [[stacking window manager]] written in Lisp<br /> * [[Greenspun's tenth rule]]<br /> <br /> ==References==<br /> {{reflist}}<br /> <br /> {{X desktop environments and window managers}}<br /> <br /> [[Category:Free X window managers]]<br /> [[Category:Tiling window managers]]<br /> [[Category:X window managers extensible by scripting]]<br /> [[Category:Free software programmed in Lisp]]<br /> [[Category:Common Lisp software]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=StumpWM&diff=762193755 StumpWM 2017-01-27T07:16:06Z <p>PuercoPop: Add reference to the maling list, hosted in Savannah</p> <hr /> <div>{{Infobox software<br /> | name = StumpWM<br /> | screenshot = [[File:Stumpwm.png|250px]]<br /> | caption = StumpWM, a [[window manager]] in [[Common Lisp]]<br /> | developer = Shawn Betts<br /> | programming_language = [[Common Lisp]]<br /> | operating_system = [[Unix-like]]<br /> | genre = [[Window manager]]<br /> | license = [[GPLv2]]+&lt;ref name=&quot;savannah&quot;&gt;{{Citation | url = http://savannah.nongnu.org/projects/ratpoison | contribution = ratpoison summary page | title = Savannah | publisher = The Free Software Foundation}}.&lt;/ref&gt;<br /> | website = {{url|https://github.com/stumpwm/stumpwm}}<br /> }}<br /> <br /> '''StumpWM''' is a [[tiling window manager]] that was created when developer Shawn Betts found [[ratpoison]] growing increasingly [[software bloat|large]] and &quot;[[Lisp (programming language)|lispy]]&quot;. Intended as a successor to ratpoison, StumpWM is released under the terms of the [[GNU General Public License]], version 2 (GPLv2).&lt;ref name=&quot;savannah&quot;/&gt;<br /> <br /> As explained on the StumpWM wiki, the developers decided to largely re-implement ratpoison in [[Common Lisp]] using [[CLX (Common Lisp)|CLX]]:&lt;ref&gt;{{cite web |url=https://github.com/stumpwm/stumpwm/wiki/Background |title=Background |publisher=The StumpWM wiki |date=2006-10-05 |accessdate=2014-12-01}}&lt;/ref&gt;<br /> <br /> {{quote |StumpWM grew out of the authors' frustration with writing ratpoison in C. Very quickly we realized we were building into ratpoison lispy-[[emacs]] style paradigms. We had a [[Read-eval-print loop|REPL]] hanging off 'C-t&amp;nbsp;:', hooks, and a growing subset of Common Lisp in the implementation... It was clear what we ''really'' wanted was a window manager written in Lisp from the ground up with lots of room for customizing and real-time hacking.}}<br /> <br /> The authors describe StumpWM in the following terms:&lt;ref name=stumparch&gt;{{cite web|url=http://wiki.archlinux.org/index.php/Stumpwm|title=Stumpwm - ArchWiki}}&lt;/ref&gt;<br /> <br /> {{quote|StumpWM attempts to be customizable yet visually minimal. There are no window decorations, no icons, and no buttons. It does have various hooks to attach your personal customizations, and variables to tweak.}}<br /> <br /> ==Lisp and customization==<br /> StumpWM can be run in both [[Steel Bank Common Lisp]] (SBCL) and [[GNU]] [[CLISP]], with SBCL generally being preferred for better performance.&lt;ref name=stumparch/&gt; The [[SLIME]] environment is commonly used for applying real-time updates and customizations to StumpWM. There is also another program called ''stumpish'' (&quot;StumpWM Interactive Shell&quot;) that provides a standard way to interface with the window manager from a terminal.&lt;ref name=stumparch/&gt;<br /> <br /> Window manager customizations are stored in a ''.stumpwmrc'' file that is found in the home directory of each user. This file contains Lisp code for configuring StumpWM.&lt;ref name=stumparch/&gt;<br /> <br /> ==Development==<br /> StumpWM source code is hosted on [[Github]] and the [[version control system]] used is [[Git (software)|Git]].&lt;ref&gt;{{cite web|url=http://www.nongnu.org/stumpwm/download.html|title=The Stump Window Manager: Downloads}}&lt;/ref&gt; A mailing list is also available for StumpWM related issues&lt;ref&gt;{{cite web|url=https://lists.nongnu.org/mailman/listinfo/stumpwm-devel|title=Stump-devel}}&lt;/ref&gt;.<br /> <br /> ==See also==<br /> {{Portal|Free software}}<br /> * [[Sawfish (window manager)|Sawfish]], a [[stacking window manager]] written in Lisp<br /> * [[Greenspun's tenth rule]]<br /> <br /> ==References==<br /> {{reflist}}<br /> <br /> {{X desktop environments and window managers}}<br /> <br /> [[Category:Free X window managers]]<br /> [[Category:Tiling window managers]]<br /> [[Category:X window managers extensible by scripting]]<br /> [[Category:Free software programmed in Lisp]]<br /> [[Category:Common Lisp software]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=StumpWM&diff=762193598 StumpWM 2017-01-27T07:13:59Z <p>PuercoPop: /* Development */ The source code is hosted on github</p> <hr /> <div>{{Infobox software<br /> | name = StumpWM<br /> | screenshot = [[File:Stumpwm.png|250px]]<br /> | caption = StumpWM, a [[window manager]] in [[Common Lisp]]<br /> | developer = Shawn Betts<br /> | programming_language = [[Common Lisp]]<br /> | operating_system = [[Unix-like]]<br /> | genre = [[Window manager]]<br /> | license = [[GPLv2]]+&lt;ref name=&quot;savannah&quot;&gt;{{Citation | url = http://savannah.nongnu.org/projects/ratpoison | contribution = ratpoison summary page | title = Savannah | publisher = The Free Software Foundation}}.&lt;/ref&gt;<br /> | website = {{url|https://github.com/stumpwm/stumpwm}}<br /> }}<br /> <br /> '''StumpWM''' is a [[tiling window manager]] that was created when developer Shawn Betts found [[ratpoison]] growing increasingly [[software bloat|large]] and &quot;[[Lisp (programming language)|lispy]]&quot;. Intended as a successor to ratpoison, StumpWM is released under the terms of the [[GNU General Public License]], version 2 (GPLv2).&lt;ref name=&quot;savannah&quot;/&gt;<br /> <br /> As explained on the StumpWM wiki, the developers decided to largely re-implement ratpoison in [[Common Lisp]] using [[CLX (Common Lisp)|CLX]]:&lt;ref&gt;{{cite web |url=https://github.com/stumpwm/stumpwm/wiki/Background |title=Background |publisher=The StumpWM wiki |date=2006-10-05 |accessdate=2014-12-01}}&lt;/ref&gt;<br /> <br /> {{quote |StumpWM grew out of the authors' frustration with writing ratpoison in C. Very quickly we realized we were building into ratpoison lispy-[[emacs]] style paradigms. We had a [[Read-eval-print loop|REPL]] hanging off 'C-t&amp;nbsp;:', hooks, and a growing subset of Common Lisp in the implementation... It was clear what we ''really'' wanted was a window manager written in Lisp from the ground up with lots of room for customizing and real-time hacking.}}<br /> <br /> The authors describe StumpWM in the following terms:&lt;ref name=stumparch&gt;{{cite web|url=http://wiki.archlinux.org/index.php/Stumpwm|title=Stumpwm - ArchWiki}}&lt;/ref&gt;<br /> <br /> {{quote|StumpWM attempts to be customizable yet visually minimal. There are no window decorations, no icons, and no buttons. It does have various hooks to attach your personal customizations, and variables to tweak.}}<br /> <br /> ==Lisp and customization==<br /> StumpWM can be run in both [[Steel Bank Common Lisp]] (SBCL) and [[GNU]] [[CLISP]], with SBCL generally being preferred for better performance.&lt;ref name=stumparch/&gt; The [[SLIME]] environment is commonly used for applying real-time updates and customizations to StumpWM. There is also another program called ''stumpish'' (&quot;StumpWM Interactive Shell&quot;) that provides a standard way to interface with the window manager from a terminal.&lt;ref name=stumparch/&gt;<br /> <br /> Window manager customizations are stored in a ''.stumpwmrc'' file that is found in the home directory of each user. This file contains Lisp code for configuring StumpWM.&lt;ref name=stumparch/&gt;<br /> <br /> ==Development==<br /> StumpWM source code is hosted on [[Github]] and the [[version control system]] used is [[Git (software)|Git]].&lt;ref&gt;{{cite web|url=http://www.nongnu.org/stumpwm/download.html|title=The Stump Window Manager: Downloads}}&lt;/ref&gt; A mailing list is also available for StumpWM related issues.<br /> <br /> ==See also==<br /> {{Portal|Free software}}<br /> * [[Sawfish (window manager)|Sawfish]], a [[stacking window manager]] written in Lisp<br /> * [[Greenspun's tenth rule]]<br /> <br /> ==References==<br /> {{reflist}}<br /> <br /> {{X desktop environments and window managers}}<br /> <br /> [[Category:Free X window managers]]<br /> [[Category:Tiling window managers]]<br /> [[Category:X window managers extensible by scripting]]<br /> [[Category:Free software programmed in Lisp]]<br /> [[Category:Common Lisp software]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Amber_Smalltalk&diff=758327820 Amber Smalltalk 2017-01-04T19:54:49Z <p>PuercoPop: Updated the URL to the new repository</p> <hr /> <div>{{Infobox software<br /> | name = Amber Smalltalk<br /> | logo = File:Amber Smalltalk Logo.svg<br /> | logo caption = An ancient flying insect caught in amber.<br /> | author = Nicolas Petton<br /> | developer = Amber Community<br /> | released = {{Start date and age|2011|09|13}}<br /> | latest release version = 0.15.1<br /> | latest release date = {{Start date and age|2016|02|06}}<br /> | latest preview version = <br /> | latest preview date = &lt;!-- {{Start date and age|YYYY|MM|DD}} --&gt;<br /> | frequently updated = &lt;!-- DO NOT include this parameter unless you know what it does --&gt;<br /> | status = Active<br /> | programming language = [[Smalltalk]], [[JavaScript]]<br /> | operating system = [[Cross-platform]]<br /> | platform = [[Web browser]]<br /> | size = <br /> | language = English<br /> | genre = [[Object-oriented programming]] language, [[Integrated development environment|IDE]]<br /> | license = [[MIT license|MIT]]<br /> | alexa = <br /> | website = {{URL|www.amber-lang.net}}<br /> | repo = {{URL|https://lolg.it/amber/amber}}<br /> | standard = <br /> | AsOf = <br /> }}<br /> '''Amber Smalltalk''', formerly named Jtalk, is an implementation of the [[Smalltalk]]-80 language that runs on the [[JavaScript]] runtime of a [[web browser]]. It is designed to enable client-side development using the Smalltalk programming language.&lt;ref name=&quot;:0&quot;&gt;[https://sites.google.com/a/world.st/worldofst/try/implementations Smalltalk Implementations] (brief comparative summaries describing Smalltalk dialects)&lt;/ref&gt; The programming environment in Amber is named Helios.&lt;ref name=&quot;:1&quot; /&gt;<br /> <br /> == Key features ==<br /> Amber includes an [[integrated development environment]] (IDE) with a [[class browser]], Workspace, transcript, object inspector, and [[debugger]]. Amber is written in itself (is [[self-hosting]]), including the [[compiler]], and compiles into JavaScript, mapping one-to-one with the JavaScript equivalent.&lt;ref&gt;{{Cite web|title= Amber Smalltalk|url= http://amber-lang.net/|website= amber-lang.net|access-date= 2016-01-30|first= Nicolas|last= Petton}}&lt;/ref&gt; This one-to-one mapping with JavaScript differentiates Amber from other Smalltalk variants such as [[Pharo]], [[Seaside (software)|Seaside]], and [[Squeak]].&lt;ref name=&quot;:0&quot;/&gt; Starting the Amber IDE requires [[Node.js]]. Amber doesn't run slowly on a [[bytecode]] [[virtual machine]] due to its convenient mapping to JavaScript, which makes compiled code run fast.<br /> <br /> == History ==<br /> Amber was originally created by Nicolas Petton in 2011.&lt;ref name=&quot;InfoQ-Shuster-2011-08-22&quot;&gt;{{cite news |last= Schuster |first= Werner |date= August 22, 2011 |title= Smalltalk IDEs Come to the Browser: Jtalk, tODE, Lively Kernel 2.0 |url= http://www.infoq.com/news/2011/08/smalltalk-in-browser |accessdate= October 20, 2011}}&lt;/ref&gt; Amber was influenced by an earlier Smalltalk in browser project, named ''Clamato'', created by Avi Bryant.&lt;ref name=&quot;InfoQ-Shuster-2011-08-22&quot; /&gt;&lt;ref name=&quot;Clamato&quot;&gt;{{cite web |title= Clamato |url= http://clamato.net/ }} (Clamato Smalltalk project website)<br /> &lt;/ref&gt; Amber and Clamato both use [[parsing expression grammar]] (PEG) libraries to parse Smalltalk [[source code]]. Amber uses the [[JavaScript]] based PEG.js library&lt;ref name=&quot;PEG.js&quot;&gt;{{cite web |url= http://pegjs.majda.cz/ |title= PEG.js: Parser Generator for JavaScript |last= Majda |first= David |date= 2010–2016 |website= PEG.js.org |publisher= David Majda |access-date= 13 November 2016}}<br /> &lt;/ref&gt;&lt;ref name=&quot;Amber&quot;&gt;{{cite web |url= https://groups.google.com/d/topic/amber-lang/FsuX8geVXpk/discussion |title= Bye, bye Jtalk... Hello Amber! |last= Petton |first= Nicolas |date= 13 September 2011 |website= Google Groups |publisher= Google, Inc. |access-date= 13 November 2016 |quote=... we are now making a first release humbly numbered 0.9. We are also taking the opportunity to pick a slicker name for Jtalk - Amber!}}<br /> &lt;/ref&gt; written by David Majda. Clamato uses PetitParser, a Smalltalk-based library written by Lukas Renggli.&lt;ref name=&quot;InfoQ-Shuster-2011-08-22&quot; /&gt; Clamato and Amber were both influenced by earlier work by [[Dan Ingalls]] in developing the [[Lively Kernel]] implementation of [[Morphic (software)|Morphic]] to run in web browsers via JavaScript.&lt;ref name=&quot;InfoQ-Shuster-2011-08-22&quot; /&gt;&lt;ref name=&quot;InfoQ-Shuster-2011-06-22&quot;&gt;{{cite news |url= http://www.infoq.com/interviews/ingalls-smalltalk |title= Dan Ingalls on the History of Smalltalk and the Lively Kernel |date= June 22, 2010 |accessdate= October 26, 2011 |last= Shuster |first= Werner}}&lt;/ref&gt;<br /> <br /> Starting with version 0.12.0, Amber modules compile to [[asynchronous module definition]] (AMD).&lt;ref&gt;{{Cite web|title= amber-smalltalk/amber|url= https://github.com/amber-smalltalk/amber/wiki/Migration-from-0.11-to-0.12|website= GitHub|access-date= 2016-01-30}}&lt;/ref&gt; Starting with version 0.12.6, the development helper [[command-line interface]] (CLI) tool is extracted to dedicated module &lt;code&gt;amber-cli&lt;/code&gt;, which can be installed from [[npm (software)|npm]]; and setting up the project and its JavaScript ecosystem (bower, npm, grunt) is greatly simplified using this CLI tool by issuing &lt;code&gt;amber init&lt;/code&gt; and answering a few questions.&lt;ref&gt;{{Cite web|title= amber-smalltalk/amber|url= https://github.com/amber-smalltalk/amber|website= GitHub|access-date= 2016-01-30}}&lt;/ref&gt; This makes setting Amber Smalltalk easier for people with little JavaScript experience.&lt;ref&gt;{{Cite web|title= Installing Amber|url= http://docs.amber-lang.net/installing-amber.html|website= docs.amber-lang.net|access-date= 2016-01-30|first= Nicolas|last= Petton}}&lt;/ref&gt;<br /> <br /> == Installing ==<br /> To install Amber, [[Git (software)|Git]] must be installed first, if it is not already. The following commands will install Amber:&lt;ref name=&quot;:1&quot;&gt;{{Cite web|title= A Gentle Introduction to Amber: Engaging in Smalltalk with Her, Reads Like English, and It’s Still Succinct!, &quot;It’s alive! It’s alive!&quot;, The All-seeing Helios, Testing D3|url= https://medium.com/smalltalk-talk/a-gentle-introduction-to-amber-8c532631e9ab#.dcps4c7i2|website= Medium|date= 2015-06-09|access-date= 2016-02-07|first= Richard|last= Eng}}&lt;/ref&gt; &lt;syntaxhighlight lang=&quot;bash&quot;&gt;<br /> # for macOS and Linux, needs the following two commands: <br /> npm config set prefix=~/npm<br /> export PATH=&quot;$PATH:$HOME/npm/bin&quot; # add to .bash_profile or .bashrc<br /> <br /> npm install -g amber-cli grunt-cli grunt-init<br /> &lt;/syntaxhighlight&gt;To create a new project, write:&lt;syntaxhighlight lang=&quot;bash&quot;&gt;<br /> # Create the project structure<br /> mkdir example-project<br /> cd example-project<br /> <br /> # Create and initialize a new Amber project<br /> amber init<br /> &lt;/syntaxhighlight&gt;&quot;amber init&quot; step will lead to some questions about the project. For most of them, a default answer can be set. The next step is to start the server:<br /> &lt;pre&gt;<br /> amber serve<br /> &lt;/pre&gt;<br /> After that, typing &lt;code&gt;http://localhost:4000&lt;/code&gt; in the browser will get to the application. Most browsers will block Helios pop-ups by default, so browser settings may need changing to allow the Helios application popup to appear.<br /> <br /> == Integrating external JavaScript libraries ==<br /> Bower software can be used to access a vast array of JavaScript libraries. A library can be integrated by following only four steps:&lt;ref name=&quot;:1&quot; /&gt;<br /> # Install the library using Bower.<br /> # If 'local.amd.json' files doesn't exist for the Bower package, create a 'libname.amd.json' file in the project root.<br /> # Run 'grunt devel' (or 'grunt deploy' if ready to deploy an application).<br /> # Add 'libname' to the application package's #imports: .<br /> <br /> ==See also==<br /> {{Portal|Free software}}<br /> * [[Pharo]]<br /> * [[Seaside (software)]]<br /> * [[Squeak]]<br /> <br /> ==References==<br /> {{Reflist}}<br /> <br /> ==External links==<br /> * {{Official website|amber-lang.net}}<br /> * [http://nicolas-petton.fr/presentations/esug2011/ Jtalk, the Smalltalk for Web developers] Nicolas Petton, slides presented at ESUG 2011 (European Smalltalk User Group Conference). Edinburgh, Scotland, UK. (August, 2011)<br /> * [https://www.youtube.com/watch?v=07q67r0uBOY Helios tutorial]<br /> <br /> [[Category:Smalltalk programming language family]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Mercenary_(disambiguation)&diff=753354703 Mercenary (disambiguation) 2016-12-06T18:07:01Z <p>PuercoPop: /* Film */ film is no longer upcoming, it has been released</p> <hr /> <div>{{wiktionary|mercenary}}<br /> A '''[[mercenary]]''' is a person primarily concerned with making money at the expense of ethics, most often used to refer to a soldier who fights for hire.<br /> <br /> '''Mercenary''' or '''mercenaries''' may also refer to:<br /> {{TOC right}}<br /> <br /> ==Music==<br /> * [[Mercenary (band)]], a heavy metal band from Denmark<br /> * [[Mercenary (album)|''Mercenary'' (album)]], an album by the band Bolt Thrower<br /> * &quot;Mercenary&quot;, a song by Brave Saint Saturn from the 2008 album [[Anti-Meridian (album)|''Anti-Meridian'']]<br /> * &quot;The Mercenary&quot;, a song by Iron Maiden from the 2000 album, [[Brave New World (Iron Maiden album)|''Brave New World'']]<br /> * &quot;Mercenary&quot;, a song by The Go-Go's from the 1984 album, [[Talk Show (The Go-Go's album)|''Talk Show'']]<br /> * &quot;Mercenaries (Ready For War)&quot;, a song by John Cale from the 1979 album, ''[[Sabotage/Live]]''<br /> * &quot;Mercenary&quot;, a song by Panic! at the Disco from the 2012 album ''[[Music of Batman: Arkham City#Batman: Arkham City – The Album|Batman: Arkham City – The Album]]''<br /> <br /> ==Games==<br /> <br /> ===Computer===<br /> * [[Mercenary (video game)|''Mercenary'' (video game)]], a computer game released by Novagen Software Ltd. in 1985<br /> ** [[Mercenary (video game)#Mercenary III|''Mercenary III: The Dion Crisis'']], a 1992 sequel to the 1985 Novagen game<br /> * ''[[Mercenaries: Playground of Destruction]]'', an Xbox and PlayStation 2 video game released in 2005<br /> **[[Mercenaries (series)]]<br /> ** ''[[Mercenaries 2: World in Flames]]'', the sequel to ''Mercenaries: Playground of Destruction'' in 2008<br /> ** ''[[Mercs Inc]]'', the sequel to ''Mercenaries 2: World in Flames''<br /> * ''[[MechWarrior 2: 31st Century Combat#MechWarrior 2: Mercenaries|MechWarrior 2: Mercenaries]]'', a computer game released by Activision in 1996<br /> ** ''[[MechWarrior 4: Mercenaries]]'', a computer game released by Cyberlore Studios and FASA Studio in 2002<br /> &lt;!-- Above in order of similarity to original title as per Wikipedia:Manual_of_Style_(disambiguation_pages)#Order_of_entries --&gt;<br /> <br /> ===Role-playing===<br /> * ''Traveller Book 4: Mercenary'', the fourth rulebook of the ''[[Traveller (role-playing game)]]''<br /> <br /> ==Film==<br /> * [[Mercenaries (2011 film)|''Mercenaries'' (2011 film)]], a 2011 British film<br /> * [[Mercenaries (2014 film)|''Mercenaries'' (2014 film)]], an American action film<br /> * [[Mercenary (2008 film)|''Mercenary'' (2008 film)]], a 2008 short film starring [[Billy Lush]]<br /> * ''The Mercenaries'', also known as ''[[Dark of the Sun]]'', a 1968 film starring Rod Taylor<br /> * [[The Mercenary (film)|''The Mercenary'' (film)]], a 1968 spaghetti western film<br /> * [[Mercenary (1996 film)]] a 1996 film with John Ritter and Martin Kove<br /> * [[Mercenary (2016 film)|''Mercenary'' (2016 film)]], a 2016 French film<br /> <br /> ==Television==<br /> *[[List of Mission: Impossible episodes#Season 3 .281968.E2.80.931969.29|The Mercenaries (Mission: Impossible)]], a 1968 episode from Season 3 of ''Mission: Impossible''<br /> <br /> ==Sport==<br /> * [[Marburg Mercenaries]], an American football team from Marburg, Germany<br /> <br /> ==Literature==<br /> * ''[[El Mercenario]]'' (English: ''The Mercenary''), an oil-painted fantasy graphic novel by Vicente Segrelles, published from 1980 to 2003<br /> * ''The Mercenaries'', a 1998 novel by [[Ed Greenwood]]<br /> <br /> {{disambiguation}}</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Val%C3%A9rie_Donzelli&diff=746691776 Valérie Donzelli 2016-10-28T23:21:47Z <p>PuercoPop: /* Features */ wikify link to 7 ans entry</p> <hr /> <div>{{Infobox person<br /> | name = Valérie Donzelli<br /> | image = Valérie Donzelli.jpg<br /> | caption = Valérie Donzelli in 2011 at the Cabourg Film Festival<br /> | birth_date = {{Birth date and age|1973|03|02|df=yes}}<br /> | birth_place = [[Épinal]], [[Vosges]], France<br /> | residence =<br /> | nationality = French<br /> | citizenship =<br /> | education =<br /> | alma_mater =<br /> | occupation = Film director, actress, screenwriter<br /> | years_active = 1998–present<br /> | spouse =<br /> | partner =<br /> | children = 2<br /> | awards =<br /> | website = &lt;!-- {{URL|Example.com}}--&gt;<br /> }}<br /> <br /> '''Valérie Donzelli''' (born 2 March 1973) is a French [[actress]], [[filmmaker]] and [[screenwriter]]. She has directed five feature films and two short films since 2008, including the film [[Declaration of War (film)|''Declaration of War'']] (2011).<br /> <br /> == Early life ==<br /> <br /> Valérie Donzelli was born in Épinal ([[France]]). She grew up in [[Créteil]], near [[Paris]]. She moved to [[Lille]] with her family when she was 14 years old before going back to Paris at the age of 19. Before starting to work in the cinema, Donzelli first studied architecture, but abandoned it quickly. She started playing theatre at the municipal conservatory of the [[10th arrondissement of Paris|10th arrondissement]] of Paris, but always kept a bad memory of this period. For a living, she worked at a bakery in Paris. She met [[Jérémie Elkaïm]] at that time, who becomes her partner, both in life and at work, and who encouraged her to quit the conservatory and her job at the bakery to become an actress. They now have two kids; the oldest one, Gabriel, inspired the movie [[Declaration of War (film)|''Declaration of War'']]. They are now separated, but still have a close relationship.&lt;ref&gt;http://www.lesinrocks.com/2011/09/03/cinema/valerie-donzelli-et-jeremie-elkaim-a-lassaut-de-la-vie-1110303/&lt;/ref&gt;&lt;ref&gt;http://www.telerama.fr/cinema/valerie-donzelli-et-jeremy-elkaim-l-epreuve-par-deux,72433.php&lt;/ref&gt;<br /> <br /> == Career ==<br /> <br /> In 2001, Valérie Donzelli was the leading actress in ''Martha Martha'', by [[Sandrine Veysset]], which was presented at [[Directors' Fortnight]]'', ''Le Plus Beau Jour de ma vie'', and also ''[[Entre ses mains]]''. She achieved great success among French public thanks to the French TV show ''[[Clara Sheller]]'' (2005), in which she plays Jeanne, best friend of the main character. <br /> Donzelli's first film, [[:imdbtitle:1483778|''The Queen of Hearts'']] ([[:fr:La Reine des pommes (film)|''La Reine des Pommes'']], 2009), in which she was the leading actress, was more successful than expected. Jérémie Elkaïm is also co-writer. The film was presented at [[Locarno International Film Festival]]. Despite of its low budget, the film can be considered as a success because of its 30 000 spectators.&lt;ref&gt;http://lemondedecess.over-blog.com/article-valerie-donzelli-reine-du-burlesque-54554103.html&lt;/ref&gt;&lt;ref&gt;http://www.lemonde.fr/culture/article/2013/08/22/valerie-donzelli-championne-de-triathlon_3465023_3246.html&lt;/ref&gt; <br /> <br /> In 2011, with the help of her now ex-partner Jérémie Elkaïm, Valérie Donzelli directed her second full-length feature film, [[Declaration of War (film)|''Declaration of War'']]. This movie, presented during the [[2011 Cannes Film Festival|2011 Cannes Festival]], achieves great success, public and critic, in France. It is directly inspired by their private life, relating how their couple fought against their son's cancer when he was 18 months.&lt;ref&gt;http://www.telerama.fr/cinema/valerie-donzelli-et-jeremie-elkaim-du-cote-de-la-vie,68772.php?xtatc=INT-41&lt;/ref&gt; The movie was selected at the [[Academy Award for Best Foreign Language Film]] in 2012, but was not part of the finalist.<br /> <br /> Donzelli directed once again [[Jérémie Elkaïm]] in ''Main dans la main'' (2012), with also [[Valérie Lemercier]] in the leading role.<br /> <br /> Donzelli considers that this is always a politic and engaged gesture to make films as women, and admires Agnès Varda for her work and her status of first women filmmaker into French Cinema.&lt;ref&gt;http://www.lesinrocks.com/2011/09/03/cinema/valerie-donzelli-et-jeremie-elkaim-a-lassaut-de-la-vie-1110303/&lt;/ref&gt;<br /> <br /> Valérie Donzelli is part of the jury during [[Locarno International Film Festival]] in 2013. She presents ''Que d'Amour!'', a TV adaptation from the play ''[[The Game of Love and Chance]]'' (''Le Jeu de l'Amour et du Hasard''), by ''[[Marivaux]]'', with [[Comédie-Française]]' [[Sociétaires of the Comédie-Française|sociétaires]].&lt;ref&gt;http://www.lemonde.fr/culture/article/2013/08/22/valerie-donzelli-championne-de-triathlon_3465023_3246.html&lt;/ref&gt;<br /> <br /> Her 2015 film ''[[Marguerite &amp; Julien]]'' was selected to compete for the [[Palme d'Or]] at the [[2015 Cannes Film Festival]].&lt;ref name=&quot;Cannes&quot;&gt;{{cite web |url=http://www.festival-cannes.com/en/article/61306.html |title=2015 Official Selection |accessdate=16 April 2015 |work=Cannes}}&lt;/ref&gt; She was named as the President of the Jury of the International Critics' Week section of the [[2016 Cannes Film Festival]].&lt;ref name=&quot;SemaineJury&quot;&gt;{{cite web |url=http://www.semainedelacritique.com/EN/jury.php |title=Jury 2016 |accessdate=22 March 2015 |work=Semaine de la Critique de Cannes}}&lt;/ref&gt;<br /> <br /> == Filmography ==<br /> <br /> === Actress ===<br /> <br /> ==== Features ====<br /> <br /> * 2001: ''Martha Martha'' by [[Sandrine Veysset]]: Martha <br /> * 2001: ''Les Âmes câlines'' by Thomas Bardinet: Émilie <br /> * 2003: ''[[Cette femme-là]]'' by Guillaume Nicloux: Claire Atken <br /> * 2003: ''[[Who Killed Bambi? (2003 film)|Who Killed Bambi?]]'' by Gilles Marchand: Nathalie <br /> * 2005: ''Mystification ou l'histoire des portraits'' by Sandrine Rinaldi: Emilie <br /> * 2005: ''Le Plus Beau Jour de ma vie'' by Julie Lipinski: Éléonore <br /> * 2005: ''[[Entre ses mains]]'' by [[Anne Fontaine]]: Valérie <br /> * 2005: ''Voici venu le temps'' by [[Alain Guiraudie]]: Soniéra Noubi-Datch <br /> * 2006: ''L'Intouchable'' by Benoît Jacquot: theatre actress <br /> * 2006: ''L'Homme qui rêvait d'un enfant'' by Delphine Gleize: Suzanne <br /> * 2007: ''Il fait beau dans la plus belle ville du monde'' by Valérie Donzelli <br /> * 2007: [[7 Years (film)|7 ans]] by Jean-Pascal Hattu : Maïté <br /> * 2009: ''The Queen of Hearts'' by Valérie Donzelli: Adèle <br /> * 2011: [[Declaration of War (film)|''Declaration of War'']] by Valérie Donzelli: Juliette <br /> * 2011: ''Belleville Tokyo'' by Élise Girard: Marie Tourelle <br /> * 2011: ''[[Iris in Bloom]]'' by Valérie Mréjen and Bertrand Schefer <br /> * 2011: ''Pourquoi tu pleures?'' by Katia Lewkowicz: Anna <br /> * 2011: ''L'Art de séduire'' by Guy Mazarguil: Estelle <br /> * 2013: ''[[The Big Bad Wolf (2013 Film)|The Big Bad Wolf]]'' by [[Nicolas Charlet]] and [[Bruno Lavaine]] <br /> * 2013: ''[[Longwave (film)|Les Grandes Ondes (à l'ouest)]]'' by Lionel Baier : Julie <br /> * 2013: ''Opium'' by [[Arielle Dombasle]] : Valentine Hugo <br /> * 2014: ''Orage'' by Fabrice Camoin<br /> * 2014: ''[[Saint Laurent (film)|Saint Laurent]]'' by [[Bertrand Bonello]] : Renée<br /> * 2015: ''[[The White Knights]]'' by [[Joachim Lafosse]] : Françoise Dubois<br /> <br /> ==== Short films ====<br /> <br /> * 1998: ''Herbert C. Berliner'' by Marc Gibaja<br /> * 1999: ''Le Spectateur'' by Marc Gibaja : Cynthia<br /> * 2000: ''Demoiselle'' by Valérie Donzelli : Adèle<br /> * 2001: ''Confessions dans un bain'' by Marc Gibaja : Sophie<br /> * 2001: ''Le Chien, le chat et le cibachrome'' by Didier Blasco<br /> * 2003: ''Ni vue, ni connue'' by Dorothée Sebbagh : Alice<br /> * 2003: ''Le Lion volatil'' by [[Agnès Varda]] : La cliente en pleurs<br /> * 2004: ''Frédérique amoureuse'' by Pierre Lacan : Frédérique<br /> * 2004: ''Le Nécrophile'' by Philippe Barassat : La prostituée<br /> * 2005: ''On est mort un million de fois'' by Dorothée Sebbagh : Valentine<br /> * 2006: ''Odile...'' by Bénédicte Delgéhier : Odile<br /> * 2007: ''Abattoir'' by Didier Blasco : Judith<br /> * 2007: ''Il fait beau dans la plus belle ville du monde'' by Valérie Donzelli : Adèle<br /> * 2008: ''C'est pour quand?'' by Katia Lewkowicz : La jeune fille<br /> * 2009: ''Juliette'' by Sylvie Ballyot : Juliette<br /> * 2010: ''Madeleine et le facteur'' by Valérie Donzelli : Madeleine<br /> * 2010: ''Manu'' by [[Jérémie Elkaïm]] : Julie<br /> * 2012: ''Révolution'' by Nadia Jandeau<br /> <br /> ==== Television ====<br /> <br /> * 1999: ''Dossier: disparus'' épisode ''Amanda'' by Frédéric Demont et [[Philippe Lefebvre (film director)|Philippe Lefebvre]]: Amanda/Muriel<br /> * 1999: ''Les Terres froides'' by [[Sébastien Lifshitz]]: Isabelle<br /> * 2002: ''Sous mes yeux'' by Virginie Wagon: Alison<br /> * 2003: ''Motus'' by [[Laurence Ferreira Barbosa]]: La stagiaire d'Antoine<br /> * 2005: ''Le Cocon, débuts à l'hôpital'' by Pascale Dallet: Nathalie<br /> * 2005: ''Clara Sheller'' by Renaud Bertrand: Jeanne<br /> * 2006: ''Mentir un peu'' by Agnès Obadia: Blandine<br /> * 2006: ''Passés troubles'' by Serge Meynard: Sophie Valatier<br /> * 2007: ''Les Camarades'' by François Luciani (minisérie): Julie<br /> * 2008: ''Sa raison d'être'' by Renaud Bertrand: Nathalie<br /> * 2008: [[Mafiosa (TV series)|''Mafiosa, le clan'']] Saison 2 d'[[Éric Rochant|Eric Rochant]]: L'avocate<br /> * 2009: ''La Belle vie'' by Virginie Wagon: Béa<br /> <br /> === Screenwriter ===<br /> * 2000: ''Demoiselle''<br /> * 2007: ''Il fait beau dans la plus belle ville du monde''<br /> * 2009: ''The Queen of Hearts''<br /> * 2010: ''Madeleine et le facteur''<br /> * 2011: [[Declaration of War (film)|''Declaration of War'']]<br /> * 2012: ''La Vie parisienne'' de Vincent Dietschy (originale idea)<br /> * 2012: ''Main dans la main''<br /> <br /> === Film director ===<br /> <br /> ==== Short films ====<br /> <br /> * 2007: ''Il fait beau dans la plus belle ville du monde''<br /> * 2010: ''Madeleine et le facteur''<br /> <br /> ==== Features ====<br /> <br /> * 2009: ''The Queen of Hearts''<br /> * 2010: [[Declaration of War (film)|''Declaration of War'']]<br /> * 2012: ''Main dans la main''<br /> * 2013: ''Que d'amour''<br /> * 2015: ''[[Marguerite &amp; Julien]]''<br /> <br /> ==== Television ====<br /> <br /> * 2013: ''Que d'amour!'' Adaptation from ''[[The Game of Love and Chance]]'', by ''[[Marivaux]]''&lt;ref&gt;http://www.lemonde.fr/culture/article/2013/08/22/valerie-donzelli-championne-de-triathlon_3465023_3246.html&lt;/ref&gt;<br /> <br /> == Awards and nominations ==<br /> * 2010: Public Prize at the [[Angers European First Film Festival]] for ''The Queen of Hearts''<br /> * 2011: Valois d’Or at Festival du film francophone d’Angoulême for '[[Declaration of War (film)|'Declaration of War'']]<br /> * 2012: Grand Prix at Cabourg Film Festival for [[Declaration of War (film)|''Declaration of War'']]<br /> * 2012: Jury Prize, Public Prize, and Bloggers Prix at the Festival Paris Cinéma for '[[Declaration of War (film)|'Declaration of War'']] &lt;ref&gt;http://www.lexpress.fr/actualites/1/culture/la-guerre-est-declaree-de-valerie-donzelli-triomphe-au-festival-de-paris_1011690.html&lt;/ref&gt;<br /> * 2012: [http://www.etoilesdorducinema.fr/palm-treize.html Étoile d'or du meilleur scénario] for [[Declaration of War (film)|''Declaration of War'']] <br /> * Nomination for [[César Award for Best Film|Best film]] for [[Declaration of War (film)|''Declaration of War'']], [[37th César Awards|Cesar Awards 2012]] <br /> * Nomination for [[César Award for Best Director|Best Director]] for [[Declaration of War (film)|''Declaration of War'']], [[37th César Awards|Cesar Awards 2012]] <br /> * Nomination for [[César Award for Best Actress|Best Actress]] for [[Declaration of War (film)|''Declaration of War'']], [[37th César Awards|Cesar Awards 2012]] <br /> * Nomination for [[César Award for Best Writing|Best Original Writing]] for [[Declaration of War (film)|''Declaration of War'']], [[37th César Awards|Cesar Awards 2012]]<br /> <br /> == References ==<br /> {{reflist}}<br /> <br /> == Further reading ==<br /> * [http://www.toutelatele.com/valerie-donzelli-se-tourne-vers-la-television-pour-son-prochain-film-49236 Valerie Donzelli se tourne vers la télévision pour son prochain film]<br /> * &quot;Un film dansé pour Valérie Donzelli&quot;, ''Cahiers du cinéma'', no 670, septembre 2011, p.&amp;nbsp;62<br /> * La Guerre est déclarée [archive], sur [http://www.jpbox-office.com/fichfilm.php?id=12348 jpbox-office.com] (consulted March 16, 2014)<br /> <br /> == External links ==<br /> {{commons category}}<br /> * {{IMDb name|0233123}}<br /> * Valérie Donzelli via [http://www.allocine.fr/personne/fichepersonne_gen_cpersonne=62868.html Allociné]<br /> <br /> {{Valérie Donzelli}}<br /> <br /> {{Authority control}}<br /> {{DEFAULTSORT:Donzelli, Valerie}}<br /> [[Category:1973 births]]<br /> [[Category:20th-century French actresses]]<br /> [[Category:21st-century French actresses]]<br /> [[Category:French film actresses]]<br /> [[Category:French film directors]]<br /> [[Category:French screenwriters]]<br /> [[Category:French television actresses]]<br /> [[Category:French women film directors]]<br /> [[Category:French women writers]]<br /> [[Category:Living people]]<br /> [[Category:French people of Italian descent]]<br /> [[Category:People from Épinal]]<br /> [[Category:French women screenwriters]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=7_Years_(film)&diff=746691510 7 Years (film) 2016-10-28T23:19:23Z <p>PuercoPop: /* Cast */ wiklfy link to Valérie Donzelli's entry</p> <hr /> <div>{{Infobox film<br /> | name = 7 Years<br /> | image = 7 Years Poster.jpg<br /> | caption = Theatrical Release Poster<br /> | director = Jean-Pascal Hattu<br /> | producer = Justin Taurand<br /> | writer = Jean-Pascal Hattu<br /> | screenplay = Jean-Pascal Hattu&lt;br&gt;Gilles Taurand&lt;br&gt;Guillaume Daporta <br /> | starring = [[Valérie Donzelli]]&lt;br&gt;Cyril Troley&lt;br&gt;[[Bruno Todeschini]]<br /> | music = Franck Delabre<br /> | cinematography = Pascal Poucet<br /> | editing = Anne Klotz<br /> | studio = [[Les Films du Bélier]]<br /> | distributor = Pyramide Distribution<br /> | released = {{Film date|2006|09|03|Venice Film Festival|2007|02|21|France}}<br /> | runtime = 86 minutes<br /> | country = France<br /> | language = French<br /> }}<br /> '''''7 Years''''' ({{lang-fr|7 ans}}) is a 2006 French drama film starring [[Bruno Todeschini]], [[Valerie Donzelli]] and [[Cyril Troley]]. It is written and directed by [[Jean-Pascal Hattu]]. The film explores the sexual tension between a wife and a husband serving a long jail sentence. Valerie Donzelli's performance in the film won her awards at the [[Seattle International Film Festival]]&lt;ref&gt;Seattle International Film Festival [http://www.siff.net/press/detail.aspx?NID=123&amp;year=2007 2007 Winners List] Retrieved on 2011-02-25.&lt;/ref&gt; and at the [[Valencia Festival of Mediterranean Cinema]][http://www.mostravalencia.com/inicio.html]{{es icon}}.&lt;ref&gt;Awards for 2007 [http://www.imdb.com/event/ev0000674/2007 ''[[IMDB]]'' ]Retrieved on 2011-02-25.&lt;/ref&gt;<br /> <br /> ==Plot==<br /> Maïté (Valerie Donzelli) is the devoted young wife of Vincent (Bruno Todeschini), who is serving 7 years in prison for an unspecified crime. She brings Vincent clean clothes, and puts money in his canteen account. She and Vincent obviously still need each other sexually, and it is difficult for both of them to be separated.<br /> <br /> One day Maïté is approached by a young man named Jean (Cyril Troley), who says his brother is also incarcerated for 7 years. They quickly embark on a sexual relationship, but Maïté is cold and unresponsive.<br /> <br /> She has a good relationship with her neighbour, Djamila, who has a small son, Julien. Maïté looks after him frequently whilst Djamila is at work, and the two are close. Eventually Maïté discovers that Jean is in fact a guard at her husband's prison. The affair takes a turn when Vincent finds out; instead of stopping them, he insists Jean tape their meetings. He advises Jean how to move Maïté emotionally and sexually, however, Jean tells him &quot;she is empty&quot;.<br /> <br /> As Jean falls in love with Maïté, she tries to distance herself from both of them. However, as Jean leaves to take up a post in Lille, Vincent attempts suicide and in final scene she is seen walking confidently into the prison to visit him once again.<br /> <br /> ==Cast==<br /> * [[Valérie Donzelli|Valérie Donzelli]] as Maïté<br /> * Cyril Troley as Jean<br /> * [[Bruno Todeschini]] as Vincent<br /> * Pablo de la Torre as Julien<br /> * Nadia Kaci as Djamila<br /> <br /> ==Awards==<br /> * New Director's Showcase Special Jury Prize - Seattle International Film Festival 2007 - Won<br /> * Best Actress - Valencia Festival of Mediterranean Cinema 2007 - Won<br /> <br /> == References ==<br /> {{Reflist}}<br /> <br /> == External links ==<br /> * {{IMDb title|0808462|7 Years}}<br /> <br /> [[Category:French films]]<br /> [[Category:2006 films]]<br /> <br /> <br /> {{2000s-France-film-stub}}</div> PuercoPop https://en.wikipedia.org/w/index.php?title=The_Blair_Witch_Project&diff=740473392 The Blair Witch Project 2016-09-21T08:20:41Z <p>PuercoPop: Undid revision 740472064 by 1.129.96.187 (talk)</p> <hr /> <div>{{pp-move-indef}}<br /> {{Use mdy dates|date=July 2016}}<br /> {{Infobox film<br /> | name = The Blair Witch Project<br /> | image = Blair Witch Project.jpg<br /> | alt = <br /> | caption = Theatrical release poster<br /> | directors = {{Plainlist|<br /> * [[Daniel Myrick]]<br /> * [[Eduardo Sánchez (director)|Eduardo Sánchez]]<br /> }}<br /> | producers = {{Plainlist|<br /> * Robin Cowie<br /> * [[Gregg Hale (producer)|Gregg Hale]]<br /> }}<br /> | writer = {{Plainlist|<br /> * Jacob Cruse<br /> * Eduardo Sánchez<br /> }}<br /> | starring = {{Plainlist|<br /> * [[Heather Donahue]]<br /> * [[Michael C. Williams]]<br /> * [[Joshua Leonard]]<br /> }}<br /> | music = Antonio Cora<br /> | cinematography = [[Neal Fredericks]]<br /> | editing = {{Plainlist|<br /> * Daniel Myrick<br /> * Eduardo Sánchez<br /> }}<br /> | studio = [[Haxan Films]]<br /> | distributor = [[Artisan Entertainment]]<br /> | released = {{Film date|1999|01|25|[[Sundance Film Festival|Sundance]]|1999|07|14|United States}}<br /> | runtime = 81 minutes&lt;!--Theatrical runtime: 80:57--&gt;&lt;ref&gt;{{cite web | url=http://www.bbfc.co.uk/releases/blair-witch-project-1999-1 | title=''The Blair Witch Project'' (15) | work=[[British Board of Film Classification]] | date=August 4, 1999 | accessdate=July 28, 2016}}&lt;/ref&gt;<br /> | country = United States<br /> | language = English<br /> | budget = $60,000&lt;ref name=&quot;BOM&quot; /&gt;<br /> | gross = $248.6 million&lt;ref name=&quot;BOM&quot;&gt;{{cite web|accessdate=April 4, 2013|url=http://boxofficemojo.com/movies/?id=blairwitchproject.htm|title=The Blair Witch Project|publisher=Box Office Mojo}}&lt;/ref&gt;<br /> }}<br /> '''''The Blair Witch Project''''' is a 1999 American [[Found footage (pseudo-documentary)|found footage]] [[psychological horror]] [[film]] written, directed and edited by [[Daniel Myrick]] and [[Eduardo Sánchez (director)|Eduardo Sánchez]]. The film tells the fictional story of three student filmmakers ([[Heather Donahue]], [[Michael C. Williams]] and [[Joshua Leonard]]) who hike in the Black Hills near [[Burkittsville, Maryland]] in 1994 to film a documentary about a local legend known as the Blair Witch. The three disappeared, but their video and sound equipment (along with most of the footage they shot) was discovered a year later; this &quot;[[Found footage (pseudo-documentary)|recovered footage]]&quot; is the film the viewer is watching.&lt;ref&gt;{{cite web|url=http://www.dreadcentral.com/news/34337/editorial-paranormal-activity-shadows-the-blair-witch|title=Editorial: Paranormal Activity Shadows The Blair Witch|publisher=DreadCentral}}&lt;/ref&gt;<br /> <br /> While the film received unexpected acclaim from critics, audience reception was polarized.&lt;ref name=Reception&gt;{{cite web|accessdate=August 25, 2016|url=http://www.technobuffalo.com/2016/07/23/blair-witch-2016-official/|title=The Blair Witch Project is getting a proper sequel|publisher=TechnoBuffalo}}&lt;/ref&gt; It became a resounding box office success&amp;ndash;grossing over [[United States dollar|US$]]248 million worldwide,&lt;ref&gt;{{cite web | last = | first = | title = The Blair Witch Project | work = Box Office Mojo.com | date = 2006-01-01| url = http://boxofficemojo.com/movies/?id=blairwitchproject.htm| accessdate = 2006-07-28 }}&lt;/ref&gt; making it one of the most successful [[independent film]]s of all time. The DVD was released on October 26, 1999 and, in 2010, a [[Blu-ray Disc|Blu-ray]] edition was released.<br /> <br /> A [[sequel]] was released on October 27, 2000 titled ''[[Book of Shadows: Blair Witch 2]]''. Another sequel was planned for the following year, but did not materialize. On September 2, 2009, it was announced that Sánchez and Myrick were pitching the third film.&lt;ref&gt;{{cite news| url=http://news.bbc.co.uk/1/hi/entertainment/8187275.stm | work=BBC News | title=The legend of the Witch lives on | date=2009-08-11 | accessdate=2010-05-25 | first=Kev | last=Geoghegan}}&lt;/ref&gt; A [[Blair Witch (video games)|trilogy of video games]] based on the films was released in 2000. The [[Blair Witch|''Blair Witch'' franchise]] has since expanded to include various novels, dossiers, comic books and additional merchandise.<br /> <br /> On July 22, 2016, an official trailer for a sequel to the film, directed by [[Adam Wingard]] and entitled ''[[Blair Witch (film)|Blair Witch]]'', was released at [[San Diego Comic-Con International|San Diego Comic-Con]]. The film, produced by [[Lionsgate Films|Lionsgate]], was released on September 16, 2016.&lt;ref name=&quot;latimes.com&quot;&gt;{{cite web|last1=Woerner|first1=Meredith|title='Blair Witch' sequel surprises Comic-Con with a secret screening and trailer|url=http://www.latimes.com/entertainment/la-et-hc-comic-con-updates-blair-witch-sequel-surprises-1469247259-htmlstory.html|website=The Los Angeles Times|accessdate=23 July 2016}}&lt;/ref&gt; ''Blair Witch'' is a direct sequel to ''The Blair Witch Project'', and does not acknowledge the events of ''Book of Shadows: Blair Witch 2''. However, Wingard has said that although ''Blair Witch'' does not reference any of the events that transpired in ''Book of Shadows: Blair Witch 2'', the film does not necessarily discredit the existence of ''Book of Shadows: Blair Witch 2''.&lt;ref name=&quot;cinemablend.com&quot;&gt;[http://www.cinemablend.com/news/1556209/]&lt;/ref&gt;<br /> <br /> ==Fictional legend==<br /> The backstory for the movie is a legend fabricated by Sánchez and Myrick which is detailed in ''The Curse of the Blair Witch'', a [[mockumentary]] broadcast on the [[SciFi Channel]] in 1999 prior to the release of ''The Blair Witch Project''.&lt;ref name=curseoftheblairwitch&gt;{{cite web|title=Curse of the Blair witch|url=http://www.ew.com/article/1999/10/29/curse-blair-witch|publisher=Entertainment Weekly|accessdate=4 August 2016}}&lt;/ref&gt; Sánchez and Myrick also maintain a website which adds further details to the legend.&lt;ref name=&quot;Curse of the Blair Witch&quot;&gt;{{cite web |url=http://www.blairwitch.com/mythology.html |title=The Blair Witch |accessdate=4 August 2016 |archiveurl=https://web.archive.org/web/20070707140445/http://www.blairwitch.com/mythology.html |archivedate=July 7, 2007 }}&lt;/ref&gt;<br /> <br /> The legend describes the murders and disappearances of some of the residents of Blair, Maryland (a fictitious town on the site of [[Burkittsville, Maryland]]) from the [[18th Century|18th]] to [[20th Century|20th centuries]]. Residents blamed these occurrences on the ghost of Elly Kedward, a Blair resident accused of practicing witchcraft in 1785 and sentenced to death by [[hypothermia|exposure]]. ''The Curse of the Blair Witch'' presents the legend as real, complete with manufactured newspaper articles, [[newsreels]], television news reports, and staged interviews.<br /> &lt;ref name=curseoftheblairwitch /&gt;<br /> <br /> ==Plot==<br /> In October 1994, film students [[Heather Donahue]], [[Michael C. Williams]], and [[Joshua Leonard]] set out to produce a documentary about the fabled Blair Witch. They travel to Burkittsville, Maryland, formerly Blair, and interview residents about the legend. Locals tell them of Rustin Parr, a [[hermit]] who lived in the woods, who kidnapped eight children in the 1940s. He would take the children down to his basement in pairs and make one of them stand in the corner while he killed the other one. After turning himself in to the police, Parr claimed that the spirit of Elly Kedward, a woman executed for witchcraft in the 18th century, had forced him to commit the murders. The students then interview Mary Brown, a Burkittsville resident deemed insane by the public. She claims to have encountered the Blair Witch in person, describing her as a hairy half-human, half-animal beast.<br /> <br /> On their second day, the students explore the woods in north Burkittsville to research the legend. Along the way, they meet two fishermen, one of whom warns them that the woods are haunted and recalls that in 1888, a young girl named Robin Weaver went missing, and when she returned three days later, she talked about &quot;an old woman whose feet never touched the ground.&quot; His companion is, however, skeptical of the story. The students then hike to Coffin Rock, where five men were found [[Human sacrifice#Ritual murder|ritualistically murdered]] in the 19th century, their bodies later disappearing. The group then camps for the night.<br /> <br /> The next day they move deeper into the woods despite being uncertain of their location. They eventually locate what appears to be an old cemetery with seven small [[cairn]]s. They set up camp nearby and then return to the cemetery after dark. Josh accidentally disturbs a cairn and Heather hastily repairs it. Later that night, they hear the sound of twigs snapping from all directions but assume the noises are from animals or locals.<br /> <br /> On day three, they attempt to hike back to the car, but are unable to find it before dark, much to their frustrations, and again set camp. That night, they again hear twigs snapping but fail to find the source of the noises.<br /> <br /> On the fourth day they find three cairns have been built around their tent during the night, which unnerves them. As they continue, Heather realizes her map is missing, and Mike later reveals he kicked it into a creek the previous day out of frustration, which prompts Heather and Josh to attack him in a rage. They realize they are now lost and decide simply to head south. They eventually reach a section where they discover a multitude of humanoid stick figures suspended from trees, which further unnerves them. That night they hear sounds again, but this time includes the sounds of children laughing among other strange noises. When an unknown force shakes the tent, they flee in a panic and hide in the woods until dawn.<br /> <br /> Upon returning to their tent, they find that their possessions have been rifled through, and Josh's equipment is covered with a translucent slime. As they continue, they begin to show signs of mentally giving up, and it is made worse when they come across a log on a river identical to one they crossed earlier. They realize they have walked in a circle, despite having traveled south all day, and once again make camp, completely demoralized at having wasted an entire day. Josh suffers a mental breakdown while holding the camera, taunting Heather for their circumstances and her constant recording of the events.<br /> <br /> On the sixth morning, Heather and Mike awaken to find that Josh has disappeared. After trying in vain to find him, they slowly move on. That night, they hear Josh's agonized screams in the darkness but are unable to locate him.<br /> <br /> On their final day in the woods, Heather discovers a bundle of sticks and fabric outside her tent. As she searches through it she finds blood-soaked scraps of Josh's shirt as well as teeth, hair, and an unknown pink object. Although distraught by the discovery, she chooses not to tell Mike. That night, Heather records herself apologizing to her family, as well as to the families of Mike and Josh, taking full responsibility for their current predicament and stating her belief that something terrible is hunting them, and will ultimately take them.<br /> <br /> Afterward, they again hear Josh's agonized cries for help and follow them to a derelict, abandoned house containing runic symbols and children's bloody hand-prints on the walls. Mike races upstairs in an attempt to find Josh while Heather follows. Both are still filming all their actions. Mike then says he hears Josh in the basement. He runs downstairs while a hysterical Heather struggles to keep up. Upon reaching the basement, something attacks Mike, and causes him to drop the camera and go silent. Heather enters the basement screaming. Her camera captures Mike facing a corner. Something then attacks Heather, causing her to drop her camera and go silent as well. The footage then ends.<br /> <br /> ==Cast==<br /> *[[Heather Donahue]] as a fictionalized version of herself.<br /> *[[Michael C. Williams]] as a fictionalized version of himself.<br /> *[[Joshua Leonard]] as a fictionalized version of himself.<br /> <br /> ==Production==<br /> <br /> ===Development===<br /> ''The Blair Witch Project'' was developed during 1993&lt;ref name = &quot;onion&quot;/&gt; by the filmmakers. Myrick and Sanchez came across the idea for the film after realizing that they found [[documentaries]] on paranormal phenomena scarier than traditional horror films. The two decided to create a film that combined the styles of both.&lt;ref name=&quot;Stilllegend&quot;&gt;{{cite web|last1=Bowies|first1=Scott|title='Blair Witch Project': Still a legend 15 years later|url=http://www.usatoday.com/story/life/movies/2014/07/13/blair-witch-project-15th-anniversary-classic-legend/10707409/|website=USA Today|accessdate=22 February 2016}}&lt;/ref&gt; The script began with a 35-page outline, with the dialogue to be improvised.&lt;ref name = &quot;onion&quot;/&gt; Accordingly, the directors advertised in ''[[Backstage (magazine)|Backstage]]'' magazine for actors with strong improvisational abilities.&lt;ref name = &quot;real&quot;/&gt; There was a very informal improvisational audition process to narrow the pool of 2,000 actors.&lt;ref name=&quot;witch&quot;/&gt;&lt;ref name = &quot;salon&quot;/&gt; In developing the mythology behind the movie, the filmmakers used many inspirations. Several character names are near-anagrams; Elly Kedward (The Blair Witch) is [[Edward Kelley]], a 16th-century mystic. Rustin Parr, the fictional 1940s child-murderer, began as an anagram for [[Rasputin]].&lt;ref&gt;{{cite web | last =Blake | first = Scott | title = An Interview With The Burkittsville 7's Ben Rock | work = IGN.com | date = Jul 17, 2007| url = http://filmforce.ign.com/articles/036/036443p1.html/| accessdate = July 30, 2007 }}&lt;/ref&gt; In talks with investors, they presented an eight-minute documentary along with newspapers and news footage.&lt;ref name=&quot;stone&quot;&gt;{{cite web | last = Conroy | first =Tom| title =The Do-It-Yourself Witch Hunt | work = Rolling Stone| date =July 14, 1999| url = http://www.rollingstone.com/news/story/5924486/the_doityourself_witch_hunt| accessdate = August 2, 2006 | archiveurl = https://web.archive.org/web/20071001001407/http://www.rollingstone.com/news/story/5924486/the_doityourself_witch_hunt | archivedate = October 1, 2007 }}&lt;/ref&gt; This documentary, originally called ''The Blair Witch Project: The Story of Black Hills Disappearances'' was produced by Haxan Films.<br /> [[File:Burkitcem.jpg|thumb|The cemetery as part of the Blair Witch story]]<br /> Filming began in October 1997 and lasted eight days.&lt;ref name = &quot;real&quot;/&gt;&lt;ref&gt;{{cite news | last =Corliss | first = Richard | title = Blair Witch Craft | work = Time Magazine | date = August 16, 1999| url = http://www.time.com/time/archive/preview/0,10987,991741,00.html| accessdate = 2006-07-30 }}&lt;/ref&gt; Most of the movie was filmed in [[Seneca Creek State Park]] in [[Montgomery County, Maryland]], although a few scenes were filmed in the real town of [[Burkittsville]].&lt;ref name=&quot;blairwitch&quot;&gt;{{cite web|last=Kaufman |first=Anthony |title=Season of the Witch |work=Village Voice |date=July 14, 1999 |url=http://www.villagevoice.com/news/9928,kaufman,7024,1.html |accessdate=September 26, 2006 |deadurl=yes |archiveurl=https://web.archive.org/web/20070303170002/http://www.villagevoice.com/news/9928,kaufman,7024,1.html |archivedate=March 3, 2007 }}&lt;/ref&gt; Some of the townspeople interviewed in the film were not actors, and some were planted actors, unknown to the main cast. The final scenes were filmed at the historic [[Griggs House]] in [[Granite, Maryland]]. Donahue had never operated a camera before and spent two days in a &quot;crash course.&quot; Donahue said she modeled her character after a director she once worked with, citing the character's self assuredness when everything went as planned, and confusion during crisis.&lt;ref&gt;{{cite web|last=Lim |first=Dennis |title=Heather Donahue Casts A Spell |work=The Village Voice |date=July 14, 1999 |url=http://www.villagevoice.com/news/9928,lim,7025,1.html |accessdate=September 26, 2007 |deadurl=yes |archiveurl=https://web.archive.org/web/20071204214220/http://www.villagevoice.com/news/9928,lim,7025,1.html |archivedate=December 4, 2007 }}&lt;/ref&gt;<br /> <br /> ===Casting===<br /> According to Heather Donahue, auditions for the film were held at Musical Theater Works in [[New York City]], and ads were placed in the weekly ''Backstage'' for an open audition.&lt;ref name=&quot;craig&quot;&gt;Donahue, Heater. Interview with Craig Kilborn. CBS Networks. August 1999.&lt;/ref&gt; The advertisement noted an &quot;entirely improvised feature film&quot; shot in a &quot;wooded location.&quot;&lt;ref name=&quot;craig&quot;/&gt; Donahue described the audition as Myrick and Sanchez posing her the question: &quot;You've served seven years of a nine year sentence. Why should we let you out on parole?&quot; to which Donahue was required to [[improvise]] a response.&lt;ref name=&quot;craig&quot;/&gt;<br /> <br /> Joshua Leonard, also in response to audition calls through ''Back Stage'', claimed he was cast in the film due to his knowledge of how to run a camera, as there was not an omniscient camera filming the scenes.&lt;ref&gt;{{cite web|url=http://www.backstage.com/news/spotlight/how-joshua-leonard-fell-love-moviemaking/|work=Backstage|title=How Joshua Leonard Fell In Love With Moviemaking|author=Loewenstein, Melinda|date=March 16, 2013|accessdate=October 31, 2015}}&lt;/ref&gt;<br /> <br /> ===Filming===<br /> During filming, the actors were given clues as to their next location through messages given in milk crates found with [[Global Positioning Satellite]] systems. They were given individual instructions that they would use to help improvise the action of the day.&lt;ref name=&quot;real&quot;&gt;{{cite web| author=Staff| title = Heather Donohue &amp;ndash; Blair Witch Project| work = KAOS 2000 Magazine|date = January 1, 1999| url = http://www.kaos2000.net/interviews/heatherdonohue/heatherdonohue.html| accessdate = July 30, 2006 }}&lt;/ref&gt; Teeth were obtained from a Maryland dentist for use as human remains in the movie.&lt;ref name = &quot;real&quot;/&gt; Influenced by producer Gregg Hale's memories of his military training, in which &quot;enemy soldiers&quot; would hunt a trainee through wild terrain for three days, the directors moved the characters a long way during the day, harassing them by night and depriving them of food.&lt;ref name = &quot;stone&quot;/&gt;<br /> <br /> Almost 19 hours of usable footage was recorded which had to be edited down to 90 minutes.&lt;ref name=&quot;salon&quot;&gt;{{cite web | last =Mannes | first = Brett | title = Something wicked | work = Salon.com | date = July 13, 1999| url = http://www.salon.com/ent/movies/int/1999/07/13/witch_actor/| accessdate = July 29, 2006 }}&lt;/ref&gt; The editing in post production took more than eight months. Originally it was hoped that the movie would make it on to cable television, and the filmmakers did not anticipate wide release.&lt;ref name = &quot;onion&quot;/&gt; The initial investment by the three filmmakers was about US$35,000. Artisan acquired the film for US$1.1 million but spent US$25 million to market it.{{citation needed|date=March 2016}} The actors signed a &quot;small&quot; agreement to receive some of the profits from the film's release.&lt;ref name=&quot;real&quot;/&gt;<br /> <br /> A list of production budget figures have circulated over the years, appearing as low as $20,000. In an interview with ''[[Entertainment Weekly]]'', Sánchez revealed that when principal photography first wrapped, approximately $20,000 to $25,000 had been spent.&lt;ref&gt;{{cite web|url=http://popwatch.ew.com/2009/07/09/blair-witch|title='The Blair Witch Project' 10 years later: Catching up with the directors of the horror sensation|author=John Young|publisher=Entertainment Weekly}}&lt;/ref&gt; Other figures list a final budget ranging between $500,000 and $750,000.&lt;ref name=&quot;Q&amp;A&quot;&gt;{{cite web|author=John Young|url=http://popwatch.ew.com/2009/07/09/blair-witch/|title='The Blair Witch Project' 10 years later: Catching up with the directors of the horror sensation|work=Entertainment Weekly|date=July 9, 2009|accessdate=July 10, 2009}}&lt;/ref&gt;<br /> <br /> ==Promotion==<br /> <br /> ''The Blair Witch Project'' is thought to be the first widely released movie marketed primarily by internet. The movie's official website featured fake police reports and &quot;newsreel-style&quot; interviews. These augmented the movie's found footage device to spark debates across the internet over whether the movie was a real-life documentary or a work of fiction.&lt;ref&gt;{{cite web | last = Weinraub | first = Bernard| title = Blair Witch Proclaimed First Internet Movie | work = Chicago Tribune| date = August 17, 1999| url = http://articles.chicagotribune.com/1999-08-17/features/9908170065_1_mark-curcio-amir-malin-artisan-entertainment| accessdate =January 27, 2012 }}&lt;/ref&gt;&lt;ref&gt;{{cite web | last = Weinraub | first = Bernard| title = Was The Blair Witch Project The Last Great Horror Film? | work = BBC News| date = October 30, 2015| url = http://www.bbc.com/culture/story/20151030-was-the-blair-witch-project-the-last-great-horror-film| accessdate =October 31, 2015 }}&lt;/ref&gt; During screenings of the movie, the filmmakers made advertising efforts to promulgate the events in the film as factual, including the distribution of flyers at festivals such as the [[Sundance Film Festival]], asking viewers to come forward with any information about the &quot;missing&quot; students.&lt;ref&gt;{{cite web|url=http://www.imdb.com/title/tt0185937/trivia|title=IMDb: The Blair Witch Project}}&lt;/ref&gt;&lt;ref&gt;{{cite web|url=http://www.nextmovie.com/blog/best-movie-publicity-stunts/|title=Editorial: The 12 Ballsiest Movie Publicity Stunts}}&lt;/ref&gt;&lt;ref name=&quot;mwpdigitalmedia.com&quot;&gt;{{cite web|url=http://mwpdigitalmedia.com/blog/the-blair-witch-project-the-best-viral-marketing-campaign-of-all-time/|title=The Blair Witch Project: The best viral marketing campaign of all time}}&lt;/ref&gt; The campaign tactic was that viewers were being told, through missing persons posters, that the filmmakers were missing while researching in the woods for the mythical Blair Witch.&lt;ref&gt;{{Cite news|url=http://filmforecaster.com/greatest-movie-viral-campaigns/ |title=The Greatest Movie Viral Campaigns|author=Amelia River|date=July 11, 2014 |access-date=7 July 2016}}&lt;/ref&gt; The [[IMDb]] page also listed the actors as &quot;missing, presumed dead&quot; in the first year of the film's availability.&lt;ref name=&quot;mwpdigitalmedia.com&quot;/&gt;&lt;ref&gt;{{cite web|url=http://www.thefleshfarm.com/blairwitch/blairwitchmain.htm|title=The Blair Witch Project}}&lt;/ref&gt; The film's website contained materials of actors posing as police and investigators giving testimony about their casework, and shared childhood photos of the actors to add a sense of realism.&lt;ref&gt;{{cite web|url=http://blairwitch.com/filmmakers.html|title=The Blair Witch Project Official Website: The Filmmakers}}&lt;/ref&gt;<br /> <br /> ''[[USA Today]]'' has opined that the movie was the first movie to go &quot;[[Viral video|viral]]&quot; despite having been produced before many of the technologies that facilitate such phenomena existed.&lt;ref&gt;{{cite web|last1=Bowies|first1=Scott|title='Blair Witch Project': Still a legend 15 years later|url=http://www.usatoday.com/story/life/movies/2014/07/13/blair-witch-project-15th-anniversary-classic-legend/10707409/|website=USA Today|accessdate=24 February 2016}}&lt;/ref&gt;<br /> <br /> ==Reception==<br /> <br /> ===Box office===<br /> ''The Blair Witch Project'' was shown at the 1999 [[Sundance Film Festival]] and had a limited release on July 14, before going wide on July 30, 1999 after months of publicity, including a campaign by the studio to use the Internet and suggest that the movie was a record of real events. The distribution strategy for ''The Blair Witch Project'' was created and implemented by Artisan studio executive [[Steven Rothenberg]].&lt;ref name=thr&gt;{{cite news|first=Carl |last=DiOrio |title=Steve Rothenberg dies at age 50 |url=http://www.hollywoodreporter.com/hr/content_display/film/news/e3i7c23ccda60974aa20677ac607d102241 |work=[[The Hollywood Reporter]] |publisher= |date=July 19, 2009 |accessdate=August 2, 2009 |deadurl=yes |archiveurl=https://web.archive.org/web/20100201002701/http://www.hollywoodreporter.com/hr/content_display/film/news/e3i7c23ccda60974aa20677ac607d102241 |archivedate=February 1, 2010 }}&lt;/ref&gt;&lt;ref name=variety&gt;{{cite news |first=Dave|last=McNary|title=Lionsgate's Steven Rothenberg dies|url=http://www.variety.com/article/VR1118006188.html?categoryId=25&amp;cs=1 |work=[[Variety Magazine]]|publisher=|date=July 20, 2009 |accessdate=August 2, 2009}}&lt;/ref&gt;<br /> <br /> ''The Blair Witch Project'' grossed $248.6 million worldwide.&lt;ref name=&quot;mojo&quot;&gt;{{cite web | title = The Blair Witch Project | work = Box Office Mojo.com|date = January 1, 2006| url = http://boxofficemojo.com/movies/?id=blairwitchproject.htm| accessdate = July 28, 2006 }}&lt;/ref&gt; After reshoots, a new sound mix, experiments with different endings and other changes made by the studio, the film's final budget ended up between $500,000 and $750,000.&lt;ref name=&quot;Q&amp;A&quot; /&gt;<br /> <br /> ===Critical response===<br /> The film received wide acclaim from critics, although audience reception was polarized and divided.&lt;ref name=&quot;Reception&quot;/&gt; [[Rotten Tomatoes]] gives the film an approval rating of 86%, based on 155 reviews, with an average rating of 7.7/10. The site's critical consensus reads, &quot;Full of creepy campfire scares, mock-doc ''The Blair Witch Project'' keeps audiences in the dark about its titular villain -- thus proving that imagination can be as scary as anything onscreen.&quot;&lt;ref&gt;{{cite web | last = | first = | title = The Blair Witch Project | work = Rotten Tomatoes.com | date = | url = http://www.rottentomatoes.com/m/blair_witch_project/|accessdate =February 10, 2011 }}&lt;/ref&gt; On [[Metacritic]] the film has a score of 81 out of 100, based on 33 critics, indicating &quot;universal acclaim&quot;.&lt;ref&gt;[http://www.metacritic.com/movie/the-blair-witch-project The Blair Witch Project Reviews - Metacritic&lt;!-- Bot generated title --&gt;]&lt;/ref&gt;<br /> <br /> The film's &quot;[[Found footage (pseudo-documentary)|found footage]]&quot; format received near-universal praise by critics and, though not the first in the found footage device, the film has been declared a milestone in film history due to its critical and box office success. [[Roger Ebert]] of the ''[[Chicago Sun Times]]'' gave the film a total of 4 stars, calling it &quot;an extraordinarily effective horror film&quot;.&lt;ref name=&quot;Ebert&quot;&gt;{{cite news | last =Ebert | first = Roger| title = The Blair Witch Project | work = Roger Ebert.com | date = July 16, 1999| url = http://rogerebert.suntimes.com/apps/pbcs.dll/article?AID=/19990716/REVIEWS/907160301/1023| accessdate = July 28, 2006 }}&lt;/ref&gt; It was listed on Filmcritic.com as the 50th best movie ending of all time.&lt;ref&gt;{{cite web | last =Null | first = Christopher | title = The Top 50 Movie Endings of All Time | work = filmcritic.com|date = January 1, 2006| url = http://filmcritic.com/misc/emporium.nsf/0/394a496e465c4f38882571b900114dc5?OpenDocument| accessdate =July 30, 2006|archiveurl = http://web.archive.org/web/20060820031838/http://filmcritic.com/misc/emporium.nsf/0/394a496e465c4f38882571b900114dc5?OpenDocument &lt;!-- Bot retrieved archive --&gt; |archivedate = August 20, 2006}}&lt;/ref&gt;<br /> <br /> Film critic Michael Dodd has argued that the film is an embodiment of horror &quot;modernizing its ability to be all-encompassing in expressing the fears of American society&quot;, acknowledging its status as the archetypal modern found footage feature, he noted that &quot;In an age where anyone can film whatever they like, horror needn’t be a cinematic expression of what terrifies the cinema-goer, it can simply be the medium through which terrors captured by the average American can be showcased&quot;.&lt;ref&gt;[http://themissingslate.com/2014/08/31/safe-scares-how-911-caused-the-american-horror-remake-trend-part-one/#.VARTBvldUgs Safe Scares: How 9/11 caused the American Horror Remake Trend (Part One) – The Missing Slate&lt;!-- Bot generated title --&gt;]&lt;/ref&gt; During 2008, ''[[Entertainment Weekly]]'' named ''The Blair Witch Project'' one of &quot;the 100 best films from 1983 to 2008&quot;, ranking it at #99.&lt;ref&gt;{{cite news|url=http://www.ew.com/ew/article/0,,20207076_20207387_20207063,00.html |work=Entertainment Weekly |title=The New Classics: Movies – EW 1000: Movies – Movies – The EW 1000 – Entertainment Weekly |deadurl=yes |archiveurl=https://web.archive.org/web/20090807093230/http://www.ew.com/ew/article/0,,20207076_20207387_20207063,00.html |archivedate=August 7, 2009 }}&lt;/ref&gt; In 2006, [[Chicago Film Critics Association]] listed it as one of the &quot;Top 100 Scariest Movies&quot;, ranking it #12.&lt;ref&gt;[http://www.altfg.com/blog/hollywood/chicago-critics-scariest-films/ Filmspotting, Scariest Movies, Film, Podcast, Reviews, DVDs, Adam Kempenaar]&lt;/ref&gt;<br /> <br /> Because the filming was done by the actors using hand-held cameras, much of the footage is [[Shaky camera|shaky]], especially the final sequence in which a character is running down a set of stairs with the camera. Some audience members experienced [[motion sickness]] and even vomited as a result.&lt;ref&gt;{{cite news| url=http://www.washingtonpost.com/wp-srv/style/movies/features/witchdizzy.htm | work=The Washington Post | title=The Dizzy Spell of 'Blair Witch Project' | date=July 30, 1999 | accessdate=March 1, 2012 | first=Emily | last=Wax}}&lt;/ref&gt;<br /> <br /> ===Awards and honors===<br /> ''The Blair Witch Project'' was nominated for, and won, the following awards.<br /> <br /> {| class=&quot;wikitable&quot;<br /> |-<br /> ! Award<br /> ! Category<br /> ! Subject<br /> ! Result<br /> |-<br /> |rowspan=2|Global Film Critics Award&lt;ref&gt;{{cite web|url=http://www.globalfilmcritics.com/index.php?option=com_content&amp;task=view&amp;id=78&amp;Itemid=35 |title=www.globalfilmcritics.com |publisher=www.globalfilmcritics.com |date= |accessdate=May 29, 2012 |deadurl=yes |archiveurl=https://web.archive.org/web/20120220134033/http://www.globalfilmcritics.com/index.php?option=com_content&amp;task=view&amp;id=78&amp;Itemid=35 |archivedate=February 20, 2012 }}&lt;/ref&gt;<br /> |rowspan=2|Best Screenplay<br /> |Daniel Myrick<br /> |{{nom}}<br /> |-<br /> |Eduardo Sánchez<br /> |{{nom}}<br /> |-<br /> |[[Independent Spirit John Cassavetes Award]]<br /> |colspan=2|Best Film<br /> |{{won}}<br /> |-<br /> |rowspan=3|[[Golden Raspberry Award]]<br /> |rowspan=2|[[Golden Raspberry Award for Worst Picture|Worst Picture]]<br /> |Robin Cowie<br /> |{{nom}}<br /> |-<br /> |[[Gregg Hale (producer)|Gregg Hale]]<br /> |{{nom}}<br /> |-<br /> |[[Golden Raspberry Award for Worst Actress|Worst Actress]]<br /> |[[Heather Donahue]]<br /> |{{won}}<br /> |-<br /> |rowspan=5|[[Stinkers Bad Movie Awards]]&lt;ref&gt;{{cite web|url=http://theenvelope.latimes.com/extras/lostmind/year/1999/1999st.htm |title=1999 22nd Hastings Bad Cinema Society Stinkers Awards |date= |accessdate=July 8, 2013 |work=[[Stinkers Bad Movie Awards]] |publisher=[[Los Angeles Times]] |deadurl=yes |archiveurl=https://web.archive.org/web/20070103155722/http://theenvelope.latimes.com/extras/lostmind/year/1999/1999st.htm |archivedate=January 3, 2007 }}&lt;/ref&gt;<br /> |rowspan=2|Worst Picture<br /> |Robin Cowie<br /> |{{nom}}<br /> |-<br /> |Gregg Hale<br /> |{{nom}}<br /> |-<br /> |Worst Actress<br /> |Heather Donahue<br /> |{{nom}}<br /> |-<br /> |Biggest Disappointment<br /> |<br /> |{{won}}<br /> |-<br /> |Worst Screen Debut<br /> |Heather, Michael, Josh, the Stick People and the world's longest running batteries<br /> |{{nom}}<br /> |}<br /> <br /> The film is recognized by [[American Film Institute]] in these lists:<br /> * 2001: [[AFI's 100 Years...100 Thrills]] – Nominated&lt;ref&gt;{{cite web|url=http://www.afi.com/Docs/100Years/thrills400.pdf |title=AFI's 100 Years...100 Thrills Nominees |format=PDF |date= |accessdate=August 20, 2016}}&lt;/ref&gt;<br /> * 2003: [[AFI's 100 Years...100 Heroes &amp; Villains]]:<br /> ** The Blair Witch – Nominated Villain&lt;ref&gt;{{cite web|url=http://www.afi.com/Docs/100Years/handv400.pdf |title=AFI's 100 Years...100 Heroes &amp; Villains Nominees |format=PDF |date= |accessdate=August 20, 2016}}&lt;/ref&gt;<br /> <br /> ==Cinematic and literary allusions==<br /> In the movie, the Blair Witch is, according to legend, the ghost of Elly Kedward, a woman banished from the Blair Township (latter-day Burkittsville) for [[witchcraft]] in 1785. The directors incorporated that part of the legend, along with allusions to the [[Salem Witch Trials]] and ''[[The Crucible]]'', to play on the themes of injustice done on those who were called witches.&lt;ref name=&quot;witch&quot;&gt;{{cite web | last =Aloi| first = Peg | title = Blair Witch Project &amp;ndash; an Interview with the Directors | work = Witchvox.com | date = July 11, 1999| url = http://www.witchvox.com/va/dt_va.html?a=usma&amp;c=media&amp;id=2416| accessdate = July 29, 2006}}&lt;/ref&gt; They were influenced by ''[[The Shining (film)|The Shining]]'', ''[[Alien (film)|Alien]]'', ''[[The Omen]]'' and [[Benjamin Christensen]]'s 1922 silent documentary ''[[Häxan]]'', after which the producers named their production company, Haxan Films. ''[[Jaws (film)|Jaws]]'' was an influence as well, presumably because the witch was hidden from the viewer for the entirety of the film, forcing suspense from the unknown.&lt;ref name=&quot;onion&quot;&gt;{{cite web | last = Klein | first =Joshua| title = Interview - The Blair Witch Project | work = avclub.com | date = July 22, 1999| url = http://www.avclub.com/article/the-blair-witch-project-13607| accessdate = January 26, 2015 }}&lt;/ref&gt;<br /> <br /> ==Soundtrack==<br /> None of the songs featured on ''Josh's Blair Witch Mix'' actually appear in the movie. However, &quot;The Cellar&quot; is played during the credits and the DVD menu. This collection of mostly [[goth rock]] and [[industrial music|industrial]] tracks is supposedly from a mix tape made by ill-fated film student Joshua Leonard. In the story, the tape was found in his car after his disappearance. Some of the songs featured on the soundtrack were released after 1994, after the events of the movie supposedly have taken place. Several of them feature dialogue from the movie as well.<br /> # &quot;[[Gloomy Sunday]]&quot;&amp;nbsp;– [[Lydia Lunch]]<br /> # &quot;The Order of Death&quot;&amp;nbsp;– [[Public Image Ltd.]]<br /> # &quot;[[Cleanse Fold and Manipulate|Draining Faces]]&quot;&amp;nbsp;– [[Skinny Puppy]]<br /> # &quot;Kingdom's Coming&quot;&amp;nbsp;– [[Bauhaus (band)|Bauhaus]]<br /> # &quot;Don't Go to Sleep Without Me&quot;&amp;nbsp;– [[The Creatures]]<br /> # &quot;God Is God&quot;&amp;nbsp;– [[Laibach (band)|Laibach]]<br /> # &quot;Beware&quot;&amp;nbsp;– [[The Afghan Whigs]]<br /> # &quot;Laughing Pain&quot;&amp;nbsp;– [[Front Line Assembly]]<br /> # &quot;Haunted&quot;&amp;nbsp;– [[Type O Negative]]<br /> # &quot;She's Unreal&quot;&amp;nbsp;– [[Meat Beat Manifesto]]<br /> # &quot;Movement of Fear&quot;&amp;nbsp;– [[Tones on Tail]]<br /> # &quot;The Cellar&quot;&amp;nbsp;– Antonio Cora<br /> <br /> ==Media tie-ins==<br /> {{main article|Blair Witch}}<br /> <br /> ===Books===<br /> In September 1999, D.A. Stern compiled ''The Blair Witch Project: A Dossier''. Perpetuating the film's &quot;true story&quot; angle, the dossier consisted of fabricated police reports, pictures, interviews, and newspaper articles presenting the movie's premise as fact, as well as further elaboration on the Elly Kedward and Rustin Parr legends (an additional &quot;dossier&quot; was created for ''Blair Witch 2''). Stern wrote the 2000 novel ''Blair Witch: The Secret Confessions of Rustin Parr'' and in 2004, revisited the franchise with the novel ''Blair Witch: Graveyard Shift'', featuring all original characters and plot.<br /> <br /> In May 1999, a [[Photonovel]] adaptation of ''The Blair Witch Project'' was written by Claire Forbes and was released by Fotonovel Publications.<br /> <br /> ====''The Blair Witch Files''====<br /> A series of eight young adult books entitled ''The Blair Witch Files'' were released by [[Random House|Random]] subsidiary [[Bantam Books|Bantam]] from 2000 to 2001. The books center on Cade Merill, a fictional cousin of Heather Donahue, who investigates phenomena related to the Blair Witch in attempt to discover what really happened to Heather, Mike, and Josh.&lt;ref name=&quot;Files&quot;&gt;{{cite web|last=Merill |first=Cade |title=Cade Merill's The Blair Witch Files |work=Random House |year=2000 |url=http://www.randomhouse.com/features/blairwitch/home.html |accessdate=September 8, 2009 |deadurl=yes |archiveurl=https://web.archive.org/web/20081207020654/http://www.randomhouse.com/features/blairwitch/home.html |archivedate=December 7, 2008 }}&lt;/ref&gt;<br /> <br /> # ''The Blair Witch Files 1&amp;nbsp;– The Witch's Daughter''<br /> # ''The Blair Witch Files 2&amp;nbsp;– The Dark Room''<br /> # ''The Blair Witch Files 3&amp;nbsp;– The Drowning Ghost''<br /> # ''The Blair Witch Files 4&amp;nbsp;– Blood Nightmare''<br /> # ''The Blair Witch Files 5&amp;nbsp;– The Death Card''<br /> # ''The Blair Witch Files 6&amp;nbsp;– The Prisoner''<br /> # ''The Blair Witch Files 7&amp;nbsp;– The Night Shifters''<br /> # ''The Blair Witch Files 8&amp;nbsp;– The Obsession''<br /> <br /> ===Comic books===<br /> In August 1999, [[Oni Press]] released a [[One-shot (comics)|one-shot]] comic promoting the film, simply titled ''The Blair Witch Project''. Written by Jen Van Meter and drawn by [[Bernie Mireault]], [[Guy Davis (comics)|Guy Davis]], and [[Tommy Lee Edwards]], the comic featured three short stories elaborating on the mythology of the Blair Witch. In mid-2000, the same group worked on a four-issue series called ''The Blair Witch Chronicles''.<br /> <br /> In October 2000, coinciding with the release of ''Book of Shadows: Blair Witch 2'', [[Image Comics]] released a one-shot called ''Blair Witch: Dark Testaments'', drawn by [[Charlie Adlard]] and written by [[Ian Edginton]].<br /> <br /> ===Video games===<br /> In 2000, [[Gathering of Developers]] released a [[Blair Witch (video games)|trilogy of computer games]] based on the film, which greatly expanded on the myths first suggested in the film. The graphics engine and characters were all derived from the producer's earlier game ''[[Nocturne (Game)|Nocturne]]''.&lt;ref&gt;Smith, Jeff. [http://pc.ign.com/articles/078/078038p1.html 'Blair Witch Project Interview'] [[IGN]].com. April 14, 2000.&lt;/ref&gt; Each game, developed by a different team, focused on different aspects of the Blair Witch mythology: Rustin Parr, Coffin Rock, and Elly Kedward, respectively.<br /> <br /> The trilogy received mixed reviews from critics, with most criticism being directed towards the very linear gameplay, clumsy controls and camera angles, and short length. The first volume, ''Rustin Parr'', received the most praise, ranging from moderate to positive, with critics commending its storyline, graphics and atmosphere; some reviewers even claimed that the game was scarier than the movie.&lt;ref&gt;[http://www.metacritic.com/games/platforms/pc/blairwitch1rustinparr?q=Blair%20Witch 'Metacritic: Blair Witch Volume 1: Rustin Parr']. Metacritic.&lt;/ref&gt; The following volumes were less well-received, with ''[[PC Gamer]]'' saying that Volume 2's only saving grace was its cheap price&lt;ref&gt;[http://www.metacritic.com/games/platforms/pc/blairwitch2coffinrock?q=Blair%20Witch 'Metacritic &amp;ndash; Blair Witch Volume 2'] Metacritic.&lt;/ref&gt; and calling Volume 3 &quot;amazingly mediocre&quot;.&lt;ref&gt;[http://www.metacritic.com/games/platforms/pc/blairwitch3ellykedward?q=Blair%20Witch 'Metacritic &amp;ndash; Blair Witch Volume 3'] Metacritic.&lt;/ref&gt;<br /> <br /> ===Documentary===<br /> ''The Woods Movie'' (2015) is a feature-length documentary exploring the production of ''The Blair Witch Project''.&lt;ref&gt;{{cite web | last = | first = | title = Blair Witch Documentary Goes into The Woods Movie | work = DC| date = January 1, 2006| url = http://www.dreadcentral.com/news/89704/blair-witch-documentary-goes-woods-movie/| accessdate = July 28, 2006 |archivedate = May 9, 2006}}&lt;/ref&gt; For this documentary, director Russ Gomm interviewed the original film's producer, [[Gregg Hale (producer)|Gregg Hale]], and directors, [[Eduardo Sánchez (director)|Eduardo Sánchez]] and [[Daniel Myrick]].&lt;ref&gt;{{cite web | last = | first = | title = Finally a Doc On ‘The Blair Witch Project’ – Trailer For &quot;The Woods Movie&quot; | work = DC| date = January 1, 2006| url = http://bloody-disgusting.com/videos/3332333/finally-doc-blair-witch-project-trailer-woods-movie/| accessdate = July 28, 2006 |archivedate = May 9, 2006}}&lt;/ref&gt;<br /> <br /> ==Home media==<br /> ''The Blair Witch Project'' was released on [[DVD]] on October 26, 1999, with VHS and laserdisc versions released around the same time. The DVD included a number of special features, including &quot;''The Curse of the Blair Witch''&quot; and &quot;''The Blair Witch Legacy''&quot; featurettes, newly discovered footage, [[Audio commentary|director and producer commentary]], production notes, cast &amp; crew bios, and trailers.<br /> <br /> A [[Blu-ray Disc|Blu-ray]] release from [[Lionsgate]] was released on October 5, 2010.&lt;ref&gt;{{cite web|url=http://www.blu-ray.com/movies/The-Blair-Witch-Project-Blu-ray/13876 |title=The Blair Witch Project Blu-ray |publisher=Blu-ray.com |date= |accessdate=2012-05-29}}&lt;/ref&gt; [[Best Buy]] and Lionsgate had an exclusive release of the Blu-ray available on August 29, 2010.&lt;ref name=&quot;test&quot;&gt;{{cite web|title=The Blair Witch Project|publisher =High Def Digest|url=http://bluray.highdefdigest.com/3704/blairwitchproject.html |accessdate=March 18, 2016}}&lt;/ref&gt;<br /> <br /> ==Sequels==<br /> A [[sequel]], ''[[Book of Shadows: Blair Witch 2]]'', was released in the autumn of 2000. The film was poorly received by most critics.&lt;ref&gt;{{cite web | last =B. | first =Scott | title = Blair Witch Project 3 to Happen? | work = IGN.com | date = August 21, 2001| url = http://filmforce.ign.com/articles/304/304427p1.html| accessdate = July 30, 2006 }}&lt;/ref&gt; A third installment announced that same year did not materialize.&lt;ref&gt;{{cite web | last = | first = | title = Blair Witch 3 | work = Yahoo Movies | date = 2006-01-01| url = http://movies.yahoo.com/shop?d=hp&amp;cf=prev&amp;id=1808403198| accessdate = 2006-07-28 |archiveurl = https://web.archive.org/web/20060509080506/http://movies.yahoo.com/shop?d=hp&amp;cf=prev&amp;id=1808403198 |archivedate = 2006-05-09}}&lt;/ref&gt;<br /> <br /> In January 2015, Eduardo Sanchez revealed that he was still planning ''Blair Witch 3'' and that he considered the film &quot;inevitable&quot;, but added that there was nothing to officially announce at that time.&lt;ref&gt;{{cite web | last =Barton | first =Steve | title = Eduardo Sanchez Talks Blair Witch 3 | work = dreadcentral.com | date = January 14, 2015| url = http://www.dreadcentral.com/news/85523/exclusive-eduardo-sanchez-talks-blair-witch-3-coming-sooner-rather-later/| accessdate = March 16, 2015 }}&lt;/ref&gt;<br /> <br /> On July 22, 2016, a surprise trailer of '''''&quot;[[Blair Witch (film)|Blair Witch]]&quot;''''', directed by [[Adam Wingard]], a sequel to the first film, was released at [[San Diego Comic-Con International|San Diego Comic-Con]].&lt;ref&gt;https://www.youtube.com/watch?v=girSv9UH_V8 ''Blair Witch'' trailer&lt;/ref&gt; The film was originally marketed as ''The Woods'' so as to be an exclusive surprise announcement for those in attendance at the convention. The film, produced by [[Lionsgate Films|Lionsgate]], is slated for a September 16, 2016 release&lt;ref name=&quot;latimes.com&quot;/&gt; and stars [[James Allen McCune]] as the brother of the original film's Heather Donahue.&lt;ref&gt;{{cite web|last1=Collis|first1=Clark|title=Secret Blair Witch sequel gets new trailer, September release date|url=http://www.ew.com/article/2016/07/22/blair-witch-project-sequel-secret-comic-con|website=Entertainment Weekly|accessdate=23 July 2016}}&lt;/ref&gt; In September 2016, screenwriter [[Simon Barrett]] explained that in writing the new film he only considered material that was produced with the involvement of the original film's creative team (directors Daniel Myrick and Eduardo Sanchez, producer Greg Hale, and production designer Ben Rock) to be used in the making of the film, and that he did not take any material produced without their involvement—such as the first sequel ''Book of Shadows'' or ''[[Blair Witch#The Blair Witch Files|The Blair Witch Files]]'', a series of [[young adult fiction|young adult]] novels—into consideration when writing the new sequel.&lt;ref name=&quot;cinemablend.com&quot;/&gt;<br /> <br /> An unofficial spin-off was released in 2011 titled ''Doc. 33''', an Italian [[Found footage (pseudo-documentary)|found footage]] [[horror film]]. The film starts by describing the events that occur in ''The Blair Witch Project''; it then follows by describing a similar incident that occurred in Wirgen, [[Austria]]. The film revolves around a group of filmmakers in 1998 who investigate an orphanage in the woods where dozens of children were murdered by nuns. The nuns took part in occult practices which dubbed the [[wikt:mother superior|Mother Superior]] of the orphanage &quot;The Witch of Wirgen Woods.&quot;<br /> <br /> ==See also==<br /> * [[List of ghost films]]<br /> * [[Found footage (pseudo-documentary)]]<br /> * ''[[The Bogus Witch Project]]'', a direct-to-video parody.<br /> <br /> == Literature ==<br /> * Schreier, Margrit (2004): ''Please Help Me; All I Want to Know Is: Is It Real or Not? How Recipients View the Reality Status of The Blair Witch Project.'' In: Poetics Today, Vol. 25, Nr. 2, pp.&amp;nbsp;305–334 ([http://dx.doi.org/10.1215/03335372-25-2-305 full text]{{dead link|date=September 2016|bot=medic}}{{cbignore|bot=medic}}, qualitative content analysis on the movie´s reception)<br /> <br /> ==References==<br /> {{Reflist|30em}}<br /> <br /> ==External links==<br /> {{wikiquote}}<br /> {{Commons category}}<br /> * {{official website|http://www.blairwitch.com/}}<br /> * {{IMDb title|0185937|The Blair Witch Project}}<br /> * {{allmovie|176036|The Blair Witch Project}}<br /> * {{mojo title|blairwitchproject|The Blair Witch Project}}<br /> * {{rotten-tomatoes|blair_witch_project|The Blair Witch Project}}<br /> <br /> {{The Blair Witch Project}}<br /> {{Eduardo Sánchez}}<br /> <br /> {{DEFAULTSORT:Blair Witch Project, The}}<br /> [[Category:1999 films]]<br /> [[Category:1999 horror films]]<br /> [[Category:American films]]<br /> [[Category:American horror films]]<br /> [[Category:English-language films]]<br /> [[Category:Camcorder films]]<br /> [[Category:Cultural depictions of people]]<br /> [[Category:Films set in 1994]]<br /> [[Category:Films set in Maryland]]<br /> [[Category:Films shot in Maryland]]<br /> [[Category:Films shot from the first-person perspective]]<br /> [[Category:Found footage films]]<br /> [[Category:American independent films]]<br /> [[Category:Mockumentary films]]<br /> [[Category:Psychological horror films]]<br /> [[Category:Supernatural horror films]]<br /> [[Category:Witchcraft in film]]<br /> [[Category:Artisan Entertainment films]]<br /> [[Category:Blair Witch (franchise)]]<br /> [[Category:1999 hoaxes]]<br /> [[Category:Paranormal hoaxes]]<br /> [[Category:Films set in forests]]<br /> [[Category:Films about film directors and producers]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=AWK&diff=732913836 AWK 2016-08-04T02:50:24Z <p>PuercoPop: Remove the misnomer 'interpreted language' from the article</p> <hr /> <div>{{About|the programming language}}<br /> {{Infobox programming language<br /> | logo =<br /> | name = AWK<br /> | paradigm = [[scripting language|Scripting]], [[procedural programming|procedural]], [[data-driven programming|data-driven]]&lt;ref name=developerworks&gt;{{cite web|url=https://www6.software.ibm.com/developerworks/education/au-gawk/au-gawk-a4.pdf|title=Get started with GAWK: AWK language fundamentals|last=Stutz|first=Michael|date=September 19, 2006|work=developerWorks|publisher=[[IBM]]|accessdate=2015-01-29|quote=[AWK is] often called a data-driven language -- the program statements describe the input data to match and process rather than a sequence of program steps}}&lt;/ref&gt;<br /> | year = {{start date and age|1977}}<br /> | latest_release_version = [http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html IEEE Std 1003.1-2008] (POSIX) / 1985<br /> | designer = [[Alfred Aho]], [[Peter J. Weinberger|Peter Weinberger]], and [[Brian Kernighan]]<br /> | typing = none; can handle strings, integers and floating-point numbers; regular expressions<br /> | implementations = awk, GNU Awk, mawk, nawk, MKS AWK, Thompson AWK (compiler), Awka (compiler)<br /> | dialects = ''old awk'' oawk 1977, ''new awk'' nawk 1985, ''GNU Awk'' gawk<br /> | influenced_by = [[C (programming language)|C]], [[SNOBOL]]4, [[Bourne shell]]<br /> | influenced = [[Tcl]], [[AMPL]], [[Perl]]&lt;!--1987--&gt;, [[Korn Shell]] (''ksh93''&lt;!--1993--&gt;, ''dtksh'', ''tksh''), [[Lua (programming language)|Lua]]&lt;!--1993--&gt;<br /> | operating_system = [[Cross-platform]]<br /> | website = {{URL|www.cs.princeton.edu/~bwk/btl.mirror/}}<br /> }}<br /> <br /> '''AWK''' is an [[programming language]] designed for text processing and typically used as a [[data extraction]] and reporting tool. It is a standard feature of most [[Unix-like]] [[operating system]]s.<br /> <br /> The AWK language is a [[data-driven programming|data-driven]] [[scripting language]] consisting of a set of actions to be taken against [[Stream (computing)|streams]] of textual data – either run directly on files or used as part of a [[pipeline (Unix)|pipeline]] – for purposes of extracting or transforming text, such as producing formatted reports. The language extensively uses the [[string (computer science)|string]] [[datatype]], [[associative array]]s (that is, arrays indexed by key strings), and [[regular expression]]s. While AWK has a limited intended [[application domain]] and was especially designed to support [[one-liner program]]s, the language is [[Turing-complete]], and even the early Bell Labs users of AWK often wrote well-structured large AWK programs.&lt;ref&gt;{{cite web<br /> | url = http://www.faqs.org/docs/artu/ch08s02.html#awk<br /> | title = Applying Minilanguages<br /> | first = Eric S.<br /> | last = Raymond<br /> | authorlink = Eric S. Raymond<br /> | work = The Art of Unix Programming<br /> | at = Case Study: awk<br /> | archiveurl = https://web.archive.org/web/20080730063308/http://www.faqs.org/docs/artu/ch08s02.html#awk<br /> | archivedate = July 30, 2008<br /> | accessdate = May 11, 2010<br /> | quote = The awk action language is Turing-complete, and can read and write files.<br /> }}&lt;/ref&gt;<br /> <br /> AWK was created at [[Bell Labs]] in the 1970s,&lt;ref&gt;[http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.31.1299 Awk -- A Pattern Scanning and Processing Language (Second Edition) (1978)]&lt;/ref&gt; and its name is derived from the [[surname]]s of its authors – [[Alfred Aho]], [[Peter J. Weinberger|Peter Weinberger]], and [[Brian Kernighan]]. The acronym is pronounced the same as the name of the bird [[auk]] (which acts as an emblem of the language such as on ''The AWK Programming Language'' book cover{{r|AWK1}} – the book is often referred to by the abbreviation ''TAPL''). When written in all lowercase letters, as &lt;code&gt;awk&lt;/code&gt;, it refers to the [[Unix]] or [[Plan 9 from Bell Labs|Plan 9]] program that runs scripts written in the AWK programming language.<br /> <br /> ==History==<br /> AWK was initially developed in 1977 by [[Alfred Aho]], [[Peter Weinberger]], and [[Brian Kernighan]], from whose initials the language takes its name. As one of the early tools to appear in [[Version 7 Unix]], AWK added computational features to a Unix [[pipeline (Unix)|pipeline]] besides the [[Bourne shell]], the only scripting language available in a standard Unix environment. It is one of the mandatory utilities of the [[Single UNIX Specification]],&lt;ref&gt;[http://www.unix.org/version3/apis/cu.html The Single UNIX Specification, Version 3, Utilities Interface Table]&lt;/ref&gt; and is required by the [[Linux Standard Base]] specification.&lt;ref&gt;[http://refspecs.freestandards.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/command.html#AEN32008 Linux Standard Base Core Specification 4.0, Chapter 15. Commands and Utilities]&lt;/ref&gt;<br /> <br /> AWK was significantly revised and expanded in 1985–88, resulting in the [[Gawk (GNU package)|GNU AWK]] implementation written by [[Paul Rubin]], [[Jay Fenlason]], and [[Richard Stallman]], released in 1988.&lt;ref name=robbins/&gt; GNU AWK is the most widely deployed version{{Citation needed|date=March 2015}} because it is included with GNU-based Linux packages. GNU AWK has been maintained solely by [[Arnold Robbins]] since 1994.&lt;ref name=robbins&gt;{{cite web |url=http://www.skeeve.com/gnu-awk-and-me-2014.pdf |title=The GNU Project and Me: 27 Years with GNU AWK |website=skeeve.com |author=Arnold Robbins |date=March 2014 |accessdate=October 4, 2014}}&lt;/ref&gt; [[Brian Kernighan]]'s [[nawk]] (New AWK) source was first released in 1993 unpublicized, and publicly since the late 1990s; many BSD systems use it to avoid GPL license.&lt;ref name=robbins/&gt;<br /> <br /> AWK was preceded by [[sed]] (1974). Both were designed for text processing. They share the line-oriented, data-driven paradigm, and are particularly suited to writing [[one-liner program]]s, due to the implicit [[main loop]] and current line variables. The power and terseness of early AWK programs – notably the powerful regular expression handling and conciseness due to implicit variables, which facilitate one-liners – together with the limitations of AWK at the time, were important inspirations for the [[Perl]] language (1987). In the 1990s, Perl became very popular, competing with AWK in the niche of Unix text-processing languages.<br /> <br /> == Structure of AWK programs ==<br /> <br /> &lt;blockquote&gt;<br /> &quot;'''AWK''' is a language for processing text files. A file is treated as a sequence of records, and by default each line is a record. Each line is broken up into a sequence of fields, so we can think of the first word in a line as the first field, the second word as the second field, and so on. An AWK program is a sequence of pattern-action statements. AWK reads the input a line at a time. A line is scanned for each pattern in the program, and for each pattern that matches, the associated action is executed.&quot; - Alfred V. Aho&lt;ref&gt;http://www.computerworld.com.au/index.php/id;1726534212;pp;2 The A-Z of Programming Languages: AWK&lt;/ref&gt;<br /> &lt;/blockquote&gt;<br /> <br /> An AWK program is a series of pattern action pairs, written as:<br /> <br /> &lt;source lang=&quot;awk&quot;&gt;<br /> condition { action }<br /> &lt;/source&gt;<br /> <br /> where ''condition'' is typically an expression and ''action'' is a series of commands. The input is split into records, where by default records are separated by newline characters so that the input is split into lines. The program tests each record against each of the conditions in turn, and executes the ''action'' for each expression that is true. Either the ''condition'' or the ''action'' may be omitted. The ''condition'' defaults to matching every record. The default ''action'' is to print the record. This is the same pattern-action structure as sed.<br /> <br /> In addition to a simple AWK expression, such as &lt;code&gt;foo == 1&lt;/code&gt; or &lt;code&gt;/^foo/&lt;/code&gt;, the ''condition'' can be ''BEGIN'' or ''END'' causing the ''action'' to be executed before or after all records have been read, or ''pattern1, pattern2'' which matches the range of records starting with a record that matches ''pattern1'' up to and including the record that matches ''pattern2'' before again trying to match against ''pattern1'' on future lines.<br /> <br /> In addition to normal arithmetic and logical operators, AWK expressions include the tilde operator, ''~'', which matches a [[regular expression]] against a string. As handy [[syntactic sugar]], ''/regexp/'' without using the tilde operator matches against the current record; this syntax derives from sed, which in turn inherited it from the [[Ed (text editor)|ed]] editor, where &lt;code&gt;/&lt;/code&gt; is used for searching. This syntax of using slashes as [[delimiter]]s for regular expressions was subsequently adopted by Perl and ECMAScript, and is now quite common. The tilde operator was also adopted by Perl, but has not seen as wide use.<br /> <br /> == AWK commands ==<br /> <br /> AWK commands are the statements that are substituted for ''action'' in the examples above. AWK commands can include function calls, variable assignments, calculations, or any combination thereof. AWK contains built-in support for many functions; many more are provided by the various flavors of AWK. Also, some flavors support the inclusion of [[dynamically linked library|dynamically linked libraries]], which can also provide more functions.<br /> <br /> For brevity, the enclosing curly braces ( ''{ }'' ) will be omitted from these examples.<br /> <br /> === The ''print'' command ===<br /> <br /> The ''print'' command is used to output text. The output text is always terminated with a predefined string called the output record separator (ORS) whose default value is a newline. The simplest form of this command is:<br /> <br /> ; &lt;code&gt;print&lt;/code&gt;<br /> :This displays the contents of the current record. In AWK, records are broken down into ''fields'', and these can be displayed separately:<br /> ; &lt;code&gt;print $1&lt;/code&gt;<br /> : Displays the first field of the current record<br /> ; &lt;code&gt;print $1, $3&lt;/code&gt;<br /> : Displays the first and third fields of the current record, separated by a predefined string called the output field separator (OFS) whose default value is a single space character<br /> <br /> Although these fields (''$X'') may bear resemblance to variables (the $ symbol indicates variables in [[Perl]]), they actually refer to the fields of the current record. A special case, ''$0'', refers to the entire record. In fact, the commands &quot;&lt;code&gt;print&lt;/code&gt;&quot; and &quot;&lt;code&gt;print $0&lt;/code&gt;&quot; are identical in functionality.<br /> <br /> The ''print'' command can also display the results of calculations and/or function calls:<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> print 3+2<br /> print foobar(3)<br /> print foobar(variable)<br /> print sin(3-2)<br /> &lt;/source&gt;<br /> <br /> Output may be sent to a file:<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> print &quot;expression&quot; &gt; &quot;file name&quot;<br /> &lt;/source&gt;<br /> <br /> or through a [[pipe (Unix)|pipe]]:<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> print &quot;expression&quot; | &quot;command&quot;<br /> &lt;/source&gt;<br /> <br /> === Built-in variables ===<br /> <br /> Awk's built-in variables include the field variables: $1, $2, $3, and so on ($0 represents the entire record). They hold the text or values in the individual text-fields in a record.<br /> <br /> Other variables include:<br /> * NR: Keeps a current count of the number of input records.<br /> * NF: Keeps a count of the number of fields in an input record. The last field in the input record can be designated by $NF.<br /> * FILENAME: Contains the name of the current input-file.<br /> * FS: Contains the &quot;field separator&quot; character used to divide fields on the input record. The default, &quot;white space&quot;, includes any space and tab characters. FS can be reassigned to another character to change the field separator.<br /> * RS: Stores the current &quot;record separator&quot; character. Since, by default, an input line is the input record, the default record separator character is a &quot;newline&quot;.<br /> * OFS: Stores the &quot;output field separator&quot;, which separates the fields when Awk prints them. The default is a &quot;space&quot; character.<br /> * ORS: Stores the &quot;output record separator&quot;, which separates the output records when Awk prints them. The default is a &quot;newline&quot; character.<br /> * OFMT: Stores the format for numeric output. The default format is &quot;%.6g&quot;.<br /> <br /> === Variables and syntax ===<br /> <br /> Variable names can use any of the characters [A-Za-z0-9_], with the exception of language keywords. The operators ''+ - * /'' represent addition, subtraction, multiplication, and division, respectively. For string [[concatenation]], simply place two variables (or string constants) next to each other. It is optional to use a space in between if string constants are involved, but two variable names placed adjacent to each other require a space in between. Double quotes [[delimit]] string constants. Statements need not end with semicolons. Finally, comments can be added to programs by using ''#'' as the first character on a line.<br /> <br /> === User-defined functions ===<br /> <br /> In a format similar to [[C (programming language)|C]], function definitions consist of the keyword &lt;code&gt;function&lt;/code&gt;, the function name, argument names and the function body. Here is an example of a function.<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> function add_three (number) {<br /> return number + 3<br /> }<br /> &lt;/source&gt;<br /> <br /> This statement can be invoked as follows:<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> print add_three(36) # Outputs '''39'''<br /> &lt;/source&gt;<br /> <br /> Functions can have variables that are in the local scope. The names of these are added to the end of the argument list, though values for these should be omitted when calling the function. It is convention to add some [[whitespace character|whitespace]] in the argument list before the local variables, to indicate where the parameters end and the local variables begin.<br /> <br /> == Sample applications ==<br /> <br /> === Hello World ===<br /> <br /> Here is the customary &quot;[[&quot;Hello, World!&quot; program|Hello, world]]&quot; program written in AWK:<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> BEGIN { print &quot;Hello, world!&quot; }<br /> &lt;/source&gt;<br /> <br /> Note that an explicit &lt;code&gt;exit&lt;/code&gt; statement is not needed here; since the only pattern is &lt;code&gt;BEGIN&lt;/code&gt;, no command-line arguments are processed.<br /> <br /> === Print lines longer than 80 characters ===<br /> <br /> Print all lines longer than 80 characters. Note that the default action is to print the current line.<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> length($0) &gt; 80<br /> &lt;/source&gt;<br /> <br /> === Print a count of words ===<br /> <br /> Count words in the input and print the number of lines, words, and characters (like [[wc (Unix)|wc]]):<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> {<br /> w += NF<br /> c += length + 1<br /> }<br /> END { print NR, w, c }<br /> &lt;/source&gt;<br /> <br /> As there is no pattern for the first line of the program, every line of input matches by default, so the increment actions are executed for every line. Note that &lt;code&gt;w += NF&lt;/code&gt; is shorthand for &lt;code&gt;w = w + NF&lt;/code&gt;.<br /> <br /> === Sum last word ===<br /> <br /> &lt;source lang=&quot;awk&quot;&gt;<br /> { s += $NF }<br /> END { print s + 0 }<br /> &lt;/source&gt;<br /> <br /> ''s'' is incremented by the numeric value of ''$NF'', which is the last word on the line as defined by AWK's field separator (by default, white-space). ''NF'' is the number of fields in the current line, e.g. 4. Since ''$4'' is the value of the fourth field, ''$NF'' is the value of the last field in the line regardless of how many fields this line has, or whether it has more or fewer fields than surrounding lines. $ is actually a unary operator with the highest [[operator precedence]]. (If the line has no fields, then ''NF'' is 0, ''$0'' is the whole line, which in this case is empty apart from possible white-space, and so has the numeric value 0.)<br /> <br /> At the end of the input the ''END'' pattern matches, so ''s'' is printed. However, since there may have been no lines of input at all, in which case no value has ever been assigned to ''s'', it will by default be an empty string. Adding zero to a variable is an AWK idiom for coercing it from a string to a numeric value. (Concatenating an empty string is to coerce from a number to a string, e.g. ''s &quot;&quot;''. Note, there's no operator to concatenate strings, they're just placed adjacently.) With the coercion the program prints &quot;0&quot; on an empty input, without it an empty line is printed.<br /> <br /> === Match a range of input lines ===<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> NR % 4 == 1, NR % 4 == 3 { printf &quot;%6d %s\n&quot;, NR, $0 }<br /> &lt;/source&gt;<br /> The action statement prints each line numbered. The printf function emulates the standard C [[printf]] and works similarly to the print command described above. The pattern to match, however, works as follows: ''NR'' is the number of records, typically lines of input, AWK has so far read, i.e. the current line number, starting at 1 for the first line of input. ''%'' is the [[modulo operation|modulo]] operator. ''NR % 4 == 1'' is true for the 1st, 5th, 9th, etc., lines of input. Likewise, ''NR % 4 == 3'' is true for the 3rd, 7th, 11th, etc., lines of input. The range pattern is false until the first part matches, on line 1, and then remains true up to and including when the second part matches, on line 3. It then stays false until the first part matches again on line 5.<br /> <br /> The first part of a range pattern being constantly true, e.g. ''1'', can be used to start the range at the beginning of input. Similarly, if the second part is constantly false, e.g. ''0'', the range continues until the end of input. For example,<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> /^--cut here--$/, 0<br /> &lt;/source&gt;<br /> prints lines of input from the first line matching the regular expression ''^--cut here--$'', that is, a line containing only the phrase &quot;--cut here--&quot;, to the end.<br /> <br /> === Calculate word frequencies ===<br /> <br /> [[Word frequency]] using [[associative array]]s:<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> BEGIN {<br /> FS=&quot;[^a-zA-Z]+&quot;<br /> }<br /> {<br /> for (i=1; i&lt;=NF; i++)<br /> words[tolower($i)]++<br /> }<br /> END {<br /> for (i in words)<br /> print i, words[i]<br /> }<br /> &lt;/source&gt;<br /> <br /> The BEGIN block sets the field separator to any sequence of non-alphabetic characters. Note that separators can be regular expressions. After that, we get to a bare action, which performs the action on every input line. In this case, for every field on the line, we add one to the number of times that word, first converted to lowercase, appears. Finally, in the END block, we print the words with their frequencies. The line<br /> for (i in words)<br /> creates a loop that goes through the array ''words'', setting ''i'' to each ''subscript'' of the array. This is different from most languages, where such a loop goes through each ''value'' in the array. The loop thus prints out each word followed by its frequency count. &lt;code&gt;tolower&lt;/code&gt; was an addition to the One True awk (see below) made after the book was published.<br /> <br /> === Match pattern from command line ===<br /> <br /> This program can be represented in several ways. The first one uses the [[Bourne shell]] to make a shell script that does everything. It is the shortest of these methods:<br /> &lt;source lang=&quot;bash&quot;&gt;<br /> pattern=&quot;$1&quot;<br /> shift<br /> awk '/'&quot;$pattern&quot;'/ { print FILENAME &quot;:&quot; $0 }' &quot;$@&quot;<br /> &lt;/source&gt;<br /> <br /> The &lt;code&gt;$pattern&lt;/code&gt; in the awk command is not protected by single quotes so that the shell does expand the variable but it needs to be put in double quotes to properly handle patterns containing spaces. A pattern by itself in the usual way checks to see if the whole line (&lt;code&gt;$0&lt;/code&gt;) matches. &lt;code&gt;FILENAME&lt;/code&gt; contains the current filename. awk has no explicit concatenation operator; two adjacent strings concatenate them. &lt;code&gt;$0&lt;/code&gt; expands to the original unchanged input line.<br /> <br /> There are alternate ways of writing this. This shell script accesses the environment directly from within awk:<br /> &lt;source lang=&quot;bash&quot;&gt;<br /> export pattern=&quot;$1&quot;<br /> shift<br /> awk '$0 ~ ENVIRON[&quot;pattern&quot;] { print FILENAME &quot;:&quot; $0 }' &quot;$@&quot;<br /> &lt;/source&gt;<br /> <br /> This is a shell script that uses &lt;code&gt;ENVIRON&lt;/code&gt;, an array introduced in a newer version of the One True awk after the book was published. The subscript of &lt;code&gt;ENVIRON&lt;/code&gt; is the name of an environment variable; its result is the variable's value. This is like the [[getenv]] function in various standard libraries and [[POSIX]]. The shell script makes an environment variable &lt;code&gt;pattern&lt;/code&gt; containing the first argument, then drops that argument and has awk look for the pattern in each file.<br /> <br /> &lt;code&gt;~&lt;/code&gt; checks to see if its left operand matches its right operand; &lt;code&gt;!~&lt;/code&gt; is its inverse. Note that a regular expression is just a string and can be stored in variables.<br /> <br /> The next way uses command-line variable assignment, in which an argument to awk can be seen as an assignment to a variable:<br /> &lt;source lang=&quot;bash&quot;&gt;<br /> pattern=&quot;$1&quot;<br /> shift<br /> awk '$0 ~ pattern { print FILENAME &quot;:&quot; $0 }' &quot;pattern=$pattern&quot; &quot;$@&quot;<br /> &lt;/source&gt;<br /> <br /> Or You can use the ''-v var=value'' command line option (e.g. ''awk -v pattern=&quot;$pattern&quot; ...'').<br /> <br /> Finally, this is written in pure awk, without help from a shell or without the need to know too much about the implementation of the awk script (as the variable assignment on command line one does), but is a bit lengthy:<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> BEGIN {<br /> pattern = ARGV[1]<br /> for (i = 1; i &lt; ARGC; i++) # remove first argument<br /> ARGV[i] = ARGV[i + 1]<br /> ARGC--<br /> if (ARGC == 1) { # the pattern was the only thing, so force read from standard input (used by book)<br /> ARGC = 2<br /> ARGV[1] = &quot;-&quot;<br /> }<br /> }<br /> $0 ~ pattern { print FILENAME &quot;:&quot; $0 }<br /> &lt;/source&gt;<br /> <br /> The &lt;code&gt;BEGIN&lt;/code&gt; is necessary not only to extract the first argument, but also to prevent it from being interpreted as a filename after the &lt;code&gt;BEGIN&lt;/code&gt; block ends. &lt;code&gt;ARGC&lt;/code&gt;, the number of arguments, is always guaranteed to be ≥1, as &lt;code&gt;ARGV[0]&lt;/code&gt; is the name of the command that executed the script, most often the string &lt;code&gt;&quot;awk&quot;&lt;/code&gt;. Also note that &lt;code&gt;ARGV[ARGC]&lt;/code&gt; is the empty string, &lt;code&gt;&quot;&quot;&lt;/code&gt;. &lt;code&gt;#&lt;/code&gt; initiates a comment that expands to the end of the line.<br /> <br /> Note the &lt;code&gt;if&lt;/code&gt; block. awk only checks to see if it should read from standard input before it runs the command. This means that<br /> awk 'prog'<br /> only works because the fact that there are no filenames is only checked before &lt;code&gt;prog&lt;/code&gt; is run! If you explicitly set &lt;code&gt;ARGC&lt;/code&gt; to 1 so that there are no arguments, awk will simply quit because it feels there are no more input files. Therefore, you need to explicitly say to read from standard input with the special filename &lt;code&gt;-&lt;/code&gt;.<br /> <br /> == Self-contained AWK scripts ==<br /> <br /> On Unix-like operating systems self-contained AWK scripts can be constructed using the &quot;[[shebang (Unix)|shebang]]&quot; syntax.<br /> <br /> For example, a script called &lt;code&gt;hello.awk&lt;/code&gt; that prints the string ''Hello, world!'' may be built by creating a file named &lt;code&gt;hello.awk&lt;/code&gt; containing the following lines:<br /> &lt;source lang=&quot;awk&quot;&gt;<br /> #!/usr/bin/awk -f<br /> BEGIN { print &quot;Hello, world!&quot; }<br /> &lt;/source&gt;<br /> <br /> The &lt;code&gt;-f&lt;/code&gt; tells ''awk'' that the argument that follows is the file to read the AWK program from, which is the same flag that is used in sed. Both these programs default to executing a program given as a command-line argument, rather than a separate file – since they are often used for one-liners.<br /> <br /> == Versions and implementations ==<br /> <br /> AWK was originally written in 1977 and distributed with [[Version 7 Unix]].<br /> <br /> In 1985 its authors started expanding the language, most significantly by adding user-defined functions. The language is described in the book ''The AWK Programming Language'', published 1988, and its implementation was made available in releases of [[UNIX System V]]. To avoid confusion with the incompatible older version, this version was sometimes called &quot;new awk&quot; or ''nawk''. This implementation was released under a [[free software license]] in 1996 and is still maintained by Brian Kernighan (see external links below).<br /> <br /> Old versions of Unix, such as [[UNIX/32V]], included &lt;code&gt;awkcc&lt;/code&gt;, which converted AWK to C. Kernighan wrote a program to turn awk into C++; its state is not known.&lt;ref&gt;[http://cm.bell-labs.com/cm/cs/who/bwk/awkc++.ps An AWK to C++ Translator]&lt;/ref&gt;<br /> <br /> * '''BWK awk''', also known as '''nawk''', refers to the version by [[Brian Kernighan]]. It has been dubbed the &quot;One True AWK&quot; because of the use of the term in association with the book that originally described the language and the fact that Kernighan was one of the original authors of AWK.&lt;ref name = &quot;AWK1&quot;&gt;{{cite book | title= The AWK Programming Language |author1=Alfred V. Aho |author2=Brian W. Kernighan |author3=Peter J. Weinberger | year= 1988 | publisher= Addison-Wesley Publishing Company | location= | isbn= 9780201079814 | page= |url = https://books.google.com/books?id=53ueQgAACAAJ&amp;dq=The+AWK+Programming+Language&amp;hl=en&amp;sa=X&amp;ei=LXxXVfq0GMOSsAWrpoC4Bg&amp;ved=0CCYQ6AEwAA | accessdate = 16 May 2015 }}&lt;/ref&gt; FreeBSD refers to this version as ''one-true-awk''.&lt;ref&gt;[http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/one-true-awk/FREEBSD-upgrade?rev=1.9&amp;content-type=text/x-cvsweb-markup FreeBSD's work log for importing BWK awk into FreeBSD's core], dated 2005-05-16, downloaded 2006-09-20&lt;/ref&gt; This version also has features not in the book, such as &lt;code&gt;tolower&lt;/code&gt; and &lt;code&gt;ENVIRON&lt;/code&gt; that are explained above; see the FIXES file in the source archive for details. This version is used by e.g. [[FreeBSD]], [[NetBSD]], [[OpenBSD]] and [[OS X]].<br /> * '''gawk''' ([[GNU]] awk) is another free-software implementation and the only implementation that makes serious progress implementing [[internationalization and localization]] and TCP/IP networking. It was written before the original implementation became freely available. It includes its own debugger, and its [[profiling (computer programming)|profiler]] enables the user to make measured performance enhancements to a script. It also enables the user to extend functionality with shared libraries. [[Linux distribution]]s are mostly GNU software, and so they include ''gawk''. [[FreeBSD]] before version 5.0 also included ''gawk'' version 3.0, but subsequent versions of FreeBSD use ''BWK awk'' to avoid the [[BSD and GPL licensing|more restrictive]] [[GNU General Public License]] (GPL), as well as for its technical characteristics.&lt;ref&gt;[http://www.freebsd.org/doc/en_US.ISO8859-1/articles/bsdl-gpl/ FreeBSD's view of ''GPL Advantages and Disadvantages'']&lt;/ref&gt;&lt;ref&gt;[http://www.freebsd.org/releases/5.0R/relnotes-i386.html#USERLAND FreeBSD 5.0 release notes] with notice of ''BWK awk'' in the base distribution&lt;/ref&gt;<br /> * '''mawk''' is a very fast AWK implementation by Mike Brennan based on a [[bytecode]] interpreter.<br /> * '''libmawk''' is a fork of mawk, allowing applications to embed multiple parallel instances of awk interpreters.<br /> * '''awka''' (whose front end is written atop the ''mawk'' program) is another translator of AWK scripts into C code. When compiled, statically including the author's libawka.a, the resulting executables are considerably sped up and, according to the author's tests, compare very well with other versions of AWK, [[Perl]], or [[Tcl]]. Small scripts will turn into programs of 160–170 kB.<br /> * '''tawk''' (Thompson AWK) is an AWK [[compiler]] for [[Solaris (operating system)|Solaris]], [[DOS]], [[OS/2]], and [[Microsoft Windows|Windows]], previously sold by Thompson Automation Software (which has ceased its activities).<br /> * '''Jawk''' is a project to implement AWK in [[Java (programming language)|Java]], hosted on SourceForge.&lt;ref&gt;[http://sourceforge.net/projects/jawk/ ''Jawk'' at SourceForge]&lt;/ref&gt; Extensions to the language are added to provide access to Java features within AWK scripts (i.e., Java threads, sockets, collections, etc.).<br /> * '''xgawk''' is a fork of ''gawk''&lt;ref&gt;[http://gawkextlib.sourceforge.net/ ''xgawk'' Home Page]&lt;/ref&gt; that extends ''gawk'' with dynamically loadable libraries. The XMLgawk extension was integrated into the official GNU Awk release 4.1.0.<br /> * '''QSEAWK''' is an embedded AWK interpreter implementation included in the QSE library that provides embedding [[application programming interface]] (API) for [[C (programming language)|C]] and [[C++]].&lt;ref&gt;[http://qse.googlecode.com/ QSEAWK at Google Code]&lt;/ref&gt;<br /> * '''[[BusyBox]]''' includes an AWK implementation written by Dmitry Zakharov. This is a very small implementation suitable for embedded systems.<br /> <br /> == Books ==<br /> <br /> * {{cite book<br /> | last1 = Aho<br /> | first1 = Alfred V.<br /> | authorlink1 = Alfred Aho<br /> | last2 = Kernighan<br /> | first2 = Brian W.<br /> | authorlink2 = Brian Kernighan<br /> | last3 = Weinberger<br /> | first3 = Peter J.<br /> | authorlink3 = Peter J. Weinberger<br /> | title = The AWK Programming Language<br /> | url = http://cm.bell-labs.com/cm/cs/awkbook/<br /> | accessdate = 2009-04-16<br /> | date = 1988-01-01<br /> | publisher = [[Addison-Wesley]]<br /> | location = New York, NY<br /> | isbn = 0-201-07981-X<br /> }} ''The book's webpage includes downloads of the current implementation of Awk and links to others.''<br /> * {{cite book<br /> | last1 = Robbins<br /> | first1 = Arnold<br /> | authorlink1 =<br /> | title = Effective awk Programming<br /> | url = http://www.oreilly.com/catalog/awkprog3/<br /> | accessdate = 2009-04-16<br /> | edition = 3rd<br /> | date = 2001-05-15<br /> | publisher = [[O'Reilly Media]]<br /> | location = Sebastopol, CA<br /> | isbn = 0-596-00070-7<br /> }}<br /> * {{cite book<br /> | last1 = Dougherty<br /> | first1 = Dale<br /> | authorlink1 = Dale Dougherty<br /> | last2 = Robbins<br /> | first2 = Arnold<br /> | authorlink2 =<br /> | title = sed &amp; awk<br /> | url = http://www.oreilly.com/catalog/sed2/<br /> | accessdate = 2009-04-16<br /> | edition = 2nd<br /> | date = 1997-03-01<br /> | publisher = O'Reilly Media<br /> | location = Sebastopol, CA<br /> | isbn = 1-56592-225-5<br /> }}<br /> * {{cite book<br /> | last1 = Robbins<br /> | first1 = Arnold<br /> | authorlink1 =<br /> | title = Effective Awk Programming: A User's Guide for Gnu Awk<br /> | url = https://www.gnu.org/software/gawk/manual/<br /> | accessdate = 2009-04-16<br /> | edition = 1.0.3<br /> | year = 2000<br /> | publisher = [[iUniverse]]<br /> | location = Bloomington, IN<br /> | isbn = 0-595-10034-1<br /> | archiveurl= https://web.archive.org/web/20090412190359/https://www.gnu.org/software/gawk/manual/| archivedate= 12 April 2009 &lt;!--DASHBot--&gt;| deadurl= no}} ''Arnold Robbins maintained the GNU Awk implementation of AWK for more than 10 years. The free GNU Awk manual was also published by O'Reilly in May 2001. Free download of this manual is possible through the following book references.''<br /> <br /> == See also ==<br /> <br /> * [[Data transformation]]<br /> * [[Event-driven programming]]<br /> * [[List of Unix commands]]<br /> * [[Procedural programming]]<br /> * [[sed]]<br /> <br /> == References ==<br /> <br /> {{reflist|30em}}<br /> <br /> == Further reading ==<br /> <br /> * {{cite web<br /> | url = http://www.computerworld.com.au/article/216844<br /> | title = The A-Z of Programming Languages: AWK<br /> | accessdate = 2009-04-16<br /> | last = Hamilton<br /> | first = Naomi<br /> | date = 2008-05-27<br /> | publisher = [[Computerworld]]<br /> }}&amp;nbsp;– Interview with Alfred V. Aho on AWK<br /> * {{cite web<br /> | url = http://www.ibm.com/developerworks/library/l-awk1/<br /> | title = Awk by example, Part 1: An intro to the great language with the strange name<br /> | accessdate = 2009-04-16<br /> | last = Robbins<br /> | first = Daniel<br /> | authorlink = Daniel Robbins (computer programmer)<br /> | date = 2000-12-01<br /> | work = Common threads<br /> | publisher = [[IBM DeveloperWorks]]<br /> }}<br /> * {{cite web<br /> | url = http://www.ibm.com/developerworks/library/l-awk2/<br /> | title = Awk by example, Part 2: Records, loops, and arrays<br /> | accessdate = 2009-04-16<br /> | last = Robbins<br /> | first = Daniel<br /> | date = 2001-01-01<br /> | work = Common threads<br /> | publisher = IBM DeveloperWorks<br /> }}<br /> * {{cite web<br /> | url = http://www.ibm.com/developerworks/library/l-awk3/<br /> | title = Awk by example, Part 3: String functions and ... checkbooks?<br /> | accessdate = 2009-04-16<br /> | last = Robbins<br /> | first = Daniel<br /> | date = 2001-04-01<br /> | work = Common threads<br /> | publisher = IBM DeveloperWorks<br /> | archiveurl= https://web.archive.org/web/20090519074032/http://www.ibm.com/developerworks/linux/library/l-awk3.html| archivedate= 19 May 2009 &lt;!--DASHBot--&gt;| deadurl= no}}<br /> * [http://www.think-lamp.com/2008/10/awk-a-boon-for-cli-enthusiasts/ AWK &amp;nbsp;– Become an expert in 60 minutes]<br /> * {{man|cu|awk|SUS|pattern scanning and processing language}}<br /> * {{man|1|gawk|Linux}}<br /> * [https://www.gnu.org/software/gawk/manual/gawkinet/ Gawkinet]: TCP/IP Internetworking with Gawk<br /> <br /> == External links ==<br /> <br /> {{Wikibooks|An Awk Primer}}<br /> * [http://doc.cat-v.org/henry_spencer/amazing_awk_assembler/ The Amazing Awk Assembler] by [[Henry Spencer]].<br /> * [http://awk.info/ Awk Community Portal]<br /> * [http://en.flossmanuals.net/command-line/ch044_awk Awk on flossmanuals.net]<br /> * {{Dmoz|Computers/Programming/Languages/Awk}}<br /> * [https://github.com/danfuzz/one-true-awk Git repository of the direct lineage of the original AWK source code]<br /> <br /> {{unix commands}}<br /> <br /> {{DEFAULTSORT:Awk}}<br /> [[Category:Pattern matching programming languages]]<br /> [[Category:Scripting languages]]<br /> [[Category:Text-oriented programming languages]]<br /> [[Category:Free compilers and interpreters]]<br /> [[Category:Unix text processing utilities]]<br /> [[Category:Standard Unix programs]]<br /> [[Category:Unix SUS2008 utilities]]<br /> [[Category:Cross-platform software]]<br /> [[Category:1977 software]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Metaobject&diff=718945631 Metaobject 2016-05-06T16:26:02Z <p>PuercoPop: /* Runtime and compile time */ Change wording to remove false claim that initial implementations of MOP where on interpreted implementations</p> <hr /> <div>In [[computer science]], a '''metaobject''' is an [[Object (computer science)|object]] that manipulates, creates, describes, or implements other objects (including itself). The object that the metaobject is about is called the base object. Some information that a metaobject might store is the base object's [[Type system|type]], [[Interface (computer science)|interface]], [[class (computer science)|class]], [[method (computer science)|method]]s, [[Attribute (computing)|attributes]], [[parse tree]], etc. Metaobjects are examples of the computer science concept of [[Reflection (computer programming)|reflection]], where a system has access (usually at run time) to its internal structure. Reflection enables a system to essentially rewrite itself on the fly, to change the actual structure of the system as it executes.&lt;ref&gt;{{cite journal|last=Smith|first=Brian C|title=PROCEDURAL REFLECTION IN PROGRAMMING LANGUAGES|journal=MIT Technical Report|date=1982-01-01|issue=MIT-LCS-TR-272|url=http://publications.csail.mit.edu/lcs/specpub.php?id=840|accessdate=16 December 2013}}&lt;/ref&gt;<br /> <br /> == Metaobject protocol ==<br /> A '''metaobject protocol''' (MOP) provides the vocabulary to access and manipulate the structure and behavior of objects. Typical functions of a metaobject protocol include:&lt;ref&gt;{{cite journal|last=Foote|first=Brian|author2=Ralph Johnson|title=Reflective Facilities in Smalltalk-80|journal=OOPSLA '89|date=1–6 October 1989|url=http://www.laputan.org/ref89/ref89.html|accessdate=16 December 2013}}&lt;/ref&gt;<br /> *Creating and deleting new classes<br /> *Creating new methods and properties<br /> *Changing the class structure so that classes inherit from different classes<br /> *Generating or modifying the code that defines the methods for the class<br /> <br /> The metaobject protocol is contrary to the &quot;closed&quot; aspect of Bertrand Meyer's [[open/closed principle]]. It reveals and allows a system to modify the internal structure of the objects. For this reason it is usually used sparingly and for special circumstances such as software that transforms other software, for example for reverse engineering.&lt;ref&gt;{{cite book|last=Favre|first=Lilliana|title=MDA-Based Reverse Engineering of Object Oriented Code|year=2009|publisher=Springer|isbn=978-3-642-01861-9|url=http://link.springer.com/chapter/10.1007%2F978-3-642-01862-6_21|author2=Liliana Martinez |author3=Claudia Pereira }}&lt;/ref&gt;<br /> <br /> === Runtime and compile time ===<br /> When compilation is not available at run-time there are additional complications for the implementation of metaobject protocol. For example, it is possible to change the type hierarchy with such a protocol but doing so may cause problems for code compiled with an alternative class model definition. Some environments have found innovative solutions for this, e.g., by handling metaobject issues at compile time. A good example is the product [[OpenC++ (software tool)|OpenC++]].&lt;ref&gt;{{cite journal|last=Chiba|first=Shigeru|title=A Metaobject Protocol for C++|journal=OOPSLA '95|year=1995|url=http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.15.7049|accessdate=27 December 2013}}&lt;/ref&gt;<br /> <br /> It is noteworthy that the Semantic web object-oriented model is more dynamic and consistent with run time metaobject protocols. For example, in the Semantic web model classes are expected to change their relations to each other and there is a special [[inference engine]] known as a classifier that can validate and analyze evolving class models.&lt;ref&gt;{{cite web|url=http://www.w3.org/2001/sw/BestPractices/SE/ODSD/|title=A Semantic Web Primer for Object-Oriented Software Developers|last1=Knublauch|first1=Holger|last2=Oberle|first2=Daniel|last3=Tetlow|first3=Phil|last4=Wallace|first4=Evan|publisher=[[W3C]]|date=2006-03-09|accessdate=2008-07-30}}&lt;/ref&gt;<br /> <br /> === Usage ===<br /> The first metaobject protocol was in the [[Smalltalk]] object-oriented programming language developed at [[Xerox PARC]]. The [[Common Lisp Object System]] (CLOS) came later and was influenced by the Smalltalk protocol. The CLOS model, unlike the Smalltalk model, allowed a class to have more than one superclass. This provides additional complexity in issues such as resolving which class has responsibility for handling messages defined on two different superclasses. One of the most influential books describing the metaobject protocol in CLOS was ''[[The Art of the Metaobject Protocol]]'' by [[Gregor Kiczales]].&lt;ref&gt;{{cite book|last=Kiczales|first=Gregor|title=The Art of the Metaobject Protocol|publisher=The MIT Press|isbn=978-0262610742|author2=Jim des Rivieres |author3=Daniel G. Bobrow |date=July 30, 1991}}&lt;/ref&gt;<br /> <br /> Metaobject protocols were also extensively used in software engineering applications. In virtually all commercial CASE, reengineering, and Integrated Development Environments there is some form of metaobject protocol to represent and manipulate the design artifacts.&lt;ref&gt;{{cite journal|last=Johnson|first=Lewis|author2=David R. Harris |author3=Kevin M. Benner |author4=Martin S. Feather |title=Aries: The Requirements/Specification Facet for KBSA|journal=Rome Laboratory Final Technical Report|date=October 1992|volume=RL-TR-92-248}}&lt;/ref&gt;&lt;ref&gt;{{cite web|title=The Origin of Refine|url=http://www.metaware.fr/images/pdf/1_Metaware_The_Origin%20of_Refine_Whitepaper.pdf|work=www.metaware.fr|publisher=Metaware White Paper|accessdate=6 January 2014}}&lt;/ref&gt;&lt;ref&gt;{{cite web|title=OMG's MetaObject Facility|url=http://www.omg.org/mof/|work=omg.org|publisher=Object Management Group|accessdate=7 January 2014|archivedate=2013-04-16}}&lt;/ref&gt;<br /> <br /> A metaobject protocol is one way to implement [[aspect-oriented programming]] languages. Many of the early founders of MOPs, including [[Gregor Kiczales]] have since moved on to be the primary advocates for aspect-oriented programming.<br /> <br /> ==See also==<br /> *[[Kind (type theory)]]<br /> *[[Metaclass]]<br /> *[[Javassist]]<br /> *[[Joose (framework)|Joose JavaScript meta object system]]<br /> *[[Moose (Perl)|Moose Perl meta object system]]<br /> *[[OpenC++ (software tool)|OpenC++]]<br /> *[[OpenJava]]<br /> *[[Unified Modeling Language]]: UML<br /> *[[Groovy (programming language)|Groovy]]<br /> <br /> ==References==<br /> {{Reflist}}<br /> <br /> ==External links==<br /> * [http://www.gnu.org/software/guile/docs/goops/MOP-Specification.html#MOP%20Specification The Guile MOP specification (GOOPS, based on Tiny CLOS)]<br /> * [http://www.gnu.org/software/guile/docs/goops/Metaobjects-and-the-Metaobject-Protocol.html Metaobjects and the Metaobject Protocol]<br /> * [http://www.lisp.org/mop/index.html The Common Lisp Object System MetaObject Protocol] (contains two chapters from ''The Art of the Metaobject Protocol'')<br /> * [http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Metaprogramming.html Python 3 Metaprogramming]<br /> <br /> {{Data types}}<br /> <br /> [[Category:Object (computer science)]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Metaobject&diff=718938019 Metaobject 2016-05-06T15:24:03Z <p>PuercoPop: /* Runtime and compile time */</p> <hr /> <div>In [[computer science]], a '''metaobject''' is an [[Object (computer science)|object]] that manipulates, creates, describes, or implements other objects (including itself). The object that the metaobject is about is called the base object. Some information that a metaobject might store is the base object's [[Type system|type]], [[Interface (computer science)|interface]], [[class (computer science)|class]], [[method (computer science)|method]]s, [[Attribute (computing)|attributes]], [[parse tree]], etc. Metaobjects are examples of the computer science concept of [[Reflection (computer programming)|reflection]], where a system has access (usually at run time) to its internal structure. Reflection enables a system to essentially rewrite itself on the fly, to change the actual structure of the system as it executes.&lt;ref&gt;{{cite journal|last=Smith|first=Brian C|title=PROCEDURAL REFLECTION IN PROGRAMMING LANGUAGES|journal=MIT Technical Report|date=1982-01-01|issue=MIT-LCS-TR-272|url=http://publications.csail.mit.edu/lcs/specpub.php?id=840|accessdate=16 December 2013}}&lt;/ref&gt;<br /> <br /> == Metaobject protocol ==<br /> A '''metaobject protocol''' (MOP) provides the vocabulary to access and manipulate the structure and behavior of objects. Typical functions of a metaobject protocol include:&lt;ref&gt;{{cite journal|last=Foote|first=Brian|author2=Ralph Johnson|title=Reflective Facilities in Smalltalk-80|journal=OOPSLA '89|date=1–6 October 1989|url=http://www.laputan.org/ref89/ref89.html|accessdate=16 December 2013}}&lt;/ref&gt;<br /> *Creating and deleting new classes<br /> *Creating new methods and properties<br /> *Changing the class structure so that classes inherit from different classes<br /> *Generating or modifying the code that defines the methods for the class<br /> <br /> The metaobject protocol is contrary to the &quot;closed&quot; aspect of Bertrand Meyer's [[open/closed principle]]. It reveals and allows a system to modify the internal structure of the objects. For this reason it is usually used sparingly and for special circumstances such as software that transforms other software, for example for reverse engineering.&lt;ref&gt;{{cite book|last=Favre|first=Lilliana|title=MDA-Based Reverse Engineering of Object Oriented Code|year=2009|publisher=Springer|isbn=978-3-642-01861-9|url=http://link.springer.com/chapter/10.1007%2F978-3-642-01862-6_21|author2=Liliana Martinez |author3=Claudia Pereira }}&lt;/ref&gt;<br /> <br /> === Runtime and compile time ===<br /> The original object-oriented languages with metaobject capabilities (e.g., Smalltalk and CLOS) were in interpreted environments so compilation was not an issue{{citation needed}}. Compilation brings additional complications for a metaobject protocol. For example, it is possible to change the type hierarchy with such a protocol but doing so may cause problems for code compiled with an alternative class model definition. Some environments have found innovative solutions for this, e.g., by handling metaobject issues at compile time. A good example is the product [[OpenC++ (software tool)|OpenC++]].&lt;ref&gt;{{cite journal|last=Chiba|first=Shigeru|title=A Metaobject Protocol for C++|journal=OOPSLA '95|year=1995|url=http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.15.7049|accessdate=27 December 2013}}&lt;/ref&gt;<br /> <br /> It is noteworthy that the Semantic web object-oriented model is more dynamic and consistent with run time metaobject protocols. For example, in the Semantic web model classes are expected to change their relations to each other and there is a special [[inference engine]] known as a classifier that can validate and analyze evolving class models.&lt;ref&gt;{{cite web|url=http://www.w3.org/2001/sw/BestPractices/SE/ODSD/|title=A Semantic Web Primer for Object-Oriented Software Developers|last1=Knublauch|first1=Holger|last2=Oberle|first2=Daniel|last3=Tetlow|first3=Phil|last4=Wallace|first4=Evan|publisher=[[W3C]]|date=2006-03-09|accessdate=2008-07-30}}&lt;/ref&gt;<br /> <br /> === Usage ===<br /> The first metaobject protocol was in the [[Smalltalk]] object-oriented programming language developed at [[Xerox PARC]]. The [[Common Lisp Object System]] (CLOS) came later and was influenced by the Smalltalk protocol. The CLOS model, unlike the Smalltalk model, allowed a class to have more than one superclass. This provides additional complexity in issues such as resolving which class has responsibility for handling messages defined on two different superclasses. One of the most influential books describing the metaobject protocol in CLOS was ''[[The Art of the Metaobject Protocol]]'' by [[Gregor Kiczales]].&lt;ref&gt;{{cite book|last=Kiczales|first=Gregor|title=The Art of the Metaobject Protocol|publisher=The MIT Press|isbn=978-0262610742|author2=Jim des Rivieres |author3=Daniel G. Bobrow |date=July 30, 1991}}&lt;/ref&gt;<br /> <br /> Metaobject protocols were also extensively used in software engineering applications. In virtually all commercial CASE, reengineering, and Integrated Development Environments there is some form of metaobject protocol to represent and manipulate the design artifacts.&lt;ref&gt;{{cite journal|last=Johnson|first=Lewis|author2=David R. Harris |author3=Kevin M. Benner |author4=Martin S. Feather |title=Aries: The Requirements/Specification Facet for KBSA|journal=Rome Laboratory Final Technical Report|date=October 1992|volume=RL-TR-92-248}}&lt;/ref&gt;&lt;ref&gt;{{cite web|title=The Origin of Refine|url=http://www.metaware.fr/images/pdf/1_Metaware_The_Origin%20of_Refine_Whitepaper.pdf|work=www.metaware.fr|publisher=Metaware White Paper|accessdate=6 January 2014}}&lt;/ref&gt;&lt;ref&gt;{{cite web|title=OMG's MetaObject Facility|url=http://www.omg.org/mof/|work=omg.org|publisher=Object Management Group|accessdate=7 January 2014|archivedate=2013-04-16}}&lt;/ref&gt;<br /> <br /> A metaobject protocol is one way to implement [[aspect-oriented programming]] languages. Many of the early founders of MOPs, including [[Gregor Kiczales]] have since moved on to be the primary advocates for aspect-oriented programming.<br /> <br /> ==See also==<br /> *[[Kind (type theory)]]<br /> *[[Metaclass]]<br /> *[[Javassist]]<br /> *[[Joose (framework)|Joose JavaScript meta object system]]<br /> *[[Moose (Perl)|Moose Perl meta object system]]<br /> *[[OpenC++ (software tool)|OpenC++]]<br /> *[[OpenJava]]<br /> *[[Unified Modeling Language]]: UML<br /> *[[Groovy (programming language)|Groovy]]<br /> <br /> ==References==<br /> {{Reflist}}<br /> <br /> ==External links==<br /> * [http://www.gnu.org/software/guile/docs/goops/MOP-Specification.html#MOP%20Specification The Guile MOP specification (GOOPS, based on Tiny CLOS)]<br /> * [http://www.gnu.org/software/guile/docs/goops/Metaobjects-and-the-Metaobject-Protocol.html Metaobjects and the Metaobject Protocol]<br /> * [http://www.lisp.org/mop/index.html The Common Lisp Object System MetaObject Protocol] (contains two chapters from ''The Art of the Metaobject Protocol'')<br /> * [http://python-3-patterns-idioms-test.readthedocs.org/en/latest/Metaprogramming.html Python 3 Metaprogramming]<br /> <br /> {{Data types}}<br /> <br /> [[Category:Object (computer science)]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Reflective_programming&diff=714459336 Reflective programming 2016-04-09T21:56:13Z <p>PuercoPop: Remove left over closing parenthesis</p> <hr /> <div>In [[computer science]], '''reflection''' is the ability of a [[computer program]] to examine, [[ Introspection_(computer_science) |Introspection]], and modify its own structure and behavior, intercession.&lt;ref&gt;[http://www2.parc.com/csl/groups/sda/projects/reflection96/docs/malenfant/malenfant.pdf A Tutorial on Behavioral Reflection and its Implementation by Jacques Malenfant et al.]&lt;/ref&gt;<br /> <br /> ==Historical background==<br /> <br /> The earliest computers were programmed in their native [[assembly language]], which were inherently reflective as these original architectures could be programmed by defining instructions as data and using [[self-modifying code]]. As programming moved to higher-level languages such as C, this reflective ability disappeared (outside of [[malware]]) until programming languages with reflection built into their type systems appeared.{{Citation needed|date=July 2015}} <br /> <br /> [[Brian Cantwell Smith]]'s 1982 doctoral dissertation&lt;ref&gt;[http://hdl.handle.net/1721.1/15961 Brian Cantwell Smith, Procedural Reflection in Programming Languages, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, PhD Thesis, 1982.]&lt;/ref&gt;&lt;ref&gt;[http://publications.csail.mit.edu/lcs/specpub.php?id=840 Brian C. Smith. Reflection and semantics in a procedural language. Technical Report MIT-LCS-TR-272, Massachusetts Institute of Technology, Cambridge, Mass., January 1982.]&lt;/ref&gt; introduced the notion of computational reflection in [[programming languages]], and the notion of the [[meta-circular interpreter]] as a component of [[3-Lisp]].<br /> <br /> ==Uses==<br /> <br /> Reflection can be used for observing and modifying program execution at runtime. A reflection-oriented program component can monitor the execution of an enclosure of code and can modify itself according to a desired goal related to that enclosure. This is typically accomplished by dynamically assigning program code at runtime.<br /> <br /> In object oriented programming languages such as [[Java (programming language)|Java]], reflection allows ''inspection'' of classes, interfaces, fields and methods at runtime without knowing the names of the interfaces, fields, methods at compile time. It also allows ''instantiation'' of new objects and ''invocation'' of methods.<br /> <br /> Reflection can be used to adapt a given program to different situations dynamically. Reflection-oriented programming almost always requires additional knowledge, framework, relational mapping, and object relevance in order to take advantage of more generic code execution.<br /> <br /> Reflection is often used as part of [[software testing]], such as for the runtime creation/instantiation of [[mock object]]s.<br /> <br /> Reflection is also a key strategy for [[metaprogramming]].<br /> <br /> In some object-oriented programming languages, such as [[C Sharp (programming language)|C#]] and [[Java (programming language)|Java]], reflection can be used to override [[member accessibility]] rules. For example, reflection makes it possible to change the value of a field marked &quot;private&quot; in a third-party library's class.<br /> <br /> ==Implementation==<br /> {{Unreferenced section|date=January 2008}}<br /> A language supporting reflection provides a number of features available at runtime that would otherwise be difficult to accomplish in a lower-level language. Some of these features are the abilities to:<br /> <br /> *Discover and modify source code constructions (such as code blocks, [[Class (computer science)|classes]], methods, protocols, etc.) as a [[first-class object]] at runtime.<br /> *Convert a [[string (computer science)|string]] matching the symbolic name of a class or function into a reference to or invocation of that class or function.<br /> *Evaluate a string as if it were a source code statement at runtime.<br /> *Create a new interpreter for the language's bytecode to give a new meaning or purpose for a programming construct.<br /> <br /> These features can be implemented in different ways. In [[MOO (programming language)|MOO]], reflection forms a natural part of everyday programming idiom. When verbs (methods) are called, various variables such as ''verb'' (the name of the verb being called) and ''this'' (the object on which the verb is called) are populated to give the context of the call. Security is typically managed by accessing the caller stack programmatically: Since ''callers()'' is a list of the methods by which the current verb was eventually called, performing tests on callers()[1] (the command invoked by the original user) allows the verb to protect itself against unauthorised use.<br /> <br /> Compiled languages rely on their runtime system to provide information about the source code. A compiled [[Objective-C]] executable, for example, records the names of all methods in a block of the executable, providing a table to correspond these with the underlying methods (or [[selector]]s for these methods) compiled into the program. In a compiled language that supports runtime creation of functions, such as [[Common Lisp]], the runtime environment must include a compiler or an interpreter.<br /> <br /> Reflection can be implemented for languages not having built-in reflection facilities by using a [[program transformation]] system to define automated source code changes.<br /> <br /> ==Examples==<br /> The following code snippets create an [[instance (computer science)|instance]] &lt;code&gt;foo&lt;/code&gt; of [[class (computer science)|class]] &lt;code&gt;Foo&lt;/code&gt;, and invoke its [[method (computer science)|method]] &lt;code&gt;hello&lt;/code&gt;. For each [[programming language]], normal and reflection-based call sequences are shown.<br /> <br /> ===eC===<br /> The following is an example in [[eC (programming language)|eC]]:<br /> &lt;source lang=&quot;ec&quot;&gt;// without reflection<br /> Foo foo { };<br /> foo.hello();<br /> <br /> // with reflection<br /> Class fooClass = eSystem_FindClass(__thisModule, &quot;Foo&quot;);<br /> Instance foo = eInstance_New(fooClass);<br /> Method m = eClass_FindMethod(fooClass, &quot;hello&quot;, fooClass.module);<br /> ((void (*)())(void *)m.function)(foo);&lt;/source&gt;<br /> <br /> ===ECMAScript===<br /> The following is an example in [[ECMAScript]], and therefore also applies to [[JavaScript]] and [[ActionScript]]:<br /> &lt;source lang=&quot;ecmascript&quot;&gt;<br /> // Without reflection<br /> new Foo().hello()<br /> <br /> // With reflection<br /> <br /> // assuming that Foo resides in this<br /> new this['Foo']()['hello']()<br /> <br /> // or without assumption<br /> new (eval('Foo'))()['hello']()<br /> <br /> // or simply<br /> eval('new Foo().hello()')<br /> <br /> // Using ECMAScript 2015's new Reflect class:<br /> Reflect.construct(Foo, [])['hello']()<br /> &lt;/source&gt;<br /> <br /> ===Go===<br /> <br /> The following is an example in [[Go (programming language)|Go]]:<br /> <br /> &lt;source lang=&quot;go&quot;&gt;<br /> import &quot;reflect&quot;<br /> <br /> // without reflection<br /> f := Foo{}<br /> f.Hello()<br /> <br /> // with reflection<br /> fT := reflect.TypeOf(Foo{})<br /> fV := reflect.New(fT)<br /> <br /> m := fV.MethodByName(&quot;Hello&quot;)<br /> if m.IsValid() {<br /> m.Call(nil)<br /> }<br /> &lt;/source&gt;<br /> <br /> ===Java===<br /> The following is an example in [[Java (programming language)|Java]]:<br /> &lt;source lang=&quot;java&quot;&gt;<br /> <br /> // without reflection<br /> Foo foo = new Foo();<br /> foo.hello();<br /> <br /> // with reflection<br /> Object foo = Class.forName(&quot;complete.classpath.and.Foo&quot;).newInstance();<br /> // Alternatively: Object foo = Foo.class.newInstance();<br /> Method m = foo.getClass().getDeclaredMethod(&quot;hello&quot;, new Class&lt;?&gt;[0]);<br /> m.invoke(foo);<br /> <br /> &lt;/source&gt;<br /> <br /> ===Objective-C===<br /> The following is an example in [[Objective-C]]—implying either the [[OpenStep]] or [[Foundation Kit]] framework is used:<br /> &lt;source lang=&quot;objc&quot;&gt;<br /> // Foo class.<br /> @interface Foo : NSObject<br /> - (void)hello;<br /> @end<br /> <br /> // Sending &quot;hello&quot; to a Foo instance without reflection.<br /> Foo *obj = [[Foo alloc] init];<br /> [obj hello];<br /> <br /> // Sending &quot;hello&quot; to a Foo instance with reflection.<br /> id obj = [[NSClassFromString(@&quot;Foo&quot;) alloc] init];<br /> [obj performSelector: @selector(hello)];<br /> <br /> &lt;/source&gt;<br /> <br /> ===Delphi===<br /> <br /> This [[Embarcadero Delphi|Delphi]] example assumes a TFoo class has been declared in a unit called Unit1:<br /> &lt;source lang=&quot;Delphi&quot;&gt;<br /> uses RTTI, Unit1;<br /> <br /> procedure WithoutReflection;<br /> var<br /> Foo: TFoo;<br /> begin<br /> Foo := TFoo.Create;<br /> try<br /> Foo.Hello;<br /> finally<br /> Foo.Free;<br /> end;<br /> end;<br /> <br /> procedure WithReflection;<br /> var<br /> RttiContext: TRttiContext;<br /> RttiType: TRttiInstanceType;<br /> Foo: TObject;<br /> begin<br /> RttiType := RttiContext.FindType('Unit1.TFoo') as TRttiInstanceType;<br /> Foo := RttiType.GetMethod('Create').Invoke(RttiType.MetaclassType, []).AsObject;<br /> try<br /> RttiType.GetMethod('Hello').Invoke(Foo, []);<br /> finally<br /> Foo.Free;<br /> end;<br /> end;<br /> &lt;/source&gt;<br /> <br /> This is a notable example since Delphi is an unmanaged, fully natively compiled language, unlike most other languages that support reflection. Its language architecture inherits from strongly-typed Pascal, but with significant influence from SmallTalk. Compare with the other examples here, many of which are dynamic or script languages like Perl, Python or PHP, or languages with a runtime like Java or C#.<br /> <br /> ===Perl===<br /> The following is an example in [[Perl (programming language)|Perl]]:<br /> <br /> &lt;syntaxhighlight lang=perl&gt;<br /> <br /> # without reflection<br /> my $foo = Foo-&gt;new;<br /> $foo-&gt;hello;<br /> <br /> # or<br /> Foo-&gt;new-&gt;hello;<br /> <br /> # with reflection<br /> my $class = &quot;Foo&quot;<br /> my $constructor = &quot;new&quot;;<br /> my $method = &quot;hello&quot;;<br /> <br /> my $f = $class-&gt;$constructor;<br /> $f-&gt;$method;<br /> <br /> # or<br /> $class-&gt;$constructor-&gt;$method;<br /> <br /> # with eval<br /> eval &quot;new Foo-&gt;hello;&quot;;<br /> <br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===PHP===<br /> The following is an example in [[PHP]]:<br /> &lt;syntaxhighlight lang=php&gt;<br /> // without reflection<br /> $foo = new Foo();<br /> $foo-&gt;hello();<br /> <br /> // with reflection<br /> $reflector = new ReflectionClass('Foo');<br /> $foo = $reflector-&gt;newInstance();<br /> $hello = $reflector-&gt;getMethod('hello');<br /> $hello-&gt;invoke($foo);<br /> <br /> // using callback<br /> $foo = new Foo();<br /> call_user_func(array($foo, 'hello'));<br /> <br /> // using variable variables syntax<br /> $className = 'Foo';<br /> $foo = new $className();<br /> $method = 'hello';<br /> $foo-&gt;$method();<br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===Python===<br /> The following is an example in [[Python (programming language)|Python]]:<br /> &lt;syntaxhighlight lang=python&gt;<br /> <br /> # without reflection<br /> obj = Foo()<br /> obj.hello()<br /> <br /> # with reflection<br /> class_name = &quot;Foo&quot;<br /> method = &quot;hello&quot;<br /> obj = globals()[class_name]()<br /> getattr(obj, method)()<br /> <br /> # with eval<br /> eval(&quot;Foo().hello()&quot;)<br /> <br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===R===<br /> The following is an example in [[R (programming language)|R]]:<br /> &lt;source lang=&quot;rsplus&quot;&gt;<br /> # Without reflection, assuming foo() returns an S3-type object that has method &quot;hello&quot;<br /> obj &lt;- foo()<br /> hello(obj)<br /> <br /> # With reflection<br /> the.class &lt;- &quot;foo&quot;<br /> the.method &lt;- &quot;hello&quot;<br /> obj &lt;- do.call(the.class, list())<br /> do.call(the.method, alist(obj))<br /> <br /> &lt;/source&gt;<br /> <br /> ===Ruby===<br /> The following is an example in [[Ruby (Programming Language)|Ruby]]:<br /> &lt;syntaxhighlight lang=ruby&gt;<br /> <br /> # without reflection<br /> obj = Foo.new<br /> obj.hello<br /> <br /> # with reflection<br /> class_name = &quot;Foo&quot;<br /> method_name = :hello<br /> obj = Object.const_get(class_name).new<br /> obj.send method_name<br /> <br /> # with eval<br /> eval &quot;Foo.new.hello&quot;<br /> <br /> &lt;/syntaxhighlight&gt;<br /> <br /> ==See also==<br /> *[[Type introspection]]<br /> *[[Self-modifying code]]<br /> *[[Self-hosting]]<br /> *[[Programming paradigm]]s<br /> *[[List of reflective programming languages and platforms]]<br /> *[[Mirror (programming)]]<br /> <br /> ==References==<br /> '''Notes'''<br /> {{reflist}}<br /> '''Documents'''<br /> * Jonathan M. Sobel and Daniel P. Friedman. [http://web.archive.org/web/20100204091328/http://www.cs.indiana.edu/~jsobel/rop.html ''An Introduction to Reflection-Oriented Programming''] (1996), Indiana University.<br /> <br /> ==Further reading==<br /> * Ira R. Forman and Nate Forman, ''Java Reflection in Action'' (2005), ISBN 1-932394-18-4<br /> * Ira R. Forman and Scott Danforth, ''Putting Metaclasses to Work'' (1999), ISBN 0-201-43305-2<br /> <br /> ==External links==<br /> *[https://www-master.ufr-info-p6.jussieu.fr/2007/Ajouts/Master_esj20_2007_2008/IMG/pdf/malenfant-ijcai95.pdf Reflection in logic, functional and object-oriented programming: a short comparative study]<br /> *[http://web.archive.org/web/20100204091328/http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]<br /> *[http://www.laputan.org/#Reflection Brian Foote's pages on Reflection in Smalltalk]<br /> *[http://docs.oracle.com/javase/tutorial/reflect/index.html Java Reflection API Tutorial] from Oracle<br /> {{Programming language}}<br /> <br /> {{DEFAULTSORT:Reflection (Computer Programming)}}<br /> [[ Category:Programming constructs]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Reflective_programming&diff=714457093 Reflective programming 2016-04-09T21:38:39Z <p>PuercoPop: Better sumarize the two properties of reflection, introspection and intercession.</p> <hr /> <div>In [[computer science]], '''reflection''' is the ability of a [[computer program]] to examine, [[ Introspection_(computer_science) |Introspection]]), and modify its own structure and behavior, intercession.&lt;ref&gt;[http://www2.parc.com/csl/groups/sda/projects/reflection96/docs/malenfant/malenfant.pdf A Tutorial on Behavioral Reflection and its Implementation by Jacques Malenfant et al.]&lt;/ref&gt;<br /> <br /> ==Historical background==<br /> <br /> The earliest computers were programmed in their native [[assembly language]], which were inherently reflective as these original architectures could be programmed by defining instructions as data and using [[self-modifying code]]. As programming moved to higher-level languages such as C, this reflective ability disappeared (outside of [[malware]]) until programming languages with reflection built into their type systems appeared.{{Citation needed|date=July 2015}} <br /> <br /> [[Brian Cantwell Smith]]'s 1982 doctoral dissertation&lt;ref&gt;[http://hdl.handle.net/1721.1/15961 Brian Cantwell Smith, Procedural Reflection in Programming Languages, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, PhD Thesis, 1982.]&lt;/ref&gt;&lt;ref&gt;[http://publications.csail.mit.edu/lcs/specpub.php?id=840 Brian C. Smith. Reflection and semantics in a procedural language. Technical Report MIT-LCS-TR-272, Massachusetts Institute of Technology, Cambridge, Mass., January 1982.]&lt;/ref&gt; introduced the notion of computational reflection in [[programming languages]], and the notion of the [[meta-circular interpreter]] as a component of [[3-Lisp]].<br /> <br /> ==Uses==<br /> <br /> Reflection can be used for observing and modifying program execution at runtime. A reflection-oriented program component can monitor the execution of an enclosure of code and can modify itself according to a desired goal related to that enclosure. This is typically accomplished by dynamically assigning program code at runtime.<br /> <br /> In object oriented programming languages such as [[Java (programming language)|Java]], reflection allows ''inspection'' of classes, interfaces, fields and methods at runtime without knowing the names of the interfaces, fields, methods at compile time. It also allows ''instantiation'' of new objects and ''invocation'' of methods.<br /> <br /> Reflection can be used to adapt a given program to different situations dynamically. Reflection-oriented programming almost always requires additional knowledge, framework, relational mapping, and object relevance in order to take advantage of more generic code execution.<br /> <br /> Reflection is often used as part of [[software testing]], such as for the runtime creation/instantiation of [[mock object]]s.<br /> <br /> Reflection is also a key strategy for [[metaprogramming]].<br /> <br /> In some object-oriented programming languages, such as [[C Sharp (programming language)|C#]] and [[Java (programming language)|Java]], reflection can be used to override [[member accessibility]] rules. For example, reflection makes it possible to change the value of a field marked &quot;private&quot; in a third-party library's class.<br /> <br /> ==Implementation==<br /> {{Unreferenced section|date=January 2008}}<br /> A language supporting reflection provides a number of features available at runtime that would otherwise be difficult to accomplish in a lower-level language. Some of these features are the abilities to:<br /> <br /> *Discover and modify source code constructions (such as code blocks, [[Class (computer science)|classes]], methods, protocols, etc.) as a [[first-class object]] at runtime.<br /> *Convert a [[string (computer science)|string]] matching the symbolic name of a class or function into a reference to or invocation of that class or function.<br /> *Evaluate a string as if it were a source code statement at runtime.<br /> *Create a new interpreter for the language's bytecode to give a new meaning or purpose for a programming construct.<br /> <br /> These features can be implemented in different ways. In [[MOO (programming language)|MOO]], reflection forms a natural part of everyday programming idiom. When verbs (methods) are called, various variables such as ''verb'' (the name of the verb being called) and ''this'' (the object on which the verb is called) are populated to give the context of the call. Security is typically managed by accessing the caller stack programmatically: Since ''callers()'' is a list of the methods by which the current verb was eventually called, performing tests on callers()[1] (the command invoked by the original user) allows the verb to protect itself against unauthorised use.<br /> <br /> Compiled languages rely on their runtime system to provide information about the source code. A compiled [[Objective-C]] executable, for example, records the names of all methods in a block of the executable, providing a table to correspond these with the underlying methods (or [[selector]]s for these methods) compiled into the program. In a compiled language that supports runtime creation of functions, such as [[Common Lisp]], the runtime environment must include a compiler or an interpreter.<br /> <br /> Reflection can be implemented for languages not having built-in reflection facilities by using a [[program transformation]] system to define automated source code changes.<br /> <br /> ==Examples==<br /> The following code snippets create an [[instance (computer science)|instance]] &lt;code&gt;foo&lt;/code&gt; of [[class (computer science)|class]] &lt;code&gt;Foo&lt;/code&gt;, and invoke its [[method (computer science)|method]] &lt;code&gt;hello&lt;/code&gt;. For each [[programming language]], normal and reflection-based call sequences are shown.<br /> <br /> ===eC===<br /> The following is an example in [[eC (programming language)|eC]]:<br /> &lt;source lang=&quot;ec&quot;&gt;// without reflection<br /> Foo foo { };<br /> foo.hello();<br /> <br /> // with reflection<br /> Class fooClass = eSystem_FindClass(__thisModule, &quot;Foo&quot;);<br /> Instance foo = eInstance_New(fooClass);<br /> Method m = eClass_FindMethod(fooClass, &quot;hello&quot;, fooClass.module);<br /> ((void (*)())(void *)m.function)(foo);&lt;/source&gt;<br /> <br /> ===ECMAScript===<br /> The following is an example in [[ECMAScript]], and therefore also applies to [[JavaScript]] and [[ActionScript]]:<br /> &lt;source lang=&quot;ecmascript&quot;&gt;<br /> // Without reflection<br /> new Foo().hello()<br /> <br /> // With reflection<br /> <br /> // assuming that Foo resides in this<br /> new this['Foo']()['hello']()<br /> <br /> // or without assumption<br /> new (eval('Foo'))()['hello']()<br /> <br /> // or simply<br /> eval('new Foo().hello()')<br /> <br /> // Using ECMAScript 2015's new Reflect class:<br /> Reflect.construct(Foo, [])['hello']()<br /> &lt;/source&gt;<br /> <br /> ===Go===<br /> <br /> The following is an example in [[Go (programming language)|Go]]:<br /> <br /> &lt;source lang=&quot;go&quot;&gt;<br /> import &quot;reflect&quot;<br /> <br /> // without reflection<br /> f := Foo{}<br /> f.Hello()<br /> <br /> // with reflection<br /> fT := reflect.TypeOf(Foo{})<br /> fV := reflect.New(fT)<br /> <br /> m := fV.MethodByName(&quot;Hello&quot;)<br /> if m.IsValid() {<br /> m.Call(nil)<br /> }<br /> &lt;/source&gt;<br /> <br /> ===Java===<br /> The following is an example in [[Java (programming language)|Java]]:<br /> &lt;source lang=&quot;java&quot;&gt;<br /> <br /> // without reflection<br /> Foo foo = new Foo();<br /> foo.hello();<br /> <br /> // with reflection<br /> Object foo = Class.forName(&quot;complete.classpath.and.Foo&quot;).newInstance();<br /> // Alternatively: Object foo = Foo.class.newInstance();<br /> Method m = foo.getClass().getDeclaredMethod(&quot;hello&quot;, new Class&lt;?&gt;[0]);<br /> m.invoke(foo);<br /> <br /> &lt;/source&gt;<br /> <br /> ===Objective-C===<br /> The following is an example in [[Objective-C]]—implying either the [[OpenStep]] or [[Foundation Kit]] framework is used:<br /> &lt;source lang=&quot;objc&quot;&gt;<br /> // Foo class.<br /> @interface Foo : NSObject<br /> - (void)hello;<br /> @end<br /> <br /> // Sending &quot;hello&quot; to a Foo instance without reflection.<br /> Foo *obj = [[Foo alloc] init];<br /> [obj hello];<br /> <br /> // Sending &quot;hello&quot; to a Foo instance with reflection.<br /> id obj = [[NSClassFromString(@&quot;Foo&quot;) alloc] init];<br /> [obj performSelector: @selector(hello)];<br /> <br /> &lt;/source&gt;<br /> <br /> ===Delphi===<br /> <br /> This [[Embarcadero Delphi|Delphi]] example assumes a TFoo class has been declared in a unit called Unit1:<br /> &lt;source lang=&quot;Delphi&quot;&gt;<br /> uses RTTI, Unit1;<br /> <br /> procedure WithoutReflection;<br /> var<br /> Foo: TFoo;<br /> begin<br /> Foo := TFoo.Create;<br /> try<br /> Foo.Hello;<br /> finally<br /> Foo.Free;<br /> end;<br /> end;<br /> <br /> procedure WithReflection;<br /> var<br /> RttiContext: TRttiContext;<br /> RttiType: TRttiInstanceType;<br /> Foo: TObject;<br /> begin<br /> RttiType := RttiContext.FindType('Unit1.TFoo') as TRttiInstanceType;<br /> Foo := RttiType.GetMethod('Create').Invoke(RttiType.MetaclassType, []).AsObject;<br /> try<br /> RttiType.GetMethod('Hello').Invoke(Foo, []);<br /> finally<br /> Foo.Free;<br /> end;<br /> end;<br /> &lt;/source&gt;<br /> <br /> This is a notable example since Delphi is an unmanaged, fully natively compiled language, unlike most other languages that support reflection. Its language architecture inherits from strongly-typed Pascal, but with significant influence from SmallTalk. Compare with the other examples here, many of which are dynamic or script languages like Perl, Python or PHP, or languages with a runtime like Java or C#.<br /> <br /> ===Perl===<br /> The following is an example in [[Perl (programming language)|Perl]]:<br /> <br /> &lt;syntaxhighlight lang=perl&gt;<br /> <br /> # without reflection<br /> my $foo = Foo-&gt;new;<br /> $foo-&gt;hello;<br /> <br /> # or<br /> Foo-&gt;new-&gt;hello;<br /> <br /> # with reflection<br /> my $class = &quot;Foo&quot;<br /> my $constructor = &quot;new&quot;;<br /> my $method = &quot;hello&quot;;<br /> <br /> my $f = $class-&gt;$constructor;<br /> $f-&gt;$method;<br /> <br /> # or<br /> $class-&gt;$constructor-&gt;$method;<br /> <br /> # with eval<br /> eval &quot;new Foo-&gt;hello;&quot;;<br /> <br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===PHP===<br /> The following is an example in [[PHP]]:<br /> &lt;syntaxhighlight lang=php&gt;<br /> // without reflection<br /> $foo = new Foo();<br /> $foo-&gt;hello();<br /> <br /> // with reflection<br /> $reflector = new ReflectionClass('Foo');<br /> $foo = $reflector-&gt;newInstance();<br /> $hello = $reflector-&gt;getMethod('hello');<br /> $hello-&gt;invoke($foo);<br /> <br /> // using callback<br /> $foo = new Foo();<br /> call_user_func(array($foo, 'hello'));<br /> <br /> // using variable variables syntax<br /> $className = 'Foo';<br /> $foo = new $className();<br /> $method = 'hello';<br /> $foo-&gt;$method();<br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===Python===<br /> The following is an example in [[Python (programming language)|Python]]:<br /> &lt;syntaxhighlight lang=python&gt;<br /> <br /> # without reflection<br /> obj = Foo()<br /> obj.hello()<br /> <br /> # with reflection<br /> class_name = &quot;Foo&quot;<br /> method = &quot;hello&quot;<br /> obj = globals()[class_name]()<br /> getattr(obj, method)()<br /> <br /> # with eval<br /> eval(&quot;Foo().hello()&quot;)<br /> <br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===R===<br /> The following is an example in [[R (programming language)|R]]:<br /> &lt;source lang=&quot;rsplus&quot;&gt;<br /> # Without reflection, assuming foo() returns an S3-type object that has method &quot;hello&quot;<br /> obj &lt;- foo()<br /> hello(obj)<br /> <br /> # With reflection<br /> the.class &lt;- &quot;foo&quot;<br /> the.method &lt;- &quot;hello&quot;<br /> obj &lt;- do.call(the.class, list())<br /> do.call(the.method, alist(obj))<br /> <br /> &lt;/source&gt;<br /> <br /> ===Ruby===<br /> The following is an example in [[Ruby (Programming Language)|Ruby]]:<br /> &lt;syntaxhighlight lang=ruby&gt;<br /> <br /> # without reflection<br /> obj = Foo.new<br /> obj.hello<br /> <br /> # with reflection<br /> class_name = &quot;Foo&quot;<br /> method_name = :hello<br /> obj = Object.const_get(class_name).new<br /> obj.send method_name<br /> <br /> # with eval<br /> eval &quot;Foo.new.hello&quot;<br /> <br /> &lt;/syntaxhighlight&gt;<br /> <br /> ==See also==<br /> *[[Type introspection]]<br /> *[[Self-modifying code]]<br /> *[[Self-hosting]]<br /> *[[Programming paradigm]]s<br /> *[[List of reflective programming languages and platforms]]<br /> *[[Mirror (programming)]]<br /> <br /> ==References==<br /> '''Notes'''<br /> {{reflist}}<br /> '''Documents'''<br /> * Jonathan M. Sobel and Daniel P. Friedman. [http://web.archive.org/web/20100204091328/http://www.cs.indiana.edu/~jsobel/rop.html ''An Introduction to Reflection-Oriented Programming''] (1996), Indiana University.<br /> <br /> ==Further reading==<br /> * Ira R. Forman and Nate Forman, ''Java Reflection in Action'' (2005), ISBN 1-932394-18-4<br /> * Ira R. Forman and Scott Danforth, ''Putting Metaclasses to Work'' (1999), ISBN 0-201-43305-2<br /> <br /> ==External links==<br /> *[https://www-master.ufr-info-p6.jussieu.fr/2007/Ajouts/Master_esj20_2007_2008/IMG/pdf/malenfant-ijcai95.pdf Reflection in logic, functional and object-oriented programming: a short comparative study]<br /> *[http://web.archive.org/web/20100204091328/http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]<br /> *[http://www.laputan.org/#Reflection Brian Foote's pages on Reflection in Smalltalk]<br /> *[http://docs.oracle.com/javase/tutorial/reflect/index.html Java Reflection API Tutorial] from Oracle<br /> {{Programming language}}<br /> <br /> {{DEFAULTSORT:Reflection (Computer Programming)}}<br /> [[ Category:Programming constructs]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Reflective_programming&diff=714455880 Reflective programming 2016-04-09T21:29:20Z <p>PuercoPop: Reflection is not limited to run-time.</p> <hr /> <div>In [[computer science]], '''reflection''' is the ability of a [[computer program]] to examine (see [[type introspection]]) and modify its own structure and behavior (specifically the values, meta-data, properties and functions).&lt;ref&gt;[http://www2.parc.com/csl/groups/sda/projects/reflection96/docs/malenfant/malenfant.pdf A Tutorial on Behavioral Reflection and its Implementation by Jacques Malenfant et al.]&lt;/ref&gt;<br /> <br /> ==Historical background==<br /> <br /> The earliest computers were programmed in their native [[assembly language]], which were inherently reflective as these original architectures could be programmed by defining instructions as data and using [[self-modifying code]]. As programming moved to higher-level languages such as C, this reflective ability disappeared (outside of [[malware]]) until programming languages with reflection built into their type systems appeared.{{Citation needed|date=July 2015}} <br /> <br /> [[Brian Cantwell Smith]]'s 1982 doctoral dissertation&lt;ref&gt;[http://hdl.handle.net/1721.1/15961 Brian Cantwell Smith, Procedural Reflection in Programming Languages, Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, PhD Thesis, 1982.]&lt;/ref&gt;&lt;ref&gt;[http://publications.csail.mit.edu/lcs/specpub.php?id=840 Brian C. Smith. Reflection and semantics in a procedural language. Technical Report MIT-LCS-TR-272, Massachusetts Institute of Technology, Cambridge, Mass., January 1982.]&lt;/ref&gt; introduced the notion of computational reflection in [[programming languages]], and the notion of the [[meta-circular interpreter]] as a component of [[3-Lisp]].<br /> <br /> ==Uses==<br /> <br /> Reflection can be used for observing and modifying program execution at runtime. A reflection-oriented program component can monitor the execution of an enclosure of code and can modify itself according to a desired goal related to that enclosure. This is typically accomplished by dynamically assigning program code at runtime.<br /> <br /> In object oriented programming languages such as [[Java (programming language)|Java]], reflection allows ''inspection'' of classes, interfaces, fields and methods at runtime without knowing the names of the interfaces, fields, methods at compile time. It also allows ''instantiation'' of new objects and ''invocation'' of methods.<br /> <br /> Reflection can be used to adapt a given program to different situations dynamically. Reflection-oriented programming almost always requires additional knowledge, framework, relational mapping, and object relevance in order to take advantage of more generic code execution.<br /> <br /> Reflection is often used as part of [[software testing]], such as for the runtime creation/instantiation of [[mock object]]s.<br /> <br /> Reflection is also a key strategy for [[metaprogramming]].<br /> <br /> In some object-oriented programming languages, such as [[C Sharp (programming language)|C#]] and [[Java (programming language)|Java]], reflection can be used to override [[member accessibility]] rules. For example, reflection makes it possible to change the value of a field marked &quot;private&quot; in a third-party library's class.<br /> <br /> ==Implementation==<br /> {{Unreferenced section|date=January 2008}}<br /> A language supporting reflection provides a number of features available at runtime that would otherwise be difficult to accomplish in a lower-level language. Some of these features are the abilities to:<br /> <br /> *Discover and modify source code constructions (such as code blocks, [[Class (computer science)|classes]], methods, protocols, etc.) as a [[first-class object]] at runtime.<br /> *Convert a [[string (computer science)|string]] matching the symbolic name of a class or function into a reference to or invocation of that class or function.<br /> *Evaluate a string as if it were a source code statement at runtime.<br /> *Create a new interpreter for the language's bytecode to give a new meaning or purpose for a programming construct.<br /> <br /> These features can be implemented in different ways. In [[MOO (programming language)|MOO]], reflection forms a natural part of everyday programming idiom. When verbs (methods) are called, various variables such as ''verb'' (the name of the verb being called) and ''this'' (the object on which the verb is called) are populated to give the context of the call. Security is typically managed by accessing the caller stack programmatically: Since ''callers()'' is a list of the methods by which the current verb was eventually called, performing tests on callers()[1] (the command invoked by the original user) allows the verb to protect itself against unauthorised use.<br /> <br /> Compiled languages rely on their runtime system to provide information about the source code. A compiled [[Objective-C]] executable, for example, records the names of all methods in a block of the executable, providing a table to correspond these with the underlying methods (or [[selector]]s for these methods) compiled into the program. In a compiled language that supports runtime creation of functions, such as [[Common Lisp]], the runtime environment must include a compiler or an interpreter.<br /> <br /> Reflection can be implemented for languages not having built-in reflection facilities by using a [[program transformation]] system to define automated source code changes.<br /> <br /> ==Examples==<br /> The following code snippets create an [[instance (computer science)|instance]] &lt;code&gt;foo&lt;/code&gt; of [[class (computer science)|class]] &lt;code&gt;Foo&lt;/code&gt;, and invoke its [[method (computer science)|method]] &lt;code&gt;hello&lt;/code&gt;. For each [[programming language]], normal and reflection-based call sequences are shown.<br /> <br /> ===eC===<br /> The following is an example in [[eC (programming language)|eC]]:<br /> &lt;source lang=&quot;ec&quot;&gt;// without reflection<br /> Foo foo { };<br /> foo.hello();<br /> <br /> // with reflection<br /> Class fooClass = eSystem_FindClass(__thisModule, &quot;Foo&quot;);<br /> Instance foo = eInstance_New(fooClass);<br /> Method m = eClass_FindMethod(fooClass, &quot;hello&quot;, fooClass.module);<br /> ((void (*)())(void *)m.function)(foo);&lt;/source&gt;<br /> <br /> ===ECMAScript===<br /> The following is an example in [[ECMAScript]], and therefore also applies to [[JavaScript]] and [[ActionScript]]:<br /> &lt;source lang=&quot;ecmascript&quot;&gt;<br /> // Without reflection<br /> new Foo().hello()<br /> <br /> // With reflection<br /> <br /> // assuming that Foo resides in this<br /> new this['Foo']()['hello']()<br /> <br /> // or without assumption<br /> new (eval('Foo'))()['hello']()<br /> <br /> // or simply<br /> eval('new Foo().hello()')<br /> <br /> // Using ECMAScript 2015's new Reflect class:<br /> Reflect.construct(Foo, [])['hello']()<br /> &lt;/source&gt;<br /> <br /> ===Go===<br /> <br /> The following is an example in [[Go (programming language)|Go]]:<br /> <br /> &lt;source lang=&quot;go&quot;&gt;<br /> import &quot;reflect&quot;<br /> <br /> // without reflection<br /> f := Foo{}<br /> f.Hello()<br /> <br /> // with reflection<br /> fT := reflect.TypeOf(Foo{})<br /> fV := reflect.New(fT)<br /> <br /> m := fV.MethodByName(&quot;Hello&quot;)<br /> if m.IsValid() {<br /> m.Call(nil)<br /> }<br /> &lt;/source&gt;<br /> <br /> ===Java===<br /> The following is an example in [[Java (programming language)|Java]]:<br /> &lt;source lang=&quot;java&quot;&gt;<br /> <br /> // without reflection<br /> Foo foo = new Foo();<br /> foo.hello();<br /> <br /> // with reflection<br /> Object foo = Class.forName(&quot;complete.classpath.and.Foo&quot;).newInstance();<br /> // Alternatively: Object foo = Foo.class.newInstance();<br /> Method m = foo.getClass().getDeclaredMethod(&quot;hello&quot;, new Class&lt;?&gt;[0]);<br /> m.invoke(foo);<br /> <br /> &lt;/source&gt;<br /> <br /> ===Objective-C===<br /> The following is an example in [[Objective-C]]—implying either the [[OpenStep]] or [[Foundation Kit]] framework is used:<br /> &lt;source lang=&quot;objc&quot;&gt;<br /> // Foo class.<br /> @interface Foo : NSObject<br /> - (void)hello;<br /> @end<br /> <br /> // Sending &quot;hello&quot; to a Foo instance without reflection.<br /> Foo *obj = [[Foo alloc] init];<br /> [obj hello];<br /> <br /> // Sending &quot;hello&quot; to a Foo instance with reflection.<br /> id obj = [[NSClassFromString(@&quot;Foo&quot;) alloc] init];<br /> [obj performSelector: @selector(hello)];<br /> <br /> &lt;/source&gt;<br /> <br /> ===Delphi===<br /> <br /> This [[Embarcadero Delphi|Delphi]] example assumes a TFoo class has been declared in a unit called Unit1:<br /> &lt;source lang=&quot;Delphi&quot;&gt;<br /> uses RTTI, Unit1;<br /> <br /> procedure WithoutReflection;<br /> var<br /> Foo: TFoo;<br /> begin<br /> Foo := TFoo.Create;<br /> try<br /> Foo.Hello;<br /> finally<br /> Foo.Free;<br /> end;<br /> end;<br /> <br /> procedure WithReflection;<br /> var<br /> RttiContext: TRttiContext;<br /> RttiType: TRttiInstanceType;<br /> Foo: TObject;<br /> begin<br /> RttiType := RttiContext.FindType('Unit1.TFoo') as TRttiInstanceType;<br /> Foo := RttiType.GetMethod('Create').Invoke(RttiType.MetaclassType, []).AsObject;<br /> try<br /> RttiType.GetMethod('Hello').Invoke(Foo, []);<br /> finally<br /> Foo.Free;<br /> end;<br /> end;<br /> &lt;/source&gt;<br /> <br /> This is a notable example since Delphi is an unmanaged, fully natively compiled language, unlike most other languages that support reflection. Its language architecture inherits from strongly-typed Pascal, but with significant influence from SmallTalk. Compare with the other examples here, many of which are dynamic or script languages like Perl, Python or PHP, or languages with a runtime like Java or C#.<br /> <br /> ===Perl===<br /> The following is an example in [[Perl (programming language)|Perl]]:<br /> <br /> &lt;syntaxhighlight lang=perl&gt;<br /> <br /> # without reflection<br /> my $foo = Foo-&gt;new;<br /> $foo-&gt;hello;<br /> <br /> # or<br /> Foo-&gt;new-&gt;hello;<br /> <br /> # with reflection<br /> my $class = &quot;Foo&quot;<br /> my $constructor = &quot;new&quot;;<br /> my $method = &quot;hello&quot;;<br /> <br /> my $f = $class-&gt;$constructor;<br /> $f-&gt;$method;<br /> <br /> # or<br /> $class-&gt;$constructor-&gt;$method;<br /> <br /> # with eval<br /> eval &quot;new Foo-&gt;hello;&quot;;<br /> <br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===PHP===<br /> The following is an example in [[PHP]]:<br /> &lt;syntaxhighlight lang=php&gt;<br /> // without reflection<br /> $foo = new Foo();<br /> $foo-&gt;hello();<br /> <br /> // with reflection<br /> $reflector = new ReflectionClass('Foo');<br /> $foo = $reflector-&gt;newInstance();<br /> $hello = $reflector-&gt;getMethod('hello');<br /> $hello-&gt;invoke($foo);<br /> <br /> // using callback<br /> $foo = new Foo();<br /> call_user_func(array($foo, 'hello'));<br /> <br /> // using variable variables syntax<br /> $className = 'Foo';<br /> $foo = new $className();<br /> $method = 'hello';<br /> $foo-&gt;$method();<br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===Python===<br /> The following is an example in [[Python (programming language)|Python]]:<br /> &lt;syntaxhighlight lang=python&gt;<br /> <br /> # without reflection<br /> obj = Foo()<br /> obj.hello()<br /> <br /> # with reflection<br /> class_name = &quot;Foo&quot;<br /> method = &quot;hello&quot;<br /> obj = globals()[class_name]()<br /> getattr(obj, method)()<br /> <br /> # with eval<br /> eval(&quot;Foo().hello()&quot;)<br /> <br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===R===<br /> The following is an example in [[R (programming language)|R]]:<br /> &lt;source lang=&quot;rsplus&quot;&gt;<br /> # Without reflection, assuming foo() returns an S3-type object that has method &quot;hello&quot;<br /> obj &lt;- foo()<br /> hello(obj)<br /> <br /> # With reflection<br /> the.class &lt;- &quot;foo&quot;<br /> the.method &lt;- &quot;hello&quot;<br /> obj &lt;- do.call(the.class, list())<br /> do.call(the.method, alist(obj))<br /> <br /> &lt;/source&gt;<br /> <br /> ===Ruby===<br /> The following is an example in [[Ruby (Programming Language)|Ruby]]:<br /> &lt;syntaxhighlight lang=ruby&gt;<br /> <br /> # without reflection<br /> obj = Foo.new<br /> obj.hello<br /> <br /> # with reflection<br /> class_name = &quot;Foo&quot;<br /> method_name = :hello<br /> obj = Object.const_get(class_name).new<br /> obj.send method_name<br /> <br /> # with eval<br /> eval &quot;Foo.new.hello&quot;<br /> <br /> &lt;/syntaxhighlight&gt;<br /> <br /> ==See also==<br /> *[[Type introspection]]<br /> *[[Self-modifying code]]<br /> *[[Self-hosting]]<br /> *[[Programming paradigm]]s<br /> *[[List of reflective programming languages and platforms]]<br /> *[[Mirror (programming)]]<br /> <br /> ==References==<br /> '''Notes'''<br /> {{reflist}}<br /> '''Documents'''<br /> * Jonathan M. Sobel and Daniel P. Friedman. [http://web.archive.org/web/20100204091328/http://www.cs.indiana.edu/~jsobel/rop.html ''An Introduction to Reflection-Oriented Programming''] (1996), Indiana University.<br /> <br /> ==Further reading==<br /> * Ira R. Forman and Nate Forman, ''Java Reflection in Action'' (2005), ISBN 1-932394-18-4<br /> * Ira R. Forman and Scott Danforth, ''Putting Metaclasses to Work'' (1999), ISBN 0-201-43305-2<br /> <br /> ==External links==<br /> *[https://www-master.ufr-info-p6.jussieu.fr/2007/Ajouts/Master_esj20_2007_2008/IMG/pdf/malenfant-ijcai95.pdf Reflection in logic, functional and object-oriented programming: a short comparative study]<br /> *[http://web.archive.org/web/20100204091328/http://www.cs.indiana.edu/~jsobel/rop.html An Introduction to Reflection-Oriented Programming]<br /> *[http://www.laputan.org/#Reflection Brian Foote's pages on Reflection in Smalltalk]<br /> *[http://docs.oracle.com/javase/tutorial/reflect/index.html Java Reflection API Tutorial] from Oracle<br /> {{Programming language}}<br /> <br /> {{DEFAULTSORT:Reflection (Computer Programming)}}<br /> [[ Category:Programming constructs]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=List_of_presidents_of_the_American_Psychiatric_Association&diff=710830296 List of presidents of the American Psychiatric Association 2016-03-19T08:13:29Z <p>PuercoPop: Wikilink to the correct page for Alfred Freedman</p> <hr /> <div>Presidents of the [[American Psychiatric Association]] <br /> <br /> {| class=&quot;sortable wikitable&quot; style=&quot;text-align: left&quot;<br /> |-<br /> ! style=&quot;width:150px;&quot;|'''Name'''<br /> ! style=&quot;width:280px;&quot;|'''Year'''<br /> !'''Notes'''<br /> |-<br /> || [[Renée Binder]] || style=&quot;text-align:center;&quot;|2015–2016 || Associate Dean of Academic Affairs, School of Medicine, [[University of California, San Francisco]] (UCSF) and Forensic Psychiatry Fellowship Director, UCSF Department of Psychiatry &lt;ref name=president&gt;{{cite web|title=Renée Binder, M.D., Takes Office as APA President|url=http://psychiatry.org/advocacy--newsroom/newsroom/ren%C3%A9e-binder-m-d-takes-office-as-apa-president|accessdate=22 May 2015 |year=2015}}&lt;/ref&gt;<br /> |-<br /> || [[Paul Summergrad]] || style=&quot;text-align:center;&quot;|2014–2015 || Dr. Frances S. Arkin Professor and Chairman of the Department of Psychiatry at the [[Tufts University]] School of Medicine, Psychiatrist-in-Chief of the [[Tufts Medical Center]]&lt;ref&gt;{{cite web|title=Faculty Bio - Paul Summergrad, MD|url=http://neurosciencecme.com/cmea_popup_faculty.asp?ID=406accessdate=May 22, 2015}}&lt;/ref&gt;<br /> |-<br /> || [[Jeffrey Lieberman]] || style=&quot;text-align:center;&quot;|2013–2014 || Chair of [[Columbia University]] Department of Psychiatry, principal investigator for the NIMH CATIE study &lt;ref&gt;{{cite web|title=Jeffrey Lieberman, M.D.|url=http://asp.cumc.columbia.edu/facdb/profile_list.asp?uni=jl2616&amp;DepAffil=Psychiatry|date=2005 to 2008|publisher=Columbia University Department of Psychiatry|accessdate=May 26, 2013}}&lt;/ref&gt;<br /> |-<br /> ||[[Carolyn Robinowitz]] || style=&quot;text-align:center;&quot;|2009-2010||<br /> |-<br /> ||[[Pedro Ruiz (psychiatrist)|Pedro Ruiz]] || style=&quot;text-align:center;&quot;|2006-2007||<br /> |-<br /> ||[[Mary Jane England]] || style=&quot;text-align:center;&quot;|2005-2006||<br /> |-<br /> ||[[Marcia Kraft Goin]] || style=&quot;text-align:center;&quot;|2003-2004||<br /> |- <br /> ||[[Paul S. Appelbaum]] || style=&quot;text-align:center;&quot;|2002-2003||<br /> |-<br /> ||[[Allan Tasman]] || style=&quot;text-align:center;&quot;|1999-2000||<br /> |-<br /> ||[[Rodrigo A. Munoz]] || style=&quot;text-align:center;&quot;|1998-1999||<br /> |- <br /> ||[[Harold Eist]] || style=&quot;text-align:center;&quot;|1996–1997||<br /> |-<br /> ||[[Steven Sharfstein]] || style=&quot;text-align:center;&quot;|1995-1996||<br /> |-<br /> ||[[Jerry M. Wiener]] || style=&quot;text-align:center;&quot;|1994-1995||<br /> |-<br /> ||John McIntyre || style=&quot;text-align:center;&quot;|1993–1994||<br /> |-<br /> ||[[Joseph T. English]] || style=&quot;text-align:center;&quot;|1992-1993||<br /> |-<br /> ||[[Lawrence Hartmann]] || style=&quot;text-align:center;&quot;|1991-1992||<br /> |-<br /> ||[[Elissa P. Benedek]] || style=&quot;text-align:center;&quot;|1990-1991||<br /> |-<br /> ||[[Herbert Pardes]] || style=&quot;text-align:center;&quot;|1989-1990||<br /> |-<br /> ||[[Paul Fink]] || style=&quot;text-align:center;&quot;|1988-1989||<br /> |-<br /> ||[[George H. Pollock]] || style=&quot;text-align:center;&quot;|1987-1988||<br /> |-<br /> ||[[Robert O. Pasnau]] || style=&quot;text-align:center;&quot;|1986–1987||<br /> |-<br /> || [[Carol Nadelson]] || style=&quot;text-align:center;&quot;|1985-1986|| First female president of the [[American Psychiatric Association]].&lt;ref&gt;{{cite journal |pmid=3524277 |year=1986 |last1=Nadelson |first1=T |title=Carol C. Nadelson, M.D., one hundred fourteenth president, 1985- 1986, American Psychiatric Association |volume=143 |issue=8 |pages=959–61 |journal=The American Journal of Psychiatry}}&lt;/ref&gt;&lt;br&gt;<br /> First female editor-in-chief of the [[American Psychiatric Association Press]] (1986).&lt;ref name=&quot;nlm&quot;&gt;http://www.nlm.nih.gov/changingthefaceofmedicine/physicians/biography_233.html{{full|date=November 2012}}&lt;/ref&gt;&lt;br&gt;<br /> First director of Partners Office for Women's Careers at [[Brigham and Women’s Hospital]] (1998).&lt;ref name=&quot;nlm&quot; /&gt; <br /> |-<br /> ||[[John A. Talbott]] || style=&quot;text-align:center;&quot;| 1984-1985 ||113th president&lt;ref&gt;{{cite journal |pmid=3895986 |year=1985 |last1=Sabshin |first1=M |title=John A. Talbott, M.D. One hundred thirteenth President, 1984-1985 |volume=142 |issue=9 |pages=1014–6 |journal=The American Journal of Psychiatry}}&lt;/ref&gt;<br /> |-<br /> ||[[George Tarjan]] || style=&quot;text-align:center;&quot;|1983-1984||<br /> |-<br /> ||[[H. Kieth H. Brodie]] || style=&quot;text-align:center;&quot;|1982-1983||<br /> |-<br /> ||[[Daniel X. Freedman]] || style=&quot;text-align:center;&quot;|1981-1982||<br /> |-<br /> ||[[Donald G. Langsley]] || style=&quot;text-align:center;&quot;|1980-1981||<br /> |-<br /> ||[[Alan A. Stone]] || style=&quot;text-align:center;&quot;|1979-1980||<br /> |-<br /> ||[[Jules H. Masserman]] || style=&quot;text-align:center;&quot;|1978-1979||<br /> |-<br /> ||[[Jack Weinberg (psychiatrist)|Jack Weinberg]] || style=&quot;text-align:center;&quot;|1977-1978||<br /> |-<br /> ||[[Robert W. Gibson (psychiatrist)]] || style=&quot;text-align:center;&quot;|1976-1977||<br /> |-<br /> ||[[Judd Marmor]] || style=&quot;text-align:center;&quot;|1975-1976||<br /> |-<br /> ||[[John Patrick Spiegel]] || style=&quot;text-align:center;&quot;| 1974-1975 ||103rd president&lt;ref&gt;{{cite journal |pmid=1094840 |year=1975 |last1=Weinberg |first1=J |title=John P. Spiegel, M.D. One hundred and third president, 1974-1975 |volume=132 |issue=7 |pages=700–2 |journal=The American Journal of Psychiatry}}&lt;/ref&gt;<br /> |-<br /> || [[ Alfred Freedman | Alfred M. Freedman]] || style=&quot;text-align:center;&quot;| 1973-1974 || Led the effort to de-classify homosexuality as a mental illness.&lt;ref&gt;{{cite news |url=http://www.nytimes.com/2011/04/21/health/21freedman.html |title=Alfred Freedman, a Leader in Psychiatry, Dies at 94 |first=William |last=Grims |date=April 20, 2011 |work=The New York Times}}&lt;/ref&gt;<br /> |-<br /> ||[[Perry Clement Talkingten]] || style=&quot;text-align:center;&quot;|1972–1973||<br /> |-<br /> ||[[Ewald W. Busse]] || style=&quot;text-align:center;&quot;|1971–1972||<br /> |-<br /> ||[[Robert S. Garber]] || style=&quot;text-align:center;&quot;|1970–1971||<br /> |-<br /> ||[[Robert Waggoner]] || style=&quot;text-align:center;&quot;|1969–1970||<br /> |-<br /> ||[[Lawrence C. Kolb]] || style=&quot;text-align:center;&quot;|1968-1969||<br /> |-<br /> ||[[Henry W. Brosin]] || style=&quot;text-align:center;&quot;|1967–1968||<br /> |-<br /> ||[[Harvey J. Tompkins]] || style=&quot;text-align:center;&quot;|1966–1967||<br /> |-<br /> ||[[Howard P. Rome]] || style=&quot;text-align:center;&quot;|1965–1966||<br /> |-<br /> |-||[[Daniel Blain]] || style=&quot;text-align:center;&quot;|1964–1965||<br /> |-<br /> ||[[Jack R. Ewalt]] || style=&quot;text-align:center;&quot;|1963–1964||<br /> |-<br /> ||[[C. H. Hardin Branch]] || style=&quot;text-align:center;&quot;|1962–1963||<br /> |-<br /> ||[[Walter E. Barton]] || style=&quot;text-align:center;&quot;|1961–1962||<br /> |-<br /> ||[[Robert H. Felix]] || style=&quot;text-align:center;&quot;|1960-1961||<br /> |-<br /> ||[[William Malamud]] || style=&quot;text-align:center;&quot;| 1959–1960 ||<br /> |-<br /> ||[[Francis J. Gerty]] || style=&quot;text-align:center;&quot;|1958–1959||<br /> |-<br /> ||[[Harry C. Solomon]] || style=&quot;text-align:center;&quot;|1957–1958||<br /> |-<br /> ||[[ Francis J. Braceland]] || style=&quot;text-align:center;&quot;|1956–1957||<br /> |-<br /> ||[[R. Finley Gayle Jr.]] || style=&quot;text-align:center;&quot;|1955–1956||<br /> |-<br /> ||[[Aurther P. Noyes]] || style=&quot;text-align:center;&quot;|1954–1955||<br /> |-<br /> ||[[Kenneth E. Appel]] || style=&quot;text-align:center;&quot;|1953–1954||<br /> |-<br /> ||[[Donald Ewen Cameron]] || style=&quot;text-align:center;&quot;|1952–1953||<br /> |-<br /> ||[[Leo H. Bartemeier]] || style=&quot;text-align:center;&quot;|1951–1952||<br /> |- <br /> ||[[John C. Whitehorn]] || style=&quot;text-align:center;&quot;|1950–1951|| Psychiatrist in Chief from 1941-1960 at Johns Hopkins University and the Chairman of the Department of Psychiatry. <br /> |-<br /> ||[[George S. Stevenson]] || style=&quot;text-align:center;&quot;|1949-1950||<br /> |-<br /> ||[[William Claire Menninger]] || style=&quot;text-align:center;&quot;|1948-1949|| &lt;ref&gt;A Historical Dictionary of Psychiatry<br /> By Edward Shorter A Historical Dictionary of Psychiatry page 176&lt;/ref&gt;<br /> |-<br /> ||[[Winfred Overholser Sr.]] || style=&quot;text-align:center;&quot;|1947-1948||<br /> |-<br /> ||[[Samuel W. Hamilton]] || style=&quot;text-align:center;&quot;|1946–1947||<br /> |-<br /> ||[[Karl M. Bowman]] || style=&quot;text-align:center;&quot;|1944–1946||<br /> |- <br /> ||[[Dr. Edward Strecker]] || style=&quot;text-align:center;&quot;|1943–1944||Graduated from Jefferson University in 1911 Professor of Mental and Nervous Diseases (1925-1931) &lt;ref&gt; Thomas Jefferson University tradition and heritage,edited by Frederick B. Wagner, Jr., MD, 1989 Jefferson History January 1989 Part III: Clinical Departments and Divisions ---<br /> Chapter 29: Department of Psychiatry (pages 477-496) jdc.jefferson.edu/cgi/viewcontent.cgi?article=1029&amp;context=wagner2&lt;/ref&gt;<br /> |-<br /> ||[[Aurther H. Ruggles]] || style=&quot;text-align:center;&quot;|1942-1943||<br /> |-<br /> ||[[James King Hall]] || style=&quot;text-align:center;&quot;|1941-1942||<br /> |-<br /> ||[[H. Douglas Singer]] || style=&quot;text-align:center;&quot;|1941-1942|| Died before taking office,<br /> |-<br /> ||[[George H. Stevenson]] || style=&quot;text-align:center;&quot;|1940-1941||<br /> |-<br /> ||[[William C. Sandy]] || style=&quot;text-align:center;&quot;|1939-1940||<br /> |-<br /> ||[[Richard H. Hutchings]] || style=&quot;text-align:center;&quot;|1938-1939||<br /> |-<br /> ||[[Ross McC. Chapman]] || style=&quot;text-align:center;&quot;|1937-1938||<br /> |-<br /> ||[[C. Macfie Campbell]] || style=&quot;text-align:center;&quot;|1936-1937||<br /> |-<br /> ||[[Clarence O. Cheney]] || style=&quot;text-align:center;&quot;|1935-1936||<br /> |-<br /> ||[[C. Fred Williams]] || style=&quot;text-align:center;&quot;|1934-1935||<br /> |-<br /> ||[[George H. Kirby]] || style=&quot;text-align:center;&quot;|1933-1934||<br /> |-<br /> ||[[James V. May]] || style=&quot;text-align:center;&quot;|1932-1933|<br /> |-<br /> ||[[William L. Russell]] || style=&quot;text-align:center;&quot;|1931-1932||<br /> |-<br /> ||[[Walter M English]] || style=&quot;text-align:center;&quot;|1930-1931||<br /> |-<br /> ||[[Earl D. Bond]] || style=&quot;text-align:center;&quot;|1929-1930||<br /> |-<br /> ||[[Samuel T. Orton]] || style=&quot;text-align:center;&quot;|1928-1929||<br /> |-<br /> ||[[Adolf Meyer (psychiatrist)|Adolf Meyer]] || style=&quot;text-align:center;&quot;|1927-1928 ||<br /> |-<br /> ||[[George M Kline]] || style=&quot;text-align:center;&quot;|1926-1927||<br /> |-<br /> ||[[C. Floyd Haviland]] || style=&quot;text-align:center;&quot;|1925-1926||<br /> |-<br /> ||[[William A White]] || style=&quot;text-align:center;&quot;|1924-1925||<br /> |-<br /> ||[[Thomas W. Salman]] || style=&quot;text-align:center;&quot;|1923-1924||<br /> |-<br /> ||[[Henry W. Mitchell]] || style=&quot;text-align:center;&quot;|1922-1923||<br /> |-<br /> ||[[Albert M. Barett]] || style=&quot;text-align:center;&quot;|1921-1922||<br /> |-<br /> ||[[Owen Copp]] || style=&quot;text-align:center;&quot;|1920-1921||<br /> |-<br /> ||[[Henry C Eman]] || style=&quot;text-align:center;&quot;|1919-1920||<br /> |-<br /> ||[[Elmer E Southard]] || style=&quot;text-align:center;&quot;|1918-1919 ||<br /> |-<br /> ||[[James V. Anglin]] || style=&quot;text-align:center;&quot;|1917-1918 ||<br /> |-<br /> ||[[Charles G. Wagner]] || style=&quot;text-align:center;&quot;|1916-1917 ||<br /> |-<br /> ||[[Edward N. Brush]] || style=&quot;text-align:center;&quot;|1915-1916 ||<br /> |-<br /> ||[[Samuel E. Smith (psychiatrist)]] || style=&quot;text-align:center;&quot;|1914-1915 ||<br /> |-<br /> ||[[Carlos Frederick MacDonald]] || style=&quot;text-align:center;&quot;|1913-1914 ||&lt;ref&gt;{{cite news |author= |agency= |title=Dr. Carlos F. MacDonald, Alienist, is Dead. Appeared as an Expert in the Thaw, Czolgosz and Noel Homicide Cases. Was Active at Age of 80. Death Comes at His Central Valley Home. Formerly Had a Sanitarium |url=http://query.nytimes.com/gst/abstract.html?res=9D0CE0DF1E3AEE3ABC4A53DFB066838D639EDE |quote= |newspaper=[[New York Times]] |date= June 2, 1926 |accessdate=2015-04-22 }}&lt;/ref&gt;<br /> |-<br /> ||[[James C. Searcy]] || style=&quot;text-align:center;&quot;|1912-1913 ||<br /> |-<br /> ||[[Hubert Work]] || style=&quot;text-align:center;&quot;|1911-1912 ||<br /> |-<br /> ||[[Charles W. Pilgrim]] || style=&quot;text-align:center;&quot;|1910-1911 ||<br /> |-<br /> ||[[William F. Drewry]] || style=&quot;text-align:center;&quot;|1909-1910 ||<br /> |-<br /> |-||[[Arthur F. Kilbourne]] || style=&quot;text-align:center;&quot;|1908-1909 ||<br /> |-<br /> |-||[[Charles P. Bancroft]] || style=&quot;text-align:center;&quot;|1907-1908 ||<br /> |-<br /> |-||[[Charles G. Hill]] || style=&quot;text-align:center;&quot;|1906-1907 ||<br /> |-<br /> |-||[[C. B. Burr]] || style=&quot;text-align:center;&quot;|1905-1906 ||<br /> |-<br /> |-||[[T.J. W. Burgess]] || style=&quot;text-align:center;&quot;|1904-1905 ||<br /> |-<br /> |-||[[A. E. Macdonald]] || style=&quot;text-align:center;&quot;|1903-1904 ||<br /> |-<br /> |-||[[G. Adler Bloomer]] || style=&quot;text-align:center;&quot;|1902-1903 ||<br /> |-<br /> |-||[[A. B. Richardson ]] || style=&quot;text-align:center;&quot;|1902-1903 ||Died before taking office,<br /> |-<br /> |-||[[Robert J. Preston]] || style=&quot;text-align:center;&quot;|1901-1902||<br /> |-<br /> |-||[[Peter M. Wise]] || style=&quot;text-align:center;&quot;|1900-1901||<br /> |-<br /> |-||[[Joseph G. Rogers]] || style=&quot;text-align:center;&quot;|1899-1900 ||<br /> |-<br /> |-||[[Henry M. Hurd]] || style=&quot;text-align:center;&quot;|1898-1899 ||<br /> |-<br /> |-||[[Richard M. Bucke]] || style=&quot;text-align:center;&quot;|1897-1898 ||<br /> |-<br /> |-||[[Theophilus O. Powell]] || style=&quot;text-align:center;&quot;|1896-1997 ||<br /> |-<br /> |-||[[Richard Dewey]] || style=&quot;text-align:center;&quot;|1895-1896 ||<br /> |-<br /> |-||[[Edward Cowles]] || style=&quot;text-align:center;&quot;|1894-1895 ||<br /> |-<br /> |-|John Curwen] || style=&quot;text-align:center;&quot;|1893-1894 ||<br /> |-<br /> ||J.B. Andrews || style=&quot;text-align:center;&quot;|1892-1893|| <br /> |-<br /> ||Daniel Clark || style=&quot;text-align:center;&quot;|1891-1892|| <br /> |-<br /> |H.P. Stearns || style=&quot;text-align:center;&quot;|1890-1891|| Organization name changed to American Medico-Psychological Association<br /> |-<br /> |W.W. Godding || style=&quot;text-align:center;&quot;|1889-1890|| <br /> |-<br /> |John Chapin || style=&quot;text-align:center;&quot;|1888-1889|| <br /> |-<br /> |Eugene Grissom || style=&quot;text-align:center;&quot;|1887-1888|| <br /> |-<br /> |H.A. Buttolph || style=&quot;text-align:center;&quot;|1886-1887|| <br /> |-<br /> |Orpheus Everts || style=&quot;text-align:center;&quot;|1885-1886||<br /> |-<br /> |[[Pliny Earle (physician)|Pliny Earle]] || style=&quot;text-align:center;&quot;|1884-1885|| <br /> |-<br /> |John P. Gray || style=&quot;text-align:center;&quot;|1883-1884|| <br /> |-<br /> |J.H. Callender || style=&quot;text-align:center;&quot;|1882-1883|| <br /> |-<br /> |Clement Walker || style=&quot;text-align:center;&quot;|1879-1882|| <br /> |-<br /> |Charles Nichols || style=&quot;text-align:center;&quot;|1873-1879|| <br /> |-<br /> |John Butler || style=&quot;text-align:center;&quot;|1870-1873|| <br /> |-<br /> |[[Thomas Story Kirkbride]] || style=&quot;text-align:center;&quot;|1862-1870|| <br /> |-<br /> |[[Andrew McFarland (physician)|Andrew McFarland]] || style=&quot;text-align:center;&quot;|1859-1862|| <br /> |-<br /> |[[Isaac Ray]] || style=&quot;text-align:center;&quot;|1855-1859||<br /> |-<br /> |Luther Bell || style=&quot;text-align:center;&quot;|1851-1855|| <br /> |-<br /> |[[William Awl]] || style=&quot;text-align:center;&quot;|1848-1851|| <br /> |-<br /> |Samuel B. Woodward || style=&quot;text-align:center;&quot;|1844-1848|| First president, founded as the [[Association of Medical Superintendents of American Institutions for the Insane]]<br /> |-<br /> |}<br /> <br /> == References ==<br /> {{Reflist}}<br /> <br /> [[Category:American Psychiatric Association]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Free_Software_Directory&diff=706687479 Free Software Directory 2016-02-24T18:55:12Z <p>PuercoPop: contribution-&gt;title in some citations</p> <hr /> <div>{{multiple issues|<br /> {{notability|date=August 2011}}<br /> {{primary sources|date=August 2011}}<br /> }}<br /> <br /> The '''Free Software Directory''' (FSD) is a project of the [[Free Software Foundation]] (FSF). It catalogs [[free software]] that runs under free [[operating system]]s - particularly [[GNU operating system|GNU]] and [[Linux]]. The cataloged projects are often able to run in several other operating systems. The project was formerly co-run by [[UNESCO]].<br /> <br /> Unlike some other directories that focus on free software,&lt;ref&gt;Among public directories that focus on free software, for example, Kim, E. E. (2003). [http://www.blueoxen.org/research/00007/ An Introduction to Open Source Communities] mentions [[SourceForge]] and [[Freshmeat]]:<br /> {{quote|There are three major databases of open source software available on the Internet today: the GNU Free Software Directory (https://www.gnu.org/directory/), [[SourceForge]] (http://sourceforge.net/), and [[Freshmeat]] (http://freshmeat.net/).}}<br /> &lt;/ref&gt; Free Software Directory staff verify the licenses of software listed in the directory.<br /> <br /> ==Coverage growth and usages==<br /> FSD has been used as a source for assessing the share of free software, for example finding in September 2002 an amount of &quot;1550 entries, of which 1363 (87.9%) used the GPL license, 103 (6.6%) used the LGPL license, 32 (2.0%) used a BSD or BSD-like license, 29 (1.9%) used the Artistic license, 5 (0.3%) used the MIT license&quot;.&lt;ref&gt;Wheeler D. A. (2011). [http://www.dwheeler.com/essays/gpl-compatible.html Make Your Open Source Software GPL-Compatible. Or Else.]. Released 2002-05-06, revised 2011-04-26. The article remarked that: {{quote|The FSF prefers the GPL license, so the FSF directory statistic may be biased in the percentage of GPLed software it registers, but the directory still provides strong additional evidence that the GPL is a widely used license for [[FLOSS]].}}&lt;/ref&gt; By September 2009, the Directory listed 6,000 packages whose number grew up to 6,500 in October 2011, when the newly updated directory was launched. All listed packages are &quot;free for any computer user to download, run and share. Each entry is individually checked and tested [...] so users know that any program they come across in the directory will be truly free software [...] with free documentation and without proprietary software requirements&quot;.&lt;ref&gt;{{Citation | last1 = Noyes | first1 = K. | title = Looking for Free Software? A New Directory Can Help | series = PCWorld | year = 2011 | url= http://www.pcworld.com/businesscenter/article/240859/looking_for_free_software_a_new_directory_can_help.html }}&lt;/ref&gt;<br /> <br /> Several scientific publications review or refer to the directory.&lt;ref&gt;{{cite journal |last1=Reichle |first1=M. |last2=Hanft | first2=A. |year=2006 |title=Strategies and Technologies of Sharing in Contributor-Run Archives |journal=Library Trends |volume=53 |issue=4 |pages=651–662 |arxiv= | url=http://hdl.handle.net/2142/1750 | agency=handle.net}}&lt;/ref&gt;&lt;ref&gt;{{Citation | last1 = Dorn | first1 = J. | last2 = Hochmeister | first2 = M. | title = TechScreen: Mining Competencies in Social Software | series = The 13th World Multi-Conference on Systemics, Cybernetics and Informatics | place = Orlando | pages = 115–126 | year = 2009 | url= http://www.ifs.tuwien.ac.at/node/13747 }}&lt;/ref&gt;&lt;ref&gt;{{Citation | last1 = Amatriain | first1 = X. | last2 = Griffiths | first2 = D. | title = Free Software in Education: Is it a Viable Alternative? | series = Proceedings of the 7th IMAC Conference on Localization and Globalization in Technology | place = Duisburg, Germany | year = 2004 | url= http://mtg.upf.edu/node/369 }}&lt;/ref&gt; It has been remarked that the Directory &quot;only includes software that runs on free operating systems. The FSF/UNESCO Free Software Directory is also a collaborative project, offering a web interface for users to enter and update entries&quot;.&lt;ref&gt;{{cite journal |last1=Jones |first1=P. |year=2005 |title=The FLOSSWALD Information System on Free and Open Source Software |journal=Proceedings of the 9th International Workshop on Learning Software Organizations }}&lt;/ref&gt;<br /> Among the critical issues of the previous version, it has been pointed out that while &quot;available software is described using a variety of textual metadata, including the components upon which a particular piece of software depends&quot;, &quot;unfortunately, those dependencies are only listed by name, and locating and retrieving them is left to the user&quot;.&lt;ref&gt;{{cite journal |last1=van der Hoek |first1=A. |last2=Wolf |first2=A. L. |year=2002 |title=Software release management for component-based software |journal=Software — Practice and Experience |volume=33 |issue=1 |pages=77–98 |arxiv= |doi=10.1002/spe.496 | id = {{citeseerx|10.1.1.13.3314}} }}&lt;/ref&gt;<br /> On the other hand, the accuracy of the directory review on licenses is acknowledged.&lt;ref&gt;{{cite paper | quote=The Free Software Foundation's &quot;Free Software Directory&quot; is somewhat smaller, but they work hard to make sure their information is accurate (in particular, they check licenses carefully).|last=<br /> Wheeler|first=D. A. |date=2011|url=http://www.dwheeler.com/oss_fs_eval.html |title=How to Evaluate Open Source Software / Free Software (OSS/FS) Programs }}&lt;/ref&gt;<br /> The code review from the directory's editorial board is suitable for obtaining statistics on subsets of free software packages reliably clustered by license.&lt;ref&gt;See the query interface on license-type: http://directory.fsf.org/wiki/Special:RunQuery/Query_license .&lt;/ref&gt;&lt;ref&gt;{{cite journal |last1= Monden |first1= A. |last2= Okahara |first2= S. |last3= Manabe |first3= Y. |last4=Matsumoto |first4= K. |year= 2011 |title=Guilty or Not Guilty: Using Clone Metrics to Determine Open Source Licensing Violations|journal= IEEE Software |volume=28 |issue=2 |pages=42–47 |doi=10.1109/MS.2010.159 |issn= 0740-7459}}. Free access version: http://se.aist-nara.ac.jp/achieve/pdf/476.pdf&lt;/ref&gt;<br /> <br /> In September 2011, the Free Software Directory was re-implemented as a [[wiki]], using [[MediaWiki]] and the [[Semantic MediaWiki]] extension, to allow users to directly add to and modify its contents.&lt;ref&gt;[http://www.fsf.org/news/directory-relaunch Free Software Foundation re-launches its Free Software Directory, with over 6500 programs listed] (press release), Josh Gay, September 29, 2011&lt;/ref&gt;<br /> Semantic MediaWiki provides the directory with [[semantic web]] technologies by adding &quot;advanced search and presentation capabilities, structured to be useful for reading by both humans and data-mining programs&quot;.&lt;ref name=&quot;teck_in&quot;&gt;[http://teck.in/the-free-software-foundation-fsf-re-launches-free-software-directory.html The Free Software Foundation (FSF) Re-launches Free Software Directory], TECK.IN, October 3rd, 2011.&lt;/ref&gt;<br /> <br /> The new edition of the directory has been described as designed to ease and support with [[semantics]] the discovery and harvesting of information on free software programs. &quot;An extensive and flexible category system, plus over 40,000 keywords and more than 40 different fields of information, enhance both simple and advanced searching&quot;.&lt;ref name=&quot;teck_in&quot; /&gt;<br /> <br /> A recent snapshot of the [[Taxonomy (general)|taxonomy]] of the projects reviewed and accepted in the directory is the following:&lt;ref&gt;http://directory.fsf.org/wiki/Main_Page Last visited: 2011 October 27.&lt;/ref&gt; <br /> {{div col|3}}<br /> * Audio <br /> * Biology <br /> * Business <br /> * Chat <br /> * Database <br /> * Documentation tool <br /> * Editor <br /> * Education <br /> * Email software <br /> * Game <br /> * Geography <br /> * Graphics <br /> * Hobbies <br /> * HTML Editor <br /> * Interface <br /> * Internet application <br /> * Live communications <br /> * Localization <br /> * Library <br /> * Mathematics <br /> * Network hookup <br /> * Printing <br /> * Program build automation <br /> * Programming language <br /> * Protocol <br /> * Science <br /> * Security <br /> * Software development <br /> * System administration <br /> * Text creation <br /> * Use <br /> * Version control <br /> * Video <br /> * Web authoring <br /> * Works with <br /> * Works with format <br /> {{div col end}}<br /> <br /> ==See also==<br /> {{portal|left=yes|Free software}}{{-}}<br /> <br /> ==References==<br /> {{Reflist}}<br /> <br /> ==External links==<br /> * [http://directory.fsf.org/ The Free Software Directory]<br /> <br /> {{Free Software Foundation}}<br /> <br /> [[Category:Free Software Foundation]]<br /> [[Category:UNESCO]]<br /> [[Category:MediaWiki websites]]<br /> [[Category:Semantic wikis]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=User_talk:PuercoPop&diff=698551006 User talk:PuercoPop 2016-01-06T20:50:48Z <p>PuercoPop: /* Lisp (programming language) */</p> <hr /> <div><br /> <br /> <br /> == Welcome ==<br /> '''Welcome!'''<br /> <br /> Hello, {{BASEPAGENAME}}, and [[Wikipedia:Introduction|welcome]] to Wikipedia! Thank you for [[Special:Contributions/{{BASEPAGENAME}}|your contributions]]{{#if:|, especially what you did for [[:{{{art}}}]]}}. I hope you like the place and decide to stay. Here are some pages that you might find helpful:<br /> *[[Wikipedia:Five pillars|The five pillars of Wikipedia]]<br /> *[[Wikipedia:Tutorial|Tutorial]]<br /> *[[Wikipedia:How to edit a page|How to edit a page]]<br /> *[[Wikipedia:Article development|How to write a great article]]<br /> *[[Wikipedia:Manual of Style|Manual of Style]]<br /> I hope you enjoy editing here and being a [[Wikipedia:Wikipedians|Wikipedian]]! Please [[Wikipedia:Signatures|sign]] your messages on [[Wikipedia:talk page|discussion page]]s using four [[tilde]]s (&lt;nowiki&gt;~~~~&lt;/nowiki&gt;); this will automatically insert your username and the date. If you need help, check out [[Wikipedia:Questions]], ask me on {{#if:Longhair|[[user talk:Longhair|my talk page]]|my talk page}}, or ask your question on this page and then place &lt;code&gt;&lt;nowiki&gt;{{helpme}}&lt;/nowiki&gt;&lt;/code&gt; before the question. Again, welcome! &lt;!-- Template:Welcome --&gt; <br /> [[User:Longhair|Longhair]]\&lt;sup&gt;[[User_talk:Longhair|talk]]&lt;/sup&gt; 22:05, 4 September 2008 (UTC)<br /> <br /> == Your Arbitration Committee Election Vote ==<br /> <br /> <br /> Hi PuercoPop,<br /> You recently voted in the Arbitration Committee Elections. In accordance to the [[Wikipedia:Requests for comment/Arbitration Committee Elections December 2012|Request for comment on the election process]], you must have made 150 edits in the main article space of Wikipedia before November 1st in order to be eligible to vote. According to a [https://en.wikipedia.org/w/index.php?title=Special%3AContributions&amp;contribs=user&amp;target=PuercoPop&amp;namespace=0&amp;limit=149 recent count], you only have 139 active and 3 deleted edits.<br /> <br /> If you believe we are in error, or there are other circumstances, such as a number of edits across multiple accounts, please let [[Wikipedia:Arbitration Committee Elections December 2012/Coordination|us]] know. [[User:Sailsbystars|Sailsbystars]] ([[User talk:Sailsbystars|talk]]) 18:53, 11 December 2012 (UTC)<br /> : I honestly have no idea. I just saw a link and assumed I was able to vote and started reading the Candidates proposals and Q&amp;As. It was not my intention to cast a vote if ineligible for doing so. This is my only Account. [[User:PuercoPop|PuercoPop]] ([[User talk:PuercoPop#top|talk]]) 22:23, 11 December 2012 (UTC)<br /> ::No worries! The rules weren't posted very prominently and the poll doesn't check to see if you're eligible. Please come by and vote next year, you were very very close to being eligible to vote this year... [[User:Sailsbystars|Sailsbystars]] ([[User talk:Sailsbystars|talk]]) 22:53, 11 December 2012 (UTC)<br /> == Nomination of [[:Roy (programming language)]] for deletion ==<br /> &lt;div class=&quot;floatleft&quot; style=&quot;margin-bottom:0&quot;&gt;[[File:Ambox warning orange.svg|48px|alt=|link=]]&lt;/div&gt;A discussion is taking place as to whether the article '''[[:Roy (programming language)]]''' is suitable for inclusion in Wikipedia according to [[Wikipedia:List of policies and guidelines|Wikipedia's policies and guidelines]] or whether it should be [[Wikipedia:Deletion policy|deleted]].<br /> <br /> The article will be discussed at [[Wikipedia:Articles for deletion/Roy (programming language) ]] until a consensus is reached, and anyone is welcome to contribute to the discussion. The nomination will explain the policies and guidelines which are of concern. The discussion focuses on high-quality evidence and our policies and guidelines.<br /> <br /> Users may edit the article during the discussion, including to improve the article to address concerns raised in the discussion. However, do not remove the article-for-deletion notice from the top of the article.&lt;!-- Template:afd-notice --&gt; &amp;#8213;&lt;span style=&quot;background:#8FF;border:solid 1px;border-radius:8px;box-shadow:darkgray 2px 2px 2px&quot;&gt;&amp;nbsp;[[User:Padenton|&lt;span style=&quot;font-family:Old English Text MT;color:#C00&quot;&gt;Padenton&lt;/span&gt;]]&amp;#124;[[User talk:Padenton|&amp;#9993;]]&amp;nbsp;&lt;/span&gt;&amp;nbsp; 15:12, 31 March 2015 (UTC)<br /> <br /> == [[WP:ACE2015|ArbCom elections are now open!]] ==<br /> <br /> {{Wikipedia:Arbitration Committee Elections December 2015/MassMessage}} [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 17:35, 23 November 2015 (UTC)<br /> &lt;!-- Message sent by User:Mdann52@enwiki using the list at https://en.wikipedia.org/w/index.php?title=User:Mdann52/list&amp;oldid=692057745 --&gt;<br /> <br /> == [[Lisp (programming language)]] ==<br /> Done. The name ''LISP'' derives from &quot;LISt Processor&quot;.&lt;nowiki&gt;&lt;ref name=ArtOfLisp&gt;{{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 &amp; Business Media|isbn=9781447117193|page=2}}&lt;/ref&gt;&lt;/nowiki&gt;&lt;br&gt;<br /> It wasn't that hard to find. I just Googled &quot;lisp list processor&quot; and found it. Try it sometime, it can be rewarding. Cheers [[User:Jim1138|Jim1138]] ([[User talk:Jim1138|talk]]) 20:40, 6 January 2016 (UTC)<br /> : Do you really think leaving passive aggressive messages encourages contributions to Wikipedia? [[User:PuercoPop|PuercoPop]] ([[User talk:PuercoPop#top|talk]]) 20:49, 6 January 2016 (UTC)</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Lisp_(programming_language)&diff=698537767 Lisp (programming language) 2016-01-06T19:14:48Z <p>PuercoPop: request citation</p> <hr /> <div>{{redirect|LISP|the Internet protocol|Locator/Identifier Separation Protocol}}<br /> {{Infobox programming language<br /> | name = Lisp<br /> | paradigm = [[multi-paradigm programming language|Multi-paradigm]]: [[functional programming|functional]], [[procedural programming|procedural]], [[Reflection (computer science)|reflective]], [[metaprogramming|meta]]<br /> | year = 1958<br /> | designer = [[John McCarthy (computer scientist)|John McCarthy]]<br /> | developer = [[Steve Russell]], Timothy P. Hart, and Mike Levin| latest release version =<br /> | latest release date =<br /> | turing-complete = Yes<br /> | typing = [[Dynamic typing|dynamic]], [[Strongly typed programming language|strong]]<br /> | implementations =<br /> | dialects = [[Arc (programming language)|Arc]], [[AutoLISP]], [[Clojure]], [[Common Lisp]], [[Emacs Lisp]], [[EuLisp]], [[Franz Lisp]], [[Hy]], [[Interlisp]], [[ISLISP]], [[LeLisp]], [[LFE (programming language)|LFE]], [[Maclisp]], [[MDL (programming language)|MDL]], [[Newlisp]], [[NIL (programming language)|NIL]], [[Picolisp]], [[Portable Standard Lisp]], [[Racket (programming language)|Racket]], [[RPL (programming language)|RPL]], [[Scheme (programming language)|Scheme]], [[Cadence SKILL|SKILL]], [[Spice Lisp]], [[T (programming language)|T]], [[XLISP]], [[Zetalisp]]<br /> | influenced by = [[Information Processing Language|IPL]]<br /> | influenced = [[CLIPS]], [[CLU (programming language)|CLU]], [[COWSEL]], [[Dylan (programming language)|Dylan]], [[Elixir_(programming_language)|Elixir]], [[Falcon (programming language)|Falcon]], [[Forth (programming language)|Forth]], [[Haskell (programming language)|Haskell]], [[Io (programming language)|Io]], [[Ioke (programming language)|Ioke]], [[JavaScript]], [[Julia (programming language)|Julia]], [[Logo (programming language)|Logo]], [[Lua (programming language)|Lua]], [[Mathematica]], [[MDL (programming language)|MDL]], [[ML (programming language)|ML]], [[Nim (programming language)|Nim]], [[Nu (programming language)|Nu]], [[OPS5]], [[Perl]], [[POP-2]]/[[POP-11|11]], [[Python (programming language)|Python]], [[R (programming language)|R]], [[Rebol]], [[Ruby (programming language)|Ruby]], [[Smalltalk]], [[Tcl]]<br /> }}<br /> <br /> '''Lisp''' (historically, '''LISP''') is a family of [[computer]] [[programming language]]s with a long history and a distinctive, fully parenthesized [[Polish notation|Polish prefix]] notation.&lt;ref&gt;<br /> {{cite book<br /> | title = Milestones in computer science and information technology<br /> | author = Edwin D. Reilly<br /> | publisher = Greenwood Publishing Group<br /> | year = 2003<br /> | isbn = 978-1-57356-521-9<br /> | pages = 156–157<br /> | url = http://books.google.com/books?id=JTYPKxug49IC&amp;pg=PA157<br /> }}&lt;/ref&gt;<br /> Originally specified in 1958, Lisp is the second-oldest [[high-level programming language]] in widespread use today; only [[Fortran]] is older (by one year).&lt;ref&gt;{{cite web|url=http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-5.html|quote=Lisp is a survivor, having been in use for about a quarter of a century. Among the active programming languages only Fortran has had a longer life.|title=SICP: Foreword}}&lt;/ref&gt;&lt;ref&gt;{{cite web|url=http://www-formal.stanford.edu/jmc/history/lisp/node6.html#SECTION00060000000000000000|title=Conclusions}}&lt;/ref&gt; Like Fortran, Lisp has changed a great deal since its early days, and a number of [[Programming language dialect|dialects]] have existed over its history. Today, the most widely known general-purpose Lisp dialects are [[Common Lisp]] and [[Scheme (programming language)|Scheme]].<br /> <br /> Lisp was originally created as a practical mathematical notation for computer programs, influenced by the notation of [[Alonzo Church]]'s [[lambda calculus]]. It quickly became the favored programming language for [[artificial intelligence]] (AI) research. As one of the earliest programming languages, Lisp pioneered many ideas in [[computer science]], including [[tree data structure]]s, [[Garbage collection (computer science)|automatic storage management]], [[dynamic typing]], [[Conditional (computer programming)|conditionals]], [[higher-order function]]s, [[Recursion (computer science)|recursion]], and the [[self-hosting]] [[compiler]].&lt;ref name=&quot;GRAHAM&quot;&gt;{{cite web| title=Revenge of the Nerds| author=Paul Graham | url=http://www.paulgraham.com/icad.html | accessdate=2013-03-14}}&lt;/ref&gt;<br /> <br /> The name ''LISP'' derives from &quot;LISt Processor&quot;{{citation needed|date=Jan 2016}}. [[Linked list]]s are one of Lisp's major [[data structure]]s, and Lisp [[source code]] is itself made up of lists. As a result, Lisp programs can manipulate source code as a data structure, giving rise to the [[Macro (computer science)|macro]] systems that allow programmers to create new syntax or new [[domain-specific language]]s embedded in Lisp.<br /> <br /> The interchangeability of code and data gives Lisp its instantly recognizable syntax. All program code is written as ''[[s-expression]]s'', or parenthesized lists. A function call or syntactic form is written as a list with the function or operator's name first, and the arguments following; for instance, a function {{Lisp2|f}} that takes three arguments would be called as {{Lisp2|(f arg1 arg2 arg3)}}.<br /> <br /> ==History==<br /> {{Multiple image|image1 = John McCarthy Stanford.jpg|footer = John McCarthy (top) and Steve Russell (bottom)|image2 = Steve Russell.jpg|direction = vertical}}<br /> <br /> Lisp was invented by [[John McCarthy (computer scientist)|John McCarthy]] in 1958 while he was at the [[Massachusetts Institute of Technology]] (MIT). McCarthy published its design in a paper in ''[[Communications of the ACM]]'' in 1960, entitled &quot;Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I&quot;&lt;ref name=&quot;MCCARTHY&quot;&gt;{{cite web| title=Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I| author=John McCarthy | url=http://www-formal.stanford.edu/jmc/recursive.html | accessdate=2006-10-13}}&lt;/ref&gt; (&quot;Part II&quot; was never published). He showed that with a few simple operators and a notation for functions, one can build a [[Turing-complete]] language for algorithms.<br /> <br /> [[Information Processing Language]] was the first AI language, from 1955 or 1956, and already included many of the concepts, such as list-processing and recursion, which came to be used in Lisp.<br /> <br /> McCarthy's original notation used bracketed &quot;[[M-expression]]s&quot; that would be translated into [[S-expression]]s. As an example, the M-expression {{Lisp2|car[cons[A,B]]}} is equivalent to the S-expression {{Lisp2|(car (cons A B))}}. Once Lisp was implemented, programmers rapidly chose to use S-expressions, and M-expressions were abandoned. M-expressions surfaced again with short-lived attempts of [[MLISP]]&lt;ref name=&quot;SMITH&quot;&gt;{{cite web| title=MLISP Users Manual| author=David Canfield Smith | url=http://www.softwarepreservation.org/projects/LISP/stanford/Smith-MLISP-AIM-84.pdf | accessdate=2006-10-13}}&lt;/ref&gt; by [[Horace Enea]] and [[CGOL]] by [[Vaughan Pratt]].<br /> <br /> Lisp was first implemented by [[Steve Russell]] on an [[IBM 704]] computer. Russell had read McCarthy's paper, and realized (to McCarthy's surprise) that the Lisp ''eval'' function could be implemented in [[machine code]].&lt;ref&gt;According to what reported by [[Paul Graham (computer programmer)|Paul Graham]] in ''[[Hackers &amp; Painters]]'', p. 185, McCarthy said: &quot;Steve Russell said, look, why don't I program this ''eval''..., and I said to him, ho, ho, you're confusing theory with practice, this ''eval'' is intended for reading, not for computing. But he went ahead and did it. That is, he compiled the ''eval'' in my paper into [[IBM 704]] machine code, fixing [[Software bug|bug]], and then advertised this as a Lisp interpreter, which it certainly was. So at that point Lisp had essentially the form that it has today...&quot;&lt;/ref&gt; The result was a working Lisp interpreter which could be used to run Lisp programs, or more properly, 'evaluate Lisp expressions.'<br /> <br /> Two assembly language macros for the [[IBM 704]] became the primitive operations for decomposing lists: [[Car and cdr|{{Lisp2|car}}]] (Contents of the Address part of Register number) and [[Car and cdr|{{Lisp2|cdr}}]] (Contents of the Decrement part of Register number).&lt;ref name=&quot;PREHISTORY&quot;&gt;{{cite web| title=LISP prehistory - Summer 1956 through Summer 1958| author=John McCarthy | url=http://www-formal.stanford.edu/jmc/history/lisp/node2.html | accessdate=2010-03-14}}&lt;/ref&gt; From the context, it is clear that the term &quot;Register&quot; is used here to mean &quot;Memory Register&quot;, nowadays called &quot;Memory Location&quot;. Lisp dialects still use {{Lisp2|car}} and {{Lisp2|cdr}} ({{IPAc-en|ˈ|k|ɑr}} and {{IPAc-en|ˈ|k|ʊ|d|ər}}) for the operations that return the first item in a list and the rest of the list respectively.<br /> <br /> The first complete Lisp compiler, written in Lisp, was implemented in 1962 by Tim Hart and Mike Levin at MIT.&lt;ref name=&quot;LEVIN&quot;&gt;{{cite web| title=AI Memo 39-The new compiler| author=Tim Hart and Mike Levin | url=ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-039.pdf | accessdate=2006-10-13}}&lt;/ref&gt; This compiler introduced the Lisp model of incremental compilation, in which compiled and interpreted functions can intermix freely. The language used in Hart and Levin's memo is much closer to modern Lisp style than McCarthy's earlier code.<br /> <br /> Lisp was a difficult system to implement with the compiler techniques and stock hardware of the 1970s. [[Garbage collection (computer science)|Garbage collection]] routines, developed by then-[[MIT]] graduate student [[Daniel Edwards (programmer)|Daniel Edwards]], made it practical to run Lisp on general-purpose computing systems, but efficiency was still a problem.{{citation needed|date=October 2010}} This led to the creation of [[Lisp machine]]s: dedicated hardware for running Lisp environments and programs. Advances in both computer hardware and compiler technology soon made Lisp machines obsolete.{{citation needed|date=May 2011}}<br /> <br /> During the 1980s and 1990s, a great effort was made to unify the work on new Lisp dialects (mostly successors to [[Maclisp]] like [[ZetaLisp]] and NIL (New Implementation of Lisp)) into a single language. The new language, [[Common Lisp]], was somewhat compatible with the dialects it replaced (the book [[Common Lisp the Language]] notes the compatibility of various constructs). In 1994, [[ANSI]] published the Common Lisp standard, &quot;ANSI X3.226-1994 Information Technology Programming Language Common Lisp.&quot;<br /> <br /> &lt;timeline&gt;<br /> Preset = TimeHorizontal_AutoPlaceBars_UnitYear<br /> ImageSize = width:1024<br /> PlotArea = right:256<br /> <br /> Define $bold = fontsize:L shift:(10,-4)<br /> <br /> Colors =<br /> id:offWhite value:rgb(0.97,0.97,0.97)<br /> id:paleGray value:rgb(0.86,0.86,0.86)<br /> id:darkGray value:gray(0.6)<br /> <br /> BackgroundColors = canvas:offWhite<br /> <br /> Period = from:1958 till:2013<br /> ScaleMajor = unit:year increment:5 start:1958 gridcolor:paleGray<br /> <br /> BarData=<br /> barset:Dialects<br /> <br /> PlotData=<br /> <br /> # set defaults<br /> width:15 fontsize:M textcolor:black align:left anchor:from shift:(0,-2) color:darkGray<br /> barset:Dialects<br /> <br /> from:1958 till:1965 text:&quot;Lisp 1.5&quot;<br /> from:1965 till:1985 text:&quot;[[Maclisp]]&quot;<br /> from:1970 till:1995 text:&quot;[[ZetaLisp]]&quot;<br /> from:1970 till:1980 text:&quot;[[NIL (programming language)|NIL]]&quot;<br /> from:1970 till:1990 text:&quot;[[Interlisp]]&quot;<br /> from:1984 till:2013 text:&quot;[[Common Lisp]]&quot;<br /> from:1975 till:2013 text:&quot;[[Scheme (programming language)|Scheme]]&quot;<br /> from:1986 till:2013 text:&quot;[[ISLISP]]&quot;<br /> from:2007 till:2013 text:&quot;[[Clojure]]&quot;<br /> &lt;/timeline&gt;<br /> <br /> ===Connection to artificial intelligence===<br /> Since its inception, Lisp was closely connected with the [[artificial intelligence]] research community, especially on [[PDP-10]]&lt;ref&gt;The 36-bit word size of the [[PDP-6]]/[[PDP-10]] was influenced by the usefulness of having two Lisp 18-bit pointers in a single word. {{cite newsgroup | quote = The PDP-6 project started in early 1963, as a 24-bit machine. It grew to 36 bits for LISP, a design goal. | url = http://groups.google.com/group/alt.folklore.computers/browse_thread/thread/6e5602ce733d0ec/17597705ae289112 | title = The History of TOPS or Life in the Fast ACs | newsgroup = alt.folklore.computers |message-id= 84950@tut.cis.ohio-state.edu | date = 18 October 1990 | author = Peter J. Hurley}}&lt;/ref&gt; systems. Lisp was used as the implementation of the programming language [[Planner programming language|Micro Planner]] which was used in the famous AI system [[SHRDLU]]. In the 1970s, as AI research spawned commercial offshoots, the performance of existing Lisp systems became a growing issue.{{Citation needed|date=March 2010}}<br /> <br /> ===Genealogy and variants===<br /> Over its fifty-year history, Lisp has spawned many variations on the core theme of an S-expression language. Moreover, each given dialect may have several implementations—for instance, there are more than a dozen implementations of [[Common Lisp]].<br /> <br /> Differences between dialects may be quite visible—for instance, Common Lisp uses the keyword &lt;code&gt;defun&lt;/code&gt; to name a function, but Scheme uses &lt;code&gt;define&lt;/code&gt;.&lt;ref&gt;Common Lisp: &lt;code&gt;(defun f (x) x)&lt;/code&gt;&lt;br/&gt;Scheme: &lt;code&gt;(define f (lambda (x) x))&lt;/code&gt; or &lt;code&gt;(define (f x) x)&lt;/code&gt;&lt;/ref&gt; Within a dialect that is standardized, however, conforming implementations support the same core language, but with different extensions and libraries.<br /> <br /> ====Historically significant dialects====<br /> [[File:LISP machine.jpg|thumb|right|A Lisp machine in the [[MIT Museum]]]]<br /> [[File:4.3 BSD UWisc VAX Emulation Lisp Manual.png|thumb|[[4.3BSD|4.3 BSD]] from the [[University of Wisconsin]], displaying the [[man page]] for [[Franz Lisp]]]]<br /> <br /> *LISP 1&lt;ref&gt;{{Cite journal<br /> | last = McCarthy | first = J. | author-link = John McCarthy (computer scientist)<br /> | last2 = Brayton | first2 = R. | author2-link = Robert Brayton (computer scientist)<br /> | last3 = Edwards | first3 = D. | author3-link = Daniel Edwards (programmer)<br /> | last4 = Fox | first4 = P. | author4-link = Phyllis Fox<br /> | last5 = Hodes | first5 = L. | author5-link = Louis Hodes<br /> | last6 = Luckham | first6 = D. | author6-link = David Luckham<br /> | last7 = Maling | first7 = K. | author7-link = Klim Maling (programmer)<br /> | last8 = Park | first8 = D. | author8-link = David Park (computer scientist)<br /> | last9 = Russell | first9 = S. | author9-link = Steve Russell <br /> | title = LISP I Programmers Manual<br /> | place = [[Boston]], [[Massachusetts]]<br /> | publisher = Artificial Intelligence Group, [[M.I.T. Computation Center]] and [[Research Laboratory of Electronics at MIT|Research Laboratory]]<br /> | origyear =<br /> |date=March 1960<br /> | volume =<br /> | edition =<br /> | chapter =<br /> | chapterurl =<br /> | page =<br /> | pages =<br /> | url = http://history.siam.org/sup/Fox_1960_LISP.pdf<br /> | archiveurl =<br /> | archivedate =<br /> | doi =<br /> | id =<br /> | isbn =<br /> | postscript = &lt;!--None--&gt; }} Accessed May 11, 2010.&lt;/ref&gt; – First implementation.<br /> *LISP 1.5&lt;ref&gt;{{Cite book| url = http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf | title = LISP 1.5 Programmer's Manual | publisher = [[MIT Press]] | first1 = John | last1 = McCarthy | first2 = Paul W. | last2 = Abrahams | first3 = Daniel J. | last3 = Edwards | first4 = Timothy P. | last4 = Hart | first5 = Michael I. | last5 = Levin | isbn = 0-262-13011-4 | origyear = 1962|edition= 2nd|year=1985}}&lt;/ref&gt; – First widely distributed version, developed by McCarthy and others at MIT. So named because it contained several improvements on the original &quot;LISP 1&quot; interpreter, but was not a major restructuring as the planned [[LISP 2]] would be.<br /> *[[Stanford LISP]] 1.6&lt;ref&gt;{{Cite book| url = http://www.softwarepreservation.org/projects/LISP/stanford/SAILON-28.6.pdf | format = PDF | title = Stanford LISP 1.6 Manual | first1 = Lynn H. | last1 = Quam | first2 = Whitfield | last2 = Diffle}}&lt;/ref&gt; – This was a successor to LISP 1.5 developed at the [[Stanford AI Lab]], and widely distributed to [[PDP-10]] systems running the [[TOPS-10]] operating system. It was rendered obsolete by Maclisp and InterLisp.<br /> *[[Maclisp|MACLISP]]&lt;ref&gt;{{cite web| url = http://zane.brouhaha.com/~healyzh/doc/lisp.doc.txt | title = Maclisp Reference Manual | date = March 3, 1979 | archiveurl = http://web.archive.org/web/20071214064433/http://zane.brouhaha.com/~healyzh/doc/lisp.doc.txt | archivedate = 2007-12-14}}&lt;/ref&gt; – developed for MIT's [[Project MAC]] (no relation to Apple's [[Macintosh]], nor to [[John McCarthy (computer scientist)|McCarthy]]), direct descendant of LISP 1.5. It ran on the PDP-10 and [[Multics]] systems. (MACLISP would later come to be called Maclisp, and is often referred to as MacLisp.)<br /> *[[InterLisp]]&lt;ref&gt;{{Cite book| url = http://www.bitsavers.org/pdf/xerox/interlisp/1974_InterlispRefMan.pdf | format = PDF | title = InterLisp Reference Manual | first = Warren | last = Teitelman | year = 1974 }}&lt;/ref&gt; – developed at [[BBN Technologies]] for PDP-10 systems running the [[TOPS-20|Tenex]] operating system, later adopted as a &quot;West coast&quot; Lisp for the Xerox Lisp machines as [[InterLisp-D]]. A small version called &quot;InterLISP 65&quot; was published for the [[MOS 6502|6502]]-based [[Atari 8-bit family]] computer line. For quite some time Maclisp and InterLisp were strong competitors.<br /> *[[Franz Lisp]] – originally a [[University of California, Berkeley|Berkeley]] project; later developed by Franz Inc. The name is a humorous deformation of the name &quot;[[Franz Liszt]]&quot;, and does not refer to [[Allegro Common Lisp]], the dialect of Common Lisp sold by Franz Inc., in more recent years.<br /> *[[XLISP]], which [[AutoLISP]] was based on.<br /> *[[Standard Lisp]] and [[Portable Standard Lisp]] were widely used and ported, especially with the Computer Algebra System REDUCE.<br /> *[[ZetaLisp]], also known as Lisp Machine Lisp – used on the [[Lisp machine]]s, direct descendant of Maclisp. ZetaLisp had a big influence on Common Lisp.<br /> *[[LeLisp]] is a French Lisp dialect. One of the first [[Interface Builder]]s was written in LeLisp.{{Citation needed|reason=No dispute about Lisp, but LeLisp specifically?|date=November 2014}}<br /> *[[Scheme (programming language)|Scheme]] (1975).&lt;ref&gt;ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-349.pdf&lt;/ref&gt;<br /> *[[Common Lisp]] (1984), as described by ''[[Common Lisp the Language]]'' – a consolidation of several divergent attempts (ZetaLisp, [[Spice Lisp]], [[NIL (programming language)|NIL]], and [[S-1 Lisp]]) to create successor dialects&lt;ref&gt;{{Cite book| chapterurl = http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node6.html | title = Common Lisp the Language | edition = 2nd | chapter = Purpose | first = Guy L., Jr. | last = Steele| isbn = 0-13-152414-3}}&lt;/ref&gt; to Maclisp, with substantive influences from the Scheme dialect as well. This version of Common Lisp was available for wide-ranging platforms and was accepted by many as a [[de facto standard]]&lt;ref&gt;{{cite web| url = http://www.cs.cmu.edu/Groups/AI/html/faqs/lang/lisp/part2/faq-doc-13.html | title = History: Where did Lisp come from? | work = FAQ: Lisp Frequently Asked Questions 2/7 | date = 20 February 1996 | first1 = Mark | last1 = Kantrowitz | first2 = Barry | last2 = Margolin}}&lt;/ref&gt; until the publication of ANSI Common Lisp (ANSI X3.226-1994).<br /> *[[Dylan (programming language)|Dylan]] was in its first version a mix of Scheme with the Common Lisp Object System.<br /> *[[EuLisp]] – attempt to develop a new efficient and cleaned-up Lisp.<br /> *[[ISLISP]] – attempt to develop a new efficient and cleaned-up Lisp. Standardized as ISO/IEC 13816:1997&lt;ref&gt;{{cite web|url=http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=22987 |title=ISO/IEC 13816:1997 |publisher=Iso.org |date=2007-10-01 |accessdate=2013-11-15}}&lt;/ref&gt; and later revised as ISO/IEC 13816:2007:&lt;ref&gt;{{cite web|url=http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=44338 |title=ISO/IEC 13816:2007 |publisher=Iso.org |date=2013-10-30 |accessdate=2013-11-15}}&lt;/ref&gt; ''Information technology – Programming languages, their environments and system software interfaces – Programming language ISLISP''.<br /> *IEEE [[Scheme (programming language)|Scheme]] – IEEE standard, 1178–1990 (R1995)<br /> *ANSI [[Common Lisp]] – an [[American National Standards Institute]] (ANSI) [[Standardization|standard]] for Common Lisp, created by subcommittee [[X3J13]], chartered&lt;ref&gt;{{cite web| url = http://www.nhplace.com/kent/CL/x3j13-86-020.html | title = X3J13 Charter}}&lt;/ref&gt; to begin with ''Common Lisp: The Language'' as a base document and to work through a public [[Consensus decision-making|consensus]] process to find solutions to shared issues of [[Portability (software)|portability]] of programs and [[Computer compatibility|compatibility]] of Common Lisp implementations. Although formally an ANSI standard, the implementation, sale, use, and influence of ANSI Common Lisp has been and continues to be seen worldwide.<br /> *[[ACL2]] or &quot;A Computational Logic for Applicative Common Lisp&quot;, an applicative (side-effect free) variant of Common LISP. ACL2 is both a programming language in which you can model computer systems and a tool to help proving properties of those models.<br /> *[[Clojure]], a modern dialect of Lisp which compiles to the [[Java virtual machine]] and handles [[Concurrency (computer science)|concurrency]] very well.<br /> <br /> ===2000-present===<br /> After having declined somewhat in the 1990s, Lisp has recently experienced a resurgence of interest. Most new activity is focused around implementations of [[Common Lisp]] as well as [[Clojure]], [[Racket (programming language)|Racket]], [[Scheme (programming language)|Scheme]] and [[Emacs Lisp]], and includes the development of new portable libraries and applications.<br /> <br /> Many new Lisp programmers were inspired by writers such as [[Paul Graham (computer programmer)|Paul Graham]] and [[Eric S. Raymond]] to pursue a language others considered antiquated. New Lisp programmers often describe the language as an eye-opening experience and claim to be substantially more productive than in other languages.&lt;ref&gt;{{cite web| title=The Road To Lisp Survey | url=http://wiki.alu.org/The_Road_To_Lisp_Survey | accessdate=2006-10-13}}&lt;/ref&gt; This increase in awareness may be contrasted to the &quot;[[AI winter]]&quot; and Lisp's brief gain in the mid-1990s.&lt;ref&gt;{{cite web|url=http://www.faqs.org/docs/artu/ch14s05.html |title=Trends for the Future |publisher=Faqs.org |accessdate=2013-11-15}}&lt;/ref&gt;<br /> <br /> Dan Weinreb lists in his survey of Common Lisp implementations&lt;ref&gt;{{cite web|last=Weinreb|first=Daniel|title=Common Lisp Implementations: A Survey|url=http://common-lisp.net/~dlw/LispSurvey.html|accessdate=4 April 2012}}&lt;/ref&gt; eleven actively maintained Common Lisp implementations. Scieneer Common Lisp is a new commercial implementation forked from CMUCL with a first release in 2002.<br /> <br /> The open source community has created new supporting infrastructure: [[CLiki]] is a wiki that collects Common Lisp related information, the [[Common Lisp directory]] lists resources, #lisp is a popular IRC channel (with support by a Lisp-written Bot), [[lisppaste]] supports the sharing and commenting of code snippets, [[Planet Lisp]] collects the contents of various Lisp-related blogs, on [[LispForum]] users discuss Lisp topics, [[Lispjobs]] is a service for announcing job offers and there is a weekly news service, ''[[Weekly Lisp News]]''. ''Common-lisp.net'' is a hosting site for open source Common Lisp projects. [[Quicklisp]] is a library manager for Common Lisp.<br /> <br /> 50 years of Lisp (1958–2008) has been celebrated at LISP50@OOPSLA.&lt;ref&gt;{{cite web|url=http://www.lisp50.org/ |title=LISP50@OOPSLA |publisher=Lisp50.org |accessdate=2013-11-15}}&lt;/ref&gt; There are regular local user meetings in Boston, Vancouver, and Hamburg. Other events include the European Common Lisp Meeting, the European Lisp Symposium and an International Lisp Conference.<br /> <br /> The Scheme community actively maintains [[Scheme (programming language)#Implementations|over twenty implementations]]. Several significant new implementations (Chicken, Gambit, Gauche, Ikarus, Larceny, Ypsilon) have been developed in the last few years. The Revised&lt;sup&gt;5&lt;/sup&gt; Report on the Algorithmic Language Scheme&lt;ref&gt;[http://www.schemers.org/Documents/Standards/R5RS/ Documents: Standards: R5RS]. schemers.org (2012-01-11). Retrieved on 2013-07-17.&lt;/ref&gt; standard of Scheme was widely accepted in the Scheme community. The [[Scheme Requests for Implementation]] process has created a lot of quasi standard libraries and extensions for Scheme. User communities of individual Scheme implementations continue to grow. A new language standardization process was started in 2003 and led to the R&lt;sup&gt;6&lt;/sup&gt;RS Scheme standard in 2007. Academic use of Scheme for teaching computer science seems to have declined somewhat. Some universities, such as MIT, are no longer using Scheme in their computer science introductory courses.&lt;ref&gt;{{cite news|url=http://cemerick.com/2009/03/24/why-mit-now-uses-python-instead-of-scheme-for-its-undergraduate-cs-program/|title=Why MIT now uses python instead of scheme for its undergraduate CS program|date=March 24, 2009|work=cemerick.com|accessdate=November 10, 2013}}&lt;/ref&gt;&lt;ref&gt;{{cite news|url=http://mitadmissions.org/blogs/entry/the_end_of_an_era_1|title=The End of an Era|first=Evan|last=Broder|date=January 8, 2008|work=mitadmissions.org|accessdate=November 10, 2013}}&lt;/ref&gt;<br /> <br /> There are several new dialects of Lisp: [[Arc (programming language)|Arc]], [[Hy]], [[Nu (programming language)|Nu]], [[Clojure]], [[Liskell]], [[LFE (programming language)|LFE]] (Lisp Flavored Erlang) and [[Racket (programming language)|Racket]].<br /> <br /> ==Major dialects==<br /> [[Common Lisp]] and [[Scheme (programming language)|Scheme]] represent two major streams of Lisp development. These languages embody significantly different design choices.<br /> <br /> [[Common Lisp]] is a successor to [[MacLisp]]. The primary influences were [[Lisp Machine Lisp]], [[MacLisp]], [[NIL (programming language)|NIL]], [[S-1 Lisp]], [[Spice Lisp]], and Scheme.&lt;ref&gt;Chapter 1.1.2, History, ANSI CL Standard&lt;/ref&gt; It has many of the features of Lisp Machine Lisp (a large Lisp dialect used to program [[Lisp Machine]]s), but was designed to be efficiently implementable on any personal computer or workstation. Common Lisp has a large language standard including many built-in data types, functions, macros and other language elements, as well as an object system ([[Common Lisp Object System]] or shorter CLOS). Common Lisp also borrowed certain features from Scheme such as [[lexical scoping]] and [[lexical closure]]s.<br /> <br /> Scheme (designed earlier) is a more minimalist design, with a much smaller set of standard features but with certain implementation features (such as [[tail-call optimization]] and full [[continuation]]s) not necessarily found in Common Lisp.<br /> <br /> [[Scheme (programming language)|Scheme]] is a statically scoped and properly tail-recursive dialect of the Lisp programming language invented by [[Guy L. Steele, Jr.|Guy Lewis Steele Jr.]] and [[Gerald Jay Sussman]]. It was designed to have exceptionally clear and simple semantics and few different ways to form expressions. A wide variety of programming paradigms, including imperative, functional, and message passing styles, find convenient expression in Scheme. Scheme continues to evolve with a series of standards (Revised&lt;sup&gt;n&lt;/sup&gt; Report on the Algorithmic Language Scheme) and a series of [[Scheme Requests for Implementation]].<br /> <br /> [[Clojure]] is a recent dialect of Lisp that principally targets the [[Java Virtual Machine]], as well as the [[Common Language Runtime|CLR]], the [[Python (programming language)|Python VM]], the Ruby VM [[YARV]], and compiling to [[JavaScript]]. It is designed to be a pragmatic general-purpose language. Clojure draws considerable influences from [[Haskell (programming language)|Haskell]] and places a very strong emphasis on immutability.&lt;ref name=&quot;clojure-immutability&quot;&gt;[http://www.infoq.com/articles/in-depth-look-clojure-collections An In-Depth Look at Clojure Collections], Retrieved 2012-06-24&lt;/ref&gt; Every feature supported by Clojure is supported at runtime. Clojure provides access to Java frameworks and libraries, with optional type hints and [[type inference]], so that calls to Java can avoid reflection and enable fast primitive operations.<br /> <br /> In addition, Lisp dialects are used as [[scripting language]]s in a number of applications, with the most well-known being [[Emacs Lisp]] in the [[Emacs]] editor, [[AutoLisp]] and later [[Visual Lisp]] in [[AutoCAD]], Nyquist in [[Audacity (audio editor)|Audacity]], Scheme in [[LilyPond]]. The potential small size of a useful Scheme interpreter makes it particularly popular for embedded scripting. Examples include [[SIOD]] and [[TinyScheme]], both of which have been successfully embedded in the [[GIMP]] image processor under the generic name &quot;Script-fu&quot;.&lt;ref name=&quot;script-fu&quot;&gt;[http://www.gimp.org/docs/script-fu-update.html Script-fu In GIMP 2.4], Retrieved 2009-10-29&lt;/ref&gt; LIBREP, a Lisp interpreter by John Harper originally based on the [[Emacs Lisp]] language, has been embedded in the [[Sawfish (window manager)|Sawfish]] [[window manager]].&lt;ref name=&quot;librep&quot;&gt;[http://sawfish.wikia.com/wiki/Librep librep] at Sawfish Wikia, retrieved 2009-10-29&lt;/ref&gt;<br /> <br /> ==Language innovations==<br /> Lisp was the first language where the structure of program code is represented faithfully and directly in a standard data structure—a quality much later dubbed &quot;[[homoiconicity]]&quot;. As a result, Lisp functions can be manipulated, altered or even created within a Lisp program without lower-level manipulations. This is generally considered one of the primary advantages of the language with regard to its expressive power, and makes the language suitable for [[syntactic macros]] and [[metacircular evaluation]].<br /> <br /> A conditional using an ''if-then-else'' syntax was invented by McCarthy in a Fortran context. He proposed its inclusion in [[ALGOL]], but it was not made part of the [[Algol 58]] specification. For Lisp, McCarthy used the more general ''cond''-structure.&lt;ref&gt;{{cite web|url=http://www-formal.stanford.edu/jmc/history/lisp/node2.html|title=LISP prehistory - Summer 1956 through Summer 1958.|quote=I invented conditional expressions in connection with a set of chess legal move routines I wrote in FORTRAN for the IBM 704 at M.I.T. during 1957-58...A paper defining conditional expressions and proposing their use in Algol was sent to the Communications of the ACM but was arbitrarily demoted to a letter to the editor, because it was very short.}}&lt;/ref&gt; [[Algol 60]] took up ''if-then-else'' and popularized it.<br /> <br /> Lisp deeply influenced [[Alan Kay]], the leader of the research on [[Smalltalk]], and then in turn Lisp was influenced by Smalltalk, by adopting object-oriented programming features (classes, instances, etc.) in the late 1970s. The Flavours object system (later CLOS) introduced multiple inheritance.<br /> <br /> Lisp introduced the concept of [[Garbage collection (computer science)|automatic garbage collection]], in which the system walks the heap looking for unused memory. Progress in modern sophisticated garbage collection algorithms such as generational garbage collection was stimulated by its use in Lisp.&lt;ref&gt;{{citation |last=Lieberman |first=Henry |last2=Hewitt |first2=Carl |title=A Real-Time Garbage Collector Based on the Lifetimes of Objects |url=http://web.media.mit.edu/~lieber/Lieberary/GC/Realtime/Realtime.html |journal=CACM |volume=26 |issue=6 |date=June 1983 |pages=419–429 |doi=10.1145/358141.358147}}&lt;/ref&gt;<br /> <br /> [[Edsger W. Dijkstra]] in his 1972 [[Turing Award]] lecture said,<br /> :&quot;With a few very basic principles at its foundation, it [LISP] has shown a remarkable stability. Besides that, LISP has been the carrier for a considerable number of in a sense our most sophisticated computer applications. LISP has jokingly been described as “the most intelligent way to misuse a computer”. I think that description a great compliment because it transmits the full flavour of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts.&quot;&lt;ref&gt;{{citation|url=http://www.cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD340.html|author=Edsger W. Dijkstra|year=1972|title=The Humble Programmer (EWD 340)}} (ACM Turing Award lecture).&lt;/ref&gt;<br /> <br /> Largely because of its resource requirements with respect to early computing hardware (including early microprocessors), Lisp did not become as popular outside of the [[AI]] community as [[Fortran]] and the [[ALGOL]]-descended [[C (programming language)|C]] language. Because of its suitability to complex and dynamic applications, Lisp is currently{{when|date=January 2016}} enjoying some resurgence of popular interest.{{citation needed|date=January 2016}}<br /> <br /> ==Syntax and semantics==<br /> :'''''Note''': This article's examples are written in [[Common Lisp]] (though most are also valid in [[Scheme (programming language)|Scheme]]).''<br /> <br /> ===Symbolic expressions (S-expressions)===<br /> Lisp is an [[Expression (computer science)|expression]]-oriented language. Unlike most other languages, no distinction is made between &quot;expressions&quot; and [[Statement (programming)|&quot;statements&quot;]];{{dubious|date=April 2013}}&lt;!-- (progn ...), (setq ...). There is no syntactic distinction, but sequential evaluation is there. --&gt; all code and data are written as expressions. When an expression is ''evaluated'', it produces a value (in Common Lisp, possibly multiple values), which can then be embedded into other expressions. Each value can be any data type.<br /> <br /> McCarthy's 1958 paper introduced two types of syntax: [[S-expression]]s (Symbolic expressions, also called &quot;sexps&quot;), which mirror the internal representation of code and data; and [[M-expression]]s (Meta Expressions), which express functions of S-expressions. M-expressions never found favor, and almost all Lisps today use S-expressions to manipulate both code and data.<br /> <br /> The use of parentheses is Lisp's most immediately obvious difference from other programming language families. As a result, students have long given Lisp nicknames such as ''Lost In Stupid Parentheses'', or ''Lots of Irritating Superfluous Parentheses''.&lt;ref name=&quot;LEVIN2&quot;&gt;{{cite web| title=The Jargon File - Lisp| url=http://www.catb.org/~esr/jargon/html/L/LISP.html| accessdate=2006-10-13}}&lt;/ref&gt;&lt;!-- Do not insert more nicknames. People can look in the Jargon File for them. --&gt; However, the S-expression syntax is also responsible for much of Lisp's power: the syntax is extremely regular, which facilitates manipulation by computer. However, the syntax of Lisp is not limited to traditional parentheses notation. It can be extended to include alternative notations. [[XMLisp]], for instance, is a Common Lisp extension that employs the [[Meta-object protocol|metaobject-protocol]] to integrate S-expressions with the [[Xml|Extensible Markup Language (XML)]].<br /> <br /> The reliance on expressions gives the language great flexibility. Because Lisp [[function (programming)|functions]] are themselves written as lists, they can be processed exactly like data. This allows easy writing of programs which manipulate other programs ([[metaprogramming]]). Many Lisp dialects exploit this feature using macro systems, which enables extension of the language almost without limit.<br /> <br /> ===Lists===<br /> A Lisp list is written with its elements separated by whitespace, and surrounded by parentheses. For example, {{Lisp2|(1 2 foo)}} is a list whose elements are three ''atoms'' {{Lisp2|1}}, {{Lisp2|2}}, and [[foo|{{Lisp2|foo}}]]. These values are implicitly typed: they are respectively two integers and a Lisp-specific data type called a &quot;symbol&quot;, and do not have to be declared as such.<br /> <br /> 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.<br /> <br /> 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 &quot;special operator&quot; (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<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (list 1 2 (quote foo))<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to the list {{Lisp2|(1 2 foo)}}. The &quot;quote&quot; before the [[foo|{{Lisp2|foo}}]] in the preceding example is a &quot;special operator&quot; which returns its argument without evaluating it. Any unquoted expressions are recursively evaluated before the enclosing expression is evaluated. For example,<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (list 1 2 (list 3 4))<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to the list {{Lisp2|(1 2 (3 4))}}. Note that the third argument is a list; lists can be nested.<br /> <br /> ===Operators===<br /> Arithmetic operators are treated similarly. The expression<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (+ 1 2 3 4)<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to 10. The equivalent under [[infix notation]] would be &quot;{{Lisp2|1 + 2 + 3 + 4}}&quot;.<br /> <br /> Lisp has no notion of operators as implemented in Algol-derived languages. Arithmetic operators in Lisp are [[variadic function]]s (or ''[[n-ary]]''), able to take any number of arguments. A C-style '++' increment operator is sometimes implemented under the name &lt;tt&gt;incf&lt;/tt&gt; giving syntax <br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (incf x)<br /> &lt;/syntaxhighlight&gt;<br /> , equivalent to &lt;tt&gt;(setq x (+ x 1))&lt;tt&gt;, returning the new value of &lt;tt&gt;x&lt;/tt&gt;.<br /> <br /> &quot;Special operators&quot; (sometimes called &quot;special forms&quot;) provide Lisp's control structure. For example, the special operator {{Lisp2|if}} takes three arguments. If the first argument is non-nil, it evaluates to the second argument; otherwise, it evaluates to the third argument. Thus, the expression<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (if nil<br /> (list 1 2 &quot;foo&quot;)<br /> (list 3 4 &quot;bar&quot;))<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to {{Lisp2|(3 4 &quot;bar&quot;)}}. Of course, this would be more useful if a non-trivial expression had been substituted in place of {{Lisp2|nil}}.<br /> <br /> ===Lambda expressions and function definition===<br /> Another special operator, {{Lisp2|lambda}}, is used to bind variables to values which are then evaluated within an expression. This operator is also used to create functions: the arguments to {{Lisp2|lambda}} are a list of arguments, and the expression or expressions to which the function evaluates (the returned value is the value of the last expression that is evaluated). The expression<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (lambda (arg) (+ arg 1))<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to a function that, when applied, takes one argument, binds it to {{Lisp2|arg}} and returns the number one greater than that argument. Lambda expressions are treated no differently from named functions; they are invoked the same way. Therefore, the expression<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> ((lambda (arg) (+ arg 1)) 5)<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to {{Lisp2|6}}.<br /> <br /> Named functions are created by storing a lambda expression in a symbol using the [[defun]] macro.<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (defun foo (a b c d) (+ a b c d))<br /> &lt;/syntaxhighlight&gt;<br /> <br /> {{Lisp2|(defun f (a) b...)}} defines a new function named {{Lisp2|f}} in the global environment. It is a shorthand for the expression:<br /> <br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (place-in-function-definition-slot-of-symbol 'f #'(lambda (a) b...))<br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===Atoms===<br /> In the original '''LISP''' there were two fundamental [[data type]]s: atoms and lists. A list was a finite ordered sequence of elements, where each element is in itself either an atom or a list, and an atom was a [[number]] or a symbol. A symbol was essentially a unique named item, written as an [[alphanumeric]] string in [[source code]], and used either as a variable name or as a data item in [[symbolic processing]]. For example, the list {{Lisp2|(FOO (BAR 1) 2)}} contains three elements: the symbol FOO, the list {{Lisp2|(BAR 1)}}, and the number 2.<br /> <br /> The essential difference between atoms and lists was that atoms were immutable and unique. Two atoms that appeared in different places in source code but were written in exactly the same way represented the same object,{{Citation needed|date=November 2008}} whereas each list was a separate object that could be altered independently of other lists and could be distinguished from other lists by comparison operators.<br /> <br /> As more data types were introduced in later Lisp dialects, and [[programming style]]s evolved, the concept of an atom lost importance.{{Citation needed|date=November 2008}} Many dialects still retained the predicate ''atom'' for [[legacy compatibility]],{{Citation needed|date=November 2008}} defining it true for any object which is not a cons.<br /> <br /> ===Conses and lists===<br /> {{Main|Cons}}<br /> [[File:Cons-cells.svg|thumb|right|300px|Box-and-pointer diagram for the list (42 69 613)]]<br /> A Lisp list is [[singly linked list|singly linked]]. Each cell of this list is called a ''cons'' (in Scheme, a ''pair''), and is composed of two [[pointer (computer programming)|pointer]]s, called the ''car'' and ''cdr''. These are respectively equivalent to the {{Lisp2|data}} and {{Lisp2|next}} fields discussed in the article ''[[linked list]]''.<br /> <br /> Of the many data structures that can be built out of cons cells, one of the most basic is called a ''proper list''. A proper list is either the special {{Lisp2|nil}} (empty list) symbol, or a cons in which the {{Lisp2|car}} points to a datum (which may be another cons structure, such as a list), and the {{Lisp2|cdr}} points to another proper list.<br /> <br /> If a given cons is taken to be the head of a linked list, then its car points to the first element of the list, and its cdr points to the rest of the list. For this reason, the {{Lisp2|car}} and {{Lisp2|cdr}} functions are also called {{Lisp2|first}} and {{Lisp2|rest}} when referring to conses which are part of a linked list (rather than, say, a tree).<br /> <br /> Thus, a Lisp list is not an atomic object, as an instance of a container class in C++ or Java would be. A list is nothing more than an aggregate of linked conses. A variable which refers to a given list is simply a pointer to the first cons in the list. Traversal of a list can be done by &quot;cdring down&quot; the list; that is, taking successive cdrs to visit each cons of the list; or by using any of a number of [[higher-order function]]s to map a function over a list.<br /> <br /> Because conses and lists are so universal in Lisp systems, it is a common misconception that they are Lisp's only data structures. In fact, all but the most simplistic Lisps have other data structures – such as vectors ([[Array data type|arrays]]), hash tables, structures, and so forth.<br /> <br /> ====S-expressions represent lists====<br /> Parenthesized S-expressions represent linked list structures. There are several ways to represent the same list as an S-expression. A cons can be written in ''dotted-pair notation'' as {{Lisp2|(a . b)}}, where {{Lisp2|a}} is the car and {{Lisp2|b}} the cdr. A longer proper list might be written {{Lisp2|(a . (b . (c . (d . nil))))}} in dotted-pair notation. This is conventionally abbreviated as {{Lisp2|(a b c d)}} in ''list notation''. An improper list&lt;ref&gt;NB: a so-called &quot;dotted list&quot; is only one kind of &quot;improper list&quot;. The other kind is the &quot;circular list&quot; where the cons cells form a loop. Typically this is represented using #n=(...) to represent the target cons cell that will have multiple references, and #n# is used to refer to this cons. For instance, (#1=(a b) . #1#) would normally be printed as ((a b) a b) (without circular structure printing enabled), but makes the reuse of the cons cell clear. #1=(a . #1#) cannot normally be printed as it is circular, the CDR of the cons cell defined by #1= is itself.&lt;/ref&gt; may be written in a combination of the two – as {{Lisp2|(a b c . d)}} for the list of three conses whose last cdr is {{Lisp2|d}} (i.e., the list {{Lisp2|(a . (b . (c . d)))}} in fully specified form).<br /> <br /> ====List-processing procedures====<br /> Lisp provides many built-in procedures for accessing and controlling lists. Lists can be created directly with the {{Lisp2|list}} procedure, which takes any number of arguments, and returns the list of these arguments.<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (list 1 2 'a 3)<br /> ;Output: (1 2 a 3)<br /> &lt;/syntaxhighlight&gt;<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (list 1 '(2 3) 4)<br /> ;Output: (1 (2 3) 4)<br /> &lt;/syntaxhighlight&gt;<br /> Because of the way that lists are constructed from [[cons pair]]s, the {{Lisp2|cons}} procedure can be used to add an element to the front of a list. Note that the {{Lisp2|cons}} procedure is asymmetric in how it handles list arguments, because of how lists are constructed.<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (cons 1 '(2 3))<br /> ;Output: (1 2 3)<br /> &lt;/syntaxhighlight&gt;<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (cons '(1 2) '(3 4))<br /> ;Output: ((1 2) 3 4)<br /> &lt;/syntaxhighlight&gt;<br /> The {{Lisp2|append}} procedure appends two (or more) lists to one another. Because Lisp lists are linked lists, appending two lists has [[Big O notation|asymptotic time complexity]] &lt;math&gt;O(n)&lt;/math&gt;<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (append '(1 2) '(3 4))<br /> ;Output: (1 2 3 4)<br /> &lt;/syntaxhighlight&gt;<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (append '(1 2 3) '() '(a) '(5 6))<br /> ;Output: (1 2 3 a 5 6)<br /> &lt;/syntaxhighlight&gt;<br /> <br /> ====Shared structure====<br /> Lisp lists, being simple linked lists, can share structure with one another. That is to say, two lists can have the same ''tail'', or final sequence of conses. For instance, after the execution of the following Common Lisp code:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (setf foo (list 'a 'b 'c))<br /> (setf bar (cons 'x (cdr foo)))<br /> &lt;/syntaxhighlight&gt;<br /> the lists {{Lisp2|foo}} and {{Lisp2|bar}} are {{Lisp2|(a b c)}} and {{Lisp2|(x b c)}} respectively. However, the tail {{Lisp2|(b c)}} is the same structure in both lists. It is not a copy; the cons cells pointing to {{Lisp2|b}} and {{Lisp2|c}} are in the same memory locations for both lists.<br /> <br /> Sharing structure rather than copying can give a dramatic performance improvement. However, this technique can interact in undesired ways with functions that alter lists passed to them as arguments. Altering one list, such as by replacing the {{Lisp2|c}} with a {{Lisp2|goose}}, will affect the other:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (setf (third foo) 'goose)<br /> &lt;/syntaxhighlight&gt;<br /> This changes {{Lisp2|foo}} to {{Lisp2|(a b goose)}}, but thereby also changes {{Lisp2|bar}} to {{Lisp2|(x b goose)}} – a possibly unexpected result. This can be a source of bugs, and functions which alter their arguments are documented as ''destructive'' for this very reason.<br /> <br /> Aficionados of [[functional programming]] avoid destructive functions. In the Scheme dialect, which favors the functional style, the names of destructive functions are marked with a cautionary exclamation point, or &quot;bang&quot;—such as {{Lisp2|set-car!}} (read ''set car bang''), which replaces the car of a cons. In the Common Lisp dialect, destructive functions are commonplace; the equivalent of {{Lisp2|set-car!}} is named {{Lisp2|rplaca}} for &quot;replace car.&quot; This function is rarely seen however as Common Lisp includes a special facility, {{Lisp2|setf}}, to make it easier to define and use destructive functions. A frequent style in Common Lisp is to write code functionally (without destructive calls) when prototyping, then to add destructive calls as an optimization where it is safe to do so.<br /> <br /> ===Self-evaluating forms and quoting===<br /> Lisp evaluates expressions which are entered by the user. Symbols and lists evaluate to some other (usually, simpler) expression – for instance, a symbol evaluates to the value of the variable it names; {{Lisp2|(+ 2 3)}} evaluates to {{Lisp2|5}}. However, most other forms evaluate to themselves: if you enter {{Lisp2|5}} into Lisp, it returns {{Lisp2|5}}.<br /> <br /> Any expression can also be marked to prevent it from being evaluated (as is necessary for symbols and lists). This is the role of the {{Lisp2|quote}} special operator, or its abbreviation {{Lisp2|'}} (a single quotation mark). For instance, usually if you enter the symbol {{Lisp2|foo}} you will get back the value of the corresponding variable (or an error, if there is no such variable). If you wish to refer to the literal symbol, you enter {{Lisp2|(quote foo)}} or, usually, {{Lisp2|'foo}}.<br /> <br /> {{anchor|Backquote}}Both Common Lisp and Scheme also support the ''backquote'' operator (known as ''[[quasiquote]]'' in Scheme), entered with the {{Lisp2|`}} character ([[Grave accent#Use in programming|grave accent]]). This is almost the same as the plain quote, except it allows expressions to be evaluated and their values interpolated into a quoted list with the comma {{Lisp2|,}} ''unquote'' and comma-at {{Lisp2|,@}} ''splice'' operators. If the variable {{Lisp2|snue}} has the value {{Lisp2|(bar baz)}} then {{Lisp2|`(foo ,snue)}} evaluates to {{Lisp2|(foo (bar baz))}}, while {{Lisp2|`(foo ,@snue)}} evaluates to {{Lisp2|(foo bar baz)}}. The backquote is most frequently used in defining macro expansions.&lt;ref&gt;{{cite web|url=http://www.cs.washington.edu/education/courses/cse341/04wi/lectures/14-scheme-quote.html |title=CSE 341: Scheme: Quote, Quasiquote, and Metaprogramming |publisher=Cs.washington.edu |date=1999-02-22 |accessdate=2013-11-15}}&lt;/ref&gt;&lt;ref&gt;[http://repository.readscheme.org/ftp/papers/pepm99/bawden.pdf Quasiquotation in Lisp], Alan Bawden&lt;/ref&gt;<br /> <br /> Self-evaluating forms and quoted forms are Lisp's equivalent of literals. It may be possible to modify the values of (mutable) literals in program code. For instance, if a function returns a quoted form, and the code that calls the function modifies the form, this may alter the behavior of the function on subsequent iterations.<br /> <br /> &lt;syntaxhighlight lang=lisp&gt;<br /> (defun should-be-constant ()<br /> '(one two three))<br /> <br /> (let ((stuff (should-be-constant)))<br /> (setf (third stuff) 'bizarre)) ; bad!<br /> <br /> (should-be-constant) ; returns (one two bizarre)<br /> &lt;/syntaxhighlight&gt;<br /> <br /> Modifying a quoted form like this is generally considered bad style, and is defined by ANSI Common Lisp as erroneous (resulting in &quot;undefined&quot; behavior in compiled files, because the file-compiler can coalesce similar constants, put them in write-protected memory, etc.).<br /> <br /> Lisp's formalization of quotation has been noted by [[Douglas Hofstadter]] (in ''[[Gödel, Escher, Bach]]'') and others as an example of the [[philosophy|philosophical]] idea of [[self-reference]].<br /> <br /> ===Scope and closure===<br /> The Lisp family splits over the use of dynamic or static (a.k.a. lexical) [[scope (programming)|scope]]. Clojure, Common Lisp and Scheme make use of static scoping by default, while [[Newlisp]], [[Picolisp]] and the embedded languages in [[Emacs]] and [[AutoCAD]] use dynamic scoping.<br /> <br /> ===List structure of program code; exploitation by macros and compilers===<br /> A fundamental distinction between Lisp and other languages is that in Lisp, the textual representation of a program is simply a human-readable description of the same internal data structures (linked lists, symbols, number, characters, etc.) as would be used by the underlying Lisp system.<br /> <br /> Lisp uses this to implement a very powerful macro system. Like other macro languages such as [[C (programming language)|C]], a macro returns code that can then be compiled. However, unlike C macros, the macros are Lisp functions and so can exploit the full power of Lisp.<br /> <br /> Further, because Lisp code has the same structure as lists, macros can be built with any of the list-processing functions in the language. In short, anything that Lisp can do to a data structure, Lisp macros can do to code. In contrast, in most other languages, the parser's output is purely internal to the language implementation and cannot be manipulated by the programmer.<br /> <br /> This feature makes it easy to develop ''efficient'' languages within languages. For example, the Common Lisp Object System can be implemented cleanly as a language extension using macros. This means that if an application requires a different inheritance mechanism, it can use a different object system. This is in stark contrast to most other languages; for example, Java does not support multiple inheritance and there is no reasonable way to add it.<br /> <br /> In simplistic Lisp implementations, this list structure is directly [[interpreter (computing)|interpreted]] to run the program; a function is literally a piece of list structure which is traversed by the interpreter in executing it. However, most substantial Lisp systems also include a compiler. The compiler translates list structure into machine code or [[bytecode]] for execution. This code can run as fast as code compiled in conventional languages such as C.<br /> <br /> Macros expand before the compilation step, and thus offer some interesting options. If a program needs a precomputed table, then a macro might create the table at compile time, so the compiler need only output the table and need not call code to create the table at run time. Some Lisp implementations even have a mechanism, &lt;code&gt;eval-when&lt;/code&gt;, that allows code to be present during compile time (when a macro would need it), but not present in the emitted module.&lt;ref&gt;[http://www.gnu.org/software/emacs/manual/html_node/cl/Time-of-Evaluation.html Time of Evaluation - Common Lisp Extensions]. Gnu.org. Retrieved on 2013-07-17.&lt;/ref&gt;<br /> <br /> ===Evaluation and the read–eval–print loop===<br /> Lisp languages are frequently used with an interactive [[command line]], which may be combined with an [[integrated development environment]]. The user types in expressions at the command line, or directs the IDE to transmit them to the Lisp system. Lisp ''reads'' the entered expressions, ''evaluates'' them, and ''prints'' the result. For this reason, the Lisp command line is called a &quot;[[read–eval–print loop]]&quot;, or ''[[REPL]]''.<br /> <br /> The basic operation of the REPL is as follows. This is a simplistic description which omits many elements of a real Lisp, such as quoting and macros.<br /> <br /> The {{Lisp2|read}} function accepts textual S-expressions as input, and parses them into an internal data structure. For instance, if you type the text {{Lisp2|(+ 1 2)}} at the prompt, {{Lisp2|read}} translates this into a linked list with three elements: the symbol {{Lisp2|+}}, the number 1, and the number 2. It so happens that this list is also a valid piece of Lisp code; that is, it can be evaluated. This is because the car of the list names a function—the addition operation.<br /> <br /> Note that a {{Lisp2|foo}} will be read as a single symbol. {{Lisp2|123}} will be read as the number one hundred and twenty-three. {{Lisp2|&quot;123&quot;}} will be read as the string &quot;123&quot;.<br /> <br /> The {{Lisp2|eval}} function evaluates the data, returning zero or more other Lisp data as a result. Evaluation does not have to mean interpretation; some Lisp systems compile every expression to native machine code. It is simple, however, to describe evaluation as interpretation: To evaluate a list whose car names a function, {{Lisp2|eval}} first evaluates each of the arguments given in its cdr, then applies the function to the arguments. In this case, the function is addition, and applying it to the argument list {{Lisp2|(1 2)}} yields the answer {{Lisp2|3}}. This is the result of the evaluation.<br /> <br /> The symbol {{Lisp2|foo}} evaluates to the value of the symbol foo. Data like the string &quot;123&quot; evaluates to the same string. The list {{Lisp2|(quote (1 2 3))}} evaluates to the list (1 2 3).<br /> <br /> It is the job of the {{Lisp2|print}} function to represent output to the user. For a simple result such as {{Lisp2|3}} this is trivial. An expression which evaluated to a piece of list structure would require that {{Lisp2|print}} traverse the list and print it out as an S-expression.<br /> <br /> To implement a Lisp REPL, it is necessary only to implement these three functions and an infinite-loop function. (Naturally, the implementation of {{Lisp2|eval}} will be complicated, since it must also implement all special operators like {{Lisp2|if}} or {{Lisp2|lambda}}.) This done, a basic REPL itself is but a single line of code: {{Lisp2|(loop (print (eval (read))))}}.<br /> <br /> The Lisp REPL typically also provides input editing, an input history, error handling and an interface to the debugger.<br /> <br /> Lisp is usually evaluated [[eager evaluation|eagerly]]. In [[Common Lisp]], arguments are evaluated in [[applicative order]] ('leftmost innermost'), while in [[Scheme programming language|Scheme]] order of arguments is undefined, leaving room for optimization by a compiler.<br /> <br /> ===Control structures===<br /> Lisp originally had very few control structures, but many more were added during the language's evolution. (Lisp's original conditional operator, {{Lisp2|cond}}, is the precursor to later {{Lisp2|if-then-else}} structures.)<br /> <br /> Programmers in the Scheme dialect often express loops using [[tail recursion]]. Scheme's commonality in academic computer science has led some students to believe that tail recursion is the only, or the most common, way to write iterations in Lisp, but this is incorrect. All frequently seen Lisp dialects have imperative-style iteration constructs, from Scheme's {{Lisp2|do}} loop to [[Common Lisp]]'s complex {{Lisp2|loop}} expressions. Moreover, the key issue that makes this an objective rather than subjective matter is that Scheme makes specific requirements for the handling of [[tail call]]s, and consequently the reason that the use of tail recursion is generally encouraged for Scheme is that the practice is expressly supported by the language definition itself. By contrast, ANSI Common Lisp does not require&lt;ref&gt;[http://www.lispworks.com/documentation/HyperSpec/Body/03_bbc.htm 3.2.2.3 Semantic Constraints] in [http://www.lispworks.com/documentation/HyperSpec/Front/index.htm ''Common Lisp HyperSpec'']&lt;/ref&gt; the optimization commonly referred to as tail call elimination. Consequently, the fact that tail recursive style as a casual replacement for the use of more traditional [[iteration]] constructs (such as {{Lisp2|do}}, {{Lisp2|dolist}} or {{Lisp2|loop}}) is discouraged&lt;ref&gt;4.3. Control Abstraction (Recursion vs. Iteration) in [http://www.cs.umd.edu/~nau/cmsc421/norvig-lisp-style.pdf Tutorial on Good Lisp Programming Style] by [[Kent Pitman|Pitman]] and [[Peter Norvig|Norvig]], August, 1993.&lt;/ref&gt; in Common Lisp is not just a matter of stylistic preference, but potentially one of efficiency (since an apparent tail call in Common Lisp may not compile as a simple [[Branch (computer science)|jump]]) and program correctness (since tail recursion may increase stack use in Common Lisp, risking [[stack overflow]]).<br /> <br /> Some Lisp control structures are ''special operators'', equivalent to other languages' syntactic keywords. Expressions using these operators have the same surface appearance as function calls, but differ in that the arguments are not necessarily evaluated—or, in the case of an iteration expression, may be evaluated more than once.<br /> <br /> In contrast to most other major programming languages, Lisp allows the programmer to implement control structures using the language itself. Several control structures are implemented as Lisp macros, and can even be macro-expanded by the programmer who wants to know how they work.<br /> <br /> Both Common Lisp and Scheme have operators for non-local control flow. The differences in these operators are some of the deepest differences between the two dialects. Scheme supports ''re-entrant [[continuation]]s'' using the {{Lisp2|call/cc}} procedure, which allows a program to save (and later restore) a particular place in execution. Common Lisp does not support re-entrant continuations, but does support several ways of handling escape continuations.<br /> <br /> Frequently, the same algorithm can be expressed in Lisp in either an imperative or a functional style. As noted above, Scheme tends to favor the functional style, using tail recursion and continuations to express control flow. However, imperative style is still quite possible. The style preferred by many Common Lisp programmers may seem more familiar to programmers used to structured languages such as C, while that preferred by Schemers more closely resembles pure-functional languages such as [[Haskell (programming language)|Haskell]].<br /> <br /> Because of Lisp's early heritage in list processing, it has a wide array of higher-order functions relating to iteration over sequences. In many cases where an explicit loop would be needed in other languages (like a {{Lisp2|for}} loop in C) in Lisp the same task can be accomplished with a higher-order function. (The same is true of many functional programming languages.)<br /> <br /> A good example is a function which in Scheme is called {{Lisp2|map}} and in Common Lisp is called {{Lisp2|mapcar}}. Given a function and one or more lists, {{Lisp2|mapcar}} applies the function successively to the lists' elements in order, collecting the results in a new list:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (mapcar #'+ '(1 2 3 4 5) '(10 20 30 40 50))<br /> &lt;/syntaxhighlight&gt;<br /> This applies the {{Lisp2|+}} function to each corresponding pair of list elements, yielding the result {{Lisp2|(11 22 33 44 55)}}.<br /> <br /> ==Examples==<br /> Here are examples of Common Lisp code.<br /> <br /> The basic &quot;[[Hello world]]&quot; program:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (print &quot;Hello world&quot;)<br /> &lt;/syntaxhighlight&gt;<br /> Lisp syntax lends itself naturally to recursion. Mathematical problems such as the enumeration of recursively defined sets are simple to express in this notation.<br /> <br /> Evaluate a number's [[factorial]]:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (defun factorial (n)<br /> (if (= n 0) 1<br /> (* n (factorial (- n 1)))))<br /> &lt;/syntaxhighlight&gt;<br /> An alternative implementation, often faster than the previous version if the Lisp system has [[tail recursion]] optimization:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (defun factorial (n &amp;optional (acc 1))<br /> (if (= n 0) acc<br /> (factorial (- n 1) (* acc n))))<br /> &lt;/syntaxhighlight&gt;<br /> Contrast with an iterative version which uses [[Common Lisp]]'s {{Lisp2|loop}} macro:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (defun factorial (n)<br /> (loop for i from 1 to n<br /> for fac = 1 then (* fac i)<br /> finally (return fac)))<br /> &lt;/syntaxhighlight&gt;<br /> <br /> The following function reverses a list. (Lisp's built-in ''reverse'' function does the same thing.)<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (defun -reverse (list)<br /> (let ((return-value '()))<br /> (dolist (e list) (push e return-value))<br /> return-value))<br /> &lt;/syntaxhighlight&gt;<br /> <br /> ==Object systems==<br /> Various object systems and models have been built on top of, alongside, or into Lisp, including:<br /> *The [[Common Lisp Object System]], CLOS, is an integral part of ANSI Common Lisp. CLOS descended from New Flavors and CommonLOOPS. ANSI Common Lisp was the first standardized object-oriented programming language (1994, ANSI X3J13).<br /> *ObjectLisp&lt;ref&gt;pg 17 of Bobrow 1986&lt;/ref&gt; or [[Object Lisp]], used by [[Lisp Machines Incorporated]] and early versions of Macintosh Common Lisp<br /> *LOOPS (Lisp Object-Oriented Programming System) and the later [[CommonLOOPS]]<br /> *[[Flavors (computer science)|Flavors]], built at [[Massachusetts Institute of Technology|MIT]], and its descendant New Flavors (developed by [[Symbolics]]).<br /> *KR (short for Knowledge Representation), a [[Constraint satisfaction|constraint]]s-based object system developed to aid the writing of Garnet, a GUI library for [[Common Lisp]].<br /> *[[Knowledge Engineering Environment|KEE]] used an object system called UNITS and integrated it with an [[inference engine]]&lt;ref&gt;Veitch, p 108, 1988&lt;/ref&gt; and a [[Truth maintenance systems|truth maintenance system]] (ATMS).<br /> <br /> ==See also==<br /> *[[Fexpr]]<br /> *[[Maxima (software)|Maxima]]<br /> *[[mod_lisp]]<br /> *[[P convention]]<br /> *[[Prolog]]<br /> *[[LFE (programming language)|LFE]] (Lisp Flavored Erlang)<br /> * [[RPL (programming language)|RPL]] (Reverse Polish Lisp)<br /> *[[MATHLAB]]<br /> <br /> ==References==<br /> {{Reflist|30em}}<br /> <br /> ==Further reading==<br /> {{Refbegin}}<br /> *{{cite web<br /> | last = McCarthy<br /> | first = John<br /> | authorlink =<br /> | title = The implementation of Lisp<br /> | work = History of Lisp<br /> | publisher = Stanford University<br /> | date = 1979-02-12<br /> | url = http://www-formal.stanford.edu/jmc/history/lisp/node3.html<br /> | doi =<br /> | accessdate = 2008-10-17}}<br /> *{{Cite conference<br /> | first = Guy L.<br /> | last = Steele, Jr.<br /> | authorlink =<br /> |author2=Richard P. Gabriel<br /> | title = The evolution of Lisp<br /> | conference = The second ACM SIGPLAN conference on History of programming languages<br /> | pages = 231–270<br /> | publisher = ACM<br /> | year = 1993<br /> | location = New York, NY<br /> | url = http://www.dreamsongs.com/NewFiles/HOPL2-Uncut.pdf<br /> | doi =<br /> | id =<br /> | isbn = 0-89791-570-4<br /> | accessdate = 2008-10-17}}<br /> *{{Cite book<br /> | first = Jim<br /> | last = Veitch<br /> | author-link =<br /> | author2-link =<br /> | editor-last = Salus<br /> | editor-first = Peter H<br /> | editor2-last =<br /> | editor2-first =<br /> | contribution = A history and description of CLOS<br /> | contribution-url =<br /> | title = Handbook of programming languages<br /> | volume = Volume IV, Functional and logic programming languages<br /> | edition = first<br /> | year = 1998<br /> | pages = 107–158<br /> | place = Indianapolis, IN<br /> | publisher = Macmillan Technical Publishing<br /> | url =<br /> | doi =<br /> | id =<br /> | isbn = 1-57870-011-6<br /> | postscript = &lt;!--None--&gt; }}<br /> *{{Cite book<br /> |title= [[Structure and Interpretation of Computer Programs]]<br /> |first= Harold<br /> |last= Abelson<br /> |author-link= Harold Abelson<br /> |first2= Gerald Jay<br /> |last2= Sussman<br /> |author2-link= Gerald Jay Sussman<br /> |first3= Julie<br /> |last3= Sussman<br /> |author3-link= Julie Sussman<br /> |year= 1996<br /> |edition= 2nd<br /> |publisher= MIT Press<br /> |isbn= 0-262-01153-0<br /> |doi= }}<br /> *[http://www.gnu.org/gnu/rms-lisp.html My Lisp Experiences and the Development of GNU Emacs], [[transcription (linguistics)|transcript]] of [[Richard Stallman]]'s speech, 28 October 2002, at the [[International Lisp Conference]]<br /> *{{Cite book<br /> |first= Paul<br /> |last= Graham<br /> |author-link= Paul Graham (computer programmer)<br /> |title= [[Hackers &amp; Painters| Hackers &amp; Painters. Big Ideas from the Computer Age]]<br /> |year= 2004<br /> |publisher= O'Reilly<br /> |isbn= 0-596-00662-4<br /> |doi= }}<br /> *{{Cite book<br /> |editor-last= Berkeley<br /> |editor-first= Edmund C.<br /> |editor-link= Edmund Berkeley<br /> |editor2-last= Bobrow<br /> |editor2-first= Daniel G.<br /> |editor2-link= Daniel G. Bobrow<br /> |title= The Programming Language LISP: Its Operation and Applications<br /> |url= http://www.softwarepreservation.org/projects/LISP/book/III_LispBook_Apr66.pdf<br /> |date= March 1964<br /> |publisher= MIT Press<br /> |location= Cambridge, Massachusetts<br /> |isbn=<br /> |doi= }}<br /> *{{Cite book<br /> |last= Weissman<br /> |first= Clark<br /> |title= LISP 1.5 Primer<br /> |year= 1967<br /> |url= http://www.softwarepreservation.org/projects/LISP/book/Weismann_LISP1.5_Primer_1967.pdf<br /> |publisher= Dickenson Publishing Company Inc.<br /> |location= Belmont, California<br /> |isbn=<br /> |doi=}}<br /> {{Refend}}<br /> <br /> ==External links==<br /> {{Sister project links|wikt=Lisp|commons=Category:Lisp (programming language)|n=no|q=Lisp programming language|b=Subject:Lisp programming language|v=Topic:Lisp|s=Lambda Papers}}<br /> ;History<br /> *[http://www-formal.stanford.edu/jmc/history/lisp/lisp.html History of Lisp] – [[John McCarthy (computer scientist)|John McCarthy]]'s history of 12 February 1979<br /> *[http://www8.informatik.uni-erlangen.de/html/lisp-enter.html Lisp History]{{dead link|date=May 2013}} – Herbert Stoyan's history compiled from the documents (acknowledged by McCarthy as more complete than his own, see: [http://www-formal.stanford.edu/jmc/history/ McCarthy's history links])<br /> *[http://www.softwarepreservation.org/projects/LISP/ History of LISP at the Computer History Museum]<br /> <br /> ;Associations and meetings<br /> *[http://www.alu.org/ Association of Lisp Users]<br /> *[http://www.weitz.de/eclm2013/ European Common Lisp Meeting]<br /> *[http://european-lisp-symposium.org/ European Lisp Symposium]<br /> *[http://www.international-lisp-conference.org/ International Lisp Conference]<br /> <br /> ; Books and tutorials<br /> *''[http://www.lisperati.com/casting.html Casting SPELs in Lisp]'', a comic-book style introductory tutorial<br /> *''[http://paulgraham.com/onlisptext.html On Lisp]'', a free book by [[Paul Graham (computer programmer)|Paul Graham]]<br /> *''[http://www.gigamonkeys.com/book/ Practical Common Lisp]'', freeware edition by Peter Seibel<br /> * [http://leanpub.com/lispweb Lisp for the web]<br /> * [http://landoflisp.com/ Land of Lisp]<br /> * [http://letoverlambda.com/ Let over Lambda]<br /> <br /> ; Interviews<br /> *[http://purl.umn.edu/107476 Oral history interview with John McCarthy] at [[Charles Babbage Institute]], University of Minnesota, Minneapolis. McCarthy discusses his role in the development of time-sharing at the Massachusetts Institute of Technology. He also describes his work in artificial intelligence (AI) funded by the Advanced Research Projects Agency, including logic-based AI (LISP) and robotics.<br /> *[http://www.se-radio.net/2008/01/episode-84-dick-gabriel-on-lisp/ Interview] with [[Richard P. Gabriel]] (Podcast)<br /> <br /> ;Resources<br /> *[http://www.cliki.net/ CLiki: the common lisp wiki]<br /> *[http://www.cl-user.net/ Common Lisp directory]<br /> *[http://www.faqs.org/faqs/lisp-faq/ Lisp FAQ Index]<br /> *[http://paste.lisp.org/ lisppaste]<br /> *[http://planet.lisp.org/ Planet Lisp]<br /> *[http://lispnews.wordpress.com/ Weekly Lisp News]<br /> *{{dmoz|Computers/Programming/Languages/Lisp|Lisp}}<br /> <br /> {{John McCarthy navbox}}<br /> <br /> {{DEFAULTSORT:Lisp Programming Language}}<br /> [[Category:1958 in computer science]]<br /> [[Category:Academic programming languages]]<br /> [[Category:American inventions]]<br /> [[Category:Articles with example Lisp code]]<br /> [[Category:Dynamically typed programming languages]]<br /> [[Category:Functional languages]]<br /> [[Category:Lisp (programming language)| ]]<br /> [[Category:Lisp programming language family| ]]<br /> [[Category:Programming languages created in 1958]]<br /> [[Category:Programming languages created in the 1950s]]<br /> [[Category:Extensible syntax programming languages]]<br /> <br /> [[la:Lisp]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Linda_Cardellini&diff=697813805 Linda Cardellini 2016-01-02T02:48:43Z <p>PuercoPop: Remove line feed character from web citation template</p> <hr /> <div>{{Use mdy dates|date=October 2013}}<br /> {{Infobox person<br /> | name = Linda Cardellini<br /> | image = Linda Cardellini Deauville 2011.jpg<br /> | caption = Cardellini at the 2011&lt;br&gt;[[Deauville American Film Festival]]<br /> | alt = Wearing a violet sleeveless wrap, hair in a shoulder-length feather cut<br /> | birth_date = {{Birth date and age|mf=yes|1975|6|25}}<br /> | birth_place = [[Redwood City, California]], U.S.<br /> | birth_name = Linda Edna Cardellini<br /> | occupation = [[Actress]], [[Voice actor]]<br /> | years_active = 1996–present<br /> | education = [[Loyola Marymount University]]<br /> | partner = Steven Rodriguez &lt;small&gt;(2009-present; engaged since 2013)&lt;/small&gt;<br /> | children = 1<br /> | spouse =<br /> | website =<br /> }}<br /> '''Linda Edna Cardellini''' (born June 25, 1975) is an American actress. She is known for her roles as [[Lindsay Weir (Freaks and Geeks)|Lindsay Weir]] on ''[[Freaks and Geeks]]'', [[Samantha Taggart]] on ''[[ER (TV series)|ER]]'', [[Velma Dinkley]] in the live-action ''[[Scooby-Doo (film)|Scooby-Doo]]'' feature films, Sylvia Rosen, neighbor of [[Don Draper]]'s, on the [[AMC (TV channel)|AMC]] drama series ''[[Mad Men]]'', Meg Rayburn on the [[Netflix]] original series ''[[Bloodline (TV series)|Bloodline]]'', Laura Barton in ''[[Avengers: Age of Ultron]]'', and Wendy Corduroy in ''[[Gravity Falls]]''.<br /> <br /> ==Early life==<br /> Cardellini was born in [[Redwood City, California]], the daughter of Lorraine (née Hernan), a homemaker, and Wayne David Cardellini, a businessman.&lt;ref name=&quot;knockoutnerd&quot;&gt;{{cite web|url=http://www.people.com/people/archive/article/0,,20137425,00.html|title=Knockout Nerd - Scooby-Doo, Linda Cardellini|work=[[People (magazine)|People]]|date=July 1, 2002 |accessdate=June 9, 2013}}&lt;/ref&gt; She is the youngest of four children.&lt;ref name=&quot;knockoutnerd&quot;/&gt; Cardellini is of Italian (from her paternal grandfather), Irish (her mother), German, English, and Scottish descent,&lt;ref&gt;{{cite web|url=http://www.starpulse.com/news/Jason_Coleman/2012/02/10/interviewreview_linda_cardellini_on_re|title=Interview/Review: Linda Cardellini On Researching 'Return', Michael Shannon And Being A First-Time Mom|publisher=Starpulse.com|date=February 10, 2012|accessdate=June 9, 2013}}&lt;/ref&gt;&lt;ref&gt;{{cite web | url=http://www.imdb.com/name/nm0004802/bio?ref_=nm_ov_bio_sm|title=Linda Cardellini Biography|publisher=IMDb.com|accessdate=2015-09-19}}&lt;/ref&gt; and was raised Catholic.&lt;ref&gt;{{cite web|last=Watkins |first=Gwynne |url=http://www.gq.com/blogs/the-feed/2013/06/mad-men-interview-linda-cardellini-sylvia-rosen.html |title=The Mad Men GQ+A: Linda Cardellini on Sylvia Rosen's Extramarital Bombshell: The Q |publisher=GQ |date=June 12, 2013 |accessdate=October 31, 2013}}&lt;/ref&gt; She made her first public appearance at age 10, when she sang in a school play. Subsequently, she acted in several school productions and started attending drama lessons.&lt;ref name=&quot;NYDN&quot;/&gt; She graduated from nearby [[Mountain View, California|Mountain View]]'s Catholic [[Saint Francis High School (Mountain View)|St. Francis High School]] in 1993,&lt;ref name=&quot;AskMen&quot;/&gt; then moved to Los Angeles to seek roles in television and film.&lt;ref name=&quot;NYDN&quot;/&gt;<br /> <br /> ==Career==<br /> Cardellini received her first big break role in 1996 when she landed a starring role as Sarah on [[American Broadcasting Company|ABC]]'s Saturday morning live-action children's series, ''[[Bone Chillers]]''. Following this, she made guest appearances on prime-time programs such as ''[[Step by Step (TV series)|Step by Step]]'', ''[[Clueless (TV series)|Clueless]]'', ''[[3rd Rock from the Sun]]'', and ''[[Boy Meets World]]'' as Lauren, a girl that came between the show's star couple. Cardellini co-starred in the [[AMC (TV channel)|AMC]] mini-series ''The Lot'' in 1999,&lt;ref name=&quot;NYDN&quot; /&gt; and spent the summer in Europe as part of a touring production of ''Lancelot'', a fourteenth-century Dutch tragedy.&lt;ref name=&quot;AskMen&quot; /&gt;<br /> <br /> [[File:Linda Cardellini onstage.jpg|thumb|left|alt=in black jeans and off-the-shoulder sleeve top, gesturing palm up to audience|Cardellini as part of &quot;Dr. God&quot;, 2010]]<br /> Cardellini had her first major success when she landed one of the starring roles in the [[NBC]] series ''[[Freaks and Geeks]]'', which debuted during the 1999–2000 season. As Lindsay Weir, an honor student in the midst of an identity crisis, Cardellini earned positive response that subsequently catapulted her to fame. Cardellini starred in the live-action adaptation of ''[[Scooby-Doo (film)|Scooby-Doo]]'' in 2002, in which she brought to life the cartoon character of Velma Dinkley. She would later reprise the role of Velma in 2004's ''[[Scooby-Doo 2: Monsters Unleashed]]''. She joined the cast of the hospital drama ''[[ER (TV series)|ER]]'' in 2003 as Samantha Taggart, a free-spirited nurse. Cardellini acted for six seasons on ''ER'', until the series finale, &quot;[[And in the End...]]&quot;, and with the cast won the [[TV Land]] ensemble ''Icon Award'' in 2009.&lt;ref name=&quot;MnC&quot;&gt;{{cite web|title=TV Land Awards gives Icon award to 'ER'|first=April|last=MacIntyre|date=April 9, 2009|publisher=[[Monsters and Critics]]|url=http://www.monstersandcritics.com/smallscreen/news/article_1469892.php/2009_TV_Land_Awards_gives_Icon_award_to_ER}}&lt;/ref&gt;<br /> <br /> Her other film work includes roles in ''[[Dead Man on Campus]]'', ''[[Strangeland (film)|Strangeland]]'', ''[[Good Burger]]'', ''[[Legally Blonde]]'', ''[[Brokeback Mountain]]'' (for which she was nominated for the ensemble [[Gotham Awards|Gotham]]&lt;ref name=&quot;FMM&quot;&gt;[http://www.filmmakermagazine.com/news/2005/10/gotham-awards-nominations-announced/ Gotham Awards Nominations Announced]. FilmMakerMagazine.com, October 25, 2005.&lt;/ref&gt; and [[Screen Actors Guild]] awards),&lt;ref&gt;{{cite web |title=12th Annual Screen Actors Guild Awards and Nominees |publisher=[[Screen Actors Guild]] |year=2006 |url=http://www.sagawards.org/awards/nominees-and-recipients/12th-annual-screen-actors-guild-awards}}&lt;/ref&gt; and a starring role in the [[Happy Madison]] film ''[[Grandma's Boy (2006 film)|Grandma's Boy]]'' as Samantha. She was the voice of Ursula in the [[Role-playing game|role-playing]] video game, ''[[Gladius (video game)|Gladius]]'', and played the voice of Bliss Goode on the ABC animated series ''[[The Goode Family]]''. In 2007, Cardellini was chosen to play lovelorn Clara in the [[CBS]] miniseries ''[[Comanche Moon (TV miniseries)|Comanche Moon]]'', a prequel to 1989's ''[[Lonesome Dove]]''.&lt;ref name=&quot;ew&quot; /&gt;<br /> <br /> In 2010 and 2011, Cardellini returned to the stage with the Dr. God comedy group in Los Angeles and San Francisco,&lt;ref name=&quot;drgod&quot;/&gt;&lt;ref name=&quot;sfsketch&quot;/&gt; appeared in ''[[Kill the Irishman]]'' and [[Super (2011 film)|''Super'']], and starred in the independent film [[Return (2011 film)|''Return'']].<br /> <br /> Cardellini appeared with cast members and producers of ''[[Freaks and Geeks]]'' and ''[[Undeclared]]'' at the [[Paley Center for Media]] PaleyFest on March 12, 2011.&lt;ref&gt;{{cite web|url=http://www.paleycenter.org/paleyfest2011-freaksgeeksundeclared|title=Freaks and Geeks / Undeclared Reunion|publisher=PaleyCenter.org|date=March 12, 2011|accessdate=March 16, 2011}}&lt;/ref&gt;&lt;ref&gt;{{cite web|url=http://tv.ign.com/articles/115/1155388p1.html|title=Freaks and Geeks Still Rocks|work=IGN|date=March 14, 2011|accessdate=March 16, 2011}}&lt;/ref&gt; Since June 15, 2012, she has been the voice of Wendy on the Disney Channel show ''[[Gravity Falls]]''.<br /> <br /> Cardellini voice acts periodically on the podcast and live show ''[[The Thrilling Adventure Hour]]'', on the ''Sparks Nevada: Marshall on Mars'' segments.&lt;ref&gt;{{cite web|url=http://thrillingadventurehour.com/theshow.php |accessdate=October 31, 2013 |title=About the Show and the Segments Within - Sparks Nevada, Marshal on Mars |publisher=The Thrilling Adventure Hour }}&lt;/ref&gt;&lt;ref&gt;{{cite web|url=http://blogs.laweekly.com/arts/2010/06/martians_and_superheroes_and_n.php |title=Martians and Superheroes and Nazis, Oh My!: 'Adventure Hour' Thrills Sell-Out Largo Crowd|first=Nicole |last=Campos |publisher=LA Weekly |date=June 8, 2010 |work=Public Spectacle art blog (We Recommend) |accessdate=October 31, 2013}}&lt;/ref&gt;<br /> <br /> In 2013, Cardellini was chosen to play Sylvia Rosen, a love interest of [[Don Draper]] on ''[[Mad Men]]''. For her performance on ''Mad Men'', she received an Emmy nomination for Outstanding Guest Actress in a Drama Series. She joined [[Kyle Chandler]] on a new [[Netflix]] series [[Bloodline (TV series)|''Bloodline'']] from the creators of ''[[Damages (TV series)|Damages]]''.&lt;ref&gt;{{cite web|url=http://www.tvwise.co.uk/2014/03/norbert-leo-butz-joins-netflixs-drama-series-damages-creators-todd-kessler-glenn-kessler-daniel-zelman/ |title=Norbert Leo Butz Joins Netflix's Drama Series From 'Damages' Creators Todd A. Kessler, Glenn Kessler &amp; Daniel Zelman |publisher=TVWise |date= |accessdate=2015-09-19}}&lt;/ref&gt;<br /> <br /> == Personal life ==<br /> Cardellini attended [[Loyola Marymount University]]'s&lt;ref&gt;[http://www.lmu.edu/sites/alumnirelations/Events/Event_Photos/LA_Leaders__LMU_Distinguished_Alumni_Reception_2007.htm &quot;LA Leaders, LMU Distinguished Alumni Reception 2007&quot;]. [[Loyola Marymount University]]. February 22, 2007. Retrieved January 2, 2013.&lt;/ref&gt; College of [[Communication studies|Communication]] and [[fine art|Fine Arts]], graduating in 2000&lt;!-- source ^^^ says 1997 wha?--&gt; with a degree in theatre arts. In 2007, she was recognized as a &quot;Distinguished Alumnus&quot; by the university.&lt;ref&gt;[http://www.lmu.edu/sites/alumnirelations/Awards___Scholarships/Awards/Distinguished_Alumni_Awardees_1970-present.htm &quot;Distinguished Alumni Awardees 1970-present&quot;]. Loyola Marymount University. Retrieved January 2, 2013.&lt;/ref&gt;<br /> <br /> Cardellini dated her ''Freaks and Geeks'' co-star [[Jason Segel]] for a few years following the show's cancellation.&lt;ref&gt;{{cite web|url=http://www.latimes.com/entertainment/news/la-ca-segel13apr13,0,6976921.story|title=This breakup really broke up Jason Segel |work=[[Los Angeles Times]] |date=April 13, 2008 |accessdate=June 7, 2013}}&lt;/ref&gt;<br /> <br /> In October 2011, Cardellini and her boyfriend Steven Rodriguez announced her pregnancy.&lt;ref&gt;{{cite web|url=http://celebritybabies.people.com/2011/10/18/linda-cardellini-expecting-first-child/ |title=Linda Cardellini Expecting First Child – Moms &amp; Babies – Moms &amp; Babies - People.com |publisher=Celebritybabies.people.com |date=June 22, 2011 |accessdate=February 8, 2012}}&lt;/ref&gt; Cardellini gave birth to their daughter Lilah-Rose in February 2012.&lt;ref&gt;{{cite web|url=http://celebritybabies.people.com/2012/03/06/linda-cardellini-welcomes-daughter-lilah-rose/|title=Linda Cardellini Welcomes Daughter Lilah-Rose |work=[[People (magazine)|People]]|date=March 6, 2012 |accessdate=March 6, 2012}}&lt;/ref&gt; Cardellini and Rodriguez became engaged in June 2013.&lt;ref&gt;{{cite web|url=http://www.huffingtonpost.com/2013/06/07/linda-cardellini-engaged-steven-rodriguez_n_3404140.html|title=Linda Cardellini Engaged: 'Freaks And Geeks' Actress And Boyfriend Steven Rodriguez Set To Wed |work=[[The Huffington Post]] |date=June 7, 2013|accessdate=June 7, 2013}}&lt;/ref&gt;<br /> <br /> == Filmography ==<br /> [[File:PaleyFest 2011 - Freaks and Geeks Reunion - the cast.jpg|thumb|right|150px|alt=Linda seated with group, in director's chair, in white sleeveless mini and silver closed heels |Cardellini at the 2011 PaleyFest]]<br /> <br /> ===Film===<br /> {| class=&quot;wikitable sortable&quot;<br /> |-<br /> ! Year<br /> ! Title<br /> ! Role<br /> ! class=&quot;unsortable&quot; | Notes<br /> |-<br /> | 1997<br /> | ''[[Good Burger]]''<br /> | Heather<br /> |<br /> |-<br /> | 1998<br /> | ''[[Dead Man on Campus]]''<br /> | Kelly<br /> |<br /> |-<br /> | 1998<br /> | ''[[Strangeland (film)|Strangeland]]''<br /> | Genevieve Gage<br /> |<br /> |-<br /> | 1999<br /> | ''{{sortname|The|Prince and the Surfer}}''<br /> | Melissa<br /> |<br /> |-<br /> | 2001<br /> | ''[[Legally Blonde]]''<br /> | Chutney Wyndham<br /> |<br /> |-<br /> | 2001<br /> | ''{{sortname|The|Unsaid}}''<br /> | Shelly Hunter<br /> |<br /> |-<br /> | 2002<br /> | ''[[Scooby-Doo (film)|Scooby-Doo]]''<br /> | [[Velma Dinkley]]<br /> |<br /> |-<br /> | 2002<br /> | ''Certainly Not a Fairytale''&lt;ref&gt;{{cite web|title=SEARCHLAB/Shorts: ''Certainly Not A Fairy Tale'' |publisher= Fox Searchlight SearchLab. |date=January 4, 2007 &lt;!-- Produced 2002, per credits --&gt;|url=http://content.foxsearchlight.com/videos/node/617 |archiveurl=http://web.archive.org/web/20101025195928/http://content.foxsearchlight.com/videos/node/617 |archivedate=October 25, 2010}}&lt;/ref&gt;<br /> | Adelle/Writer<br /> | Short film<br /> |-<br /> | 2004<br /> | ''[[Scooby-Doo 2: Monsters Unleashed]]''<br /> | Velma Dinkley<br /> |<br /> |-<br /> | 2004<br /> | ''[[Jiminy Glick in Lalawood]]''<br /> | Natalie Coolidge<br /> |<br /> |-<br /> | 2004<br /> | ''[[LolliLove]]''<br /> | Linda<br /> |<br /> |-<br /> | 2005<br /> | ''[[Brokeback Mountain]]''<br /> | Cassie Cartwright<br /> |<br /> |-<br /> | 2005<br /> | ''[[American Gun (2005 film)|American Gun]]''<br /> | Mary Ann Wilk<br /> |<br /> |-<br /> | 2006<br /> | ''[[Grandma's Boy (2006 film)|Grandma's Boy]]''<br /> | Samantha<br /> |<br /> |-<br /> | 2008<br /> | ''{{sortname|The|Lazarus Project}}''<br /> | Julie Ingram<br /> |<br /> |-<br /> | 2010<br /> | ''Gleeclipse''<br /> | Coach<br /> | Short film<br /> |-<br /> | 2011<br /> | ''[[Kill the Irishman]]''<br /> | Joan Madigan<br /> |<br /> |-<br /> | 2011<br /> | ''[[Super (2011 film)|Super]]''<br /> | Pet Store Employee<br /> |<br /> |-<br /> | 2011<br /> |''[[All-Star Superman (film)|All-Star Superman]]''<br /> | Nasthalthia &quot;Nasty&quot; Luthor (voice)<br /> | Direct-to-DVD<br /> |-<br /> | 2011<br /> | ''[[Return (2011 film)|Return]]''<br /> | Kelli<br /> |<br /> |-<br /> | 2014<br /> | ''[[Welcome to Me]]''<br /> | Gina<br /> | <br /> |-<br /> | 2015<br /> | ''[[Avengers: Age of Ultron]]''<br /> | Laura Barton<br /> | <br /> |-<br /> | 2015<br /> | ''[[Daddy's Home (film)|Daddy's Home]]''<br /> | Sara Whitaker<br /> | <br /> |-<br /> | 2016<br /> | ''[[The Founder (film)|The Founder]]''<br /> | Joan Smith<br /> | Filming<br /> |}<br /> <br /> ===Television===<br /> {| class=&quot;wikitable sortable&quot;<br /> |-<br /> ! Year<br /> ! Title<br /> ! Role<br /> ! class=&quot;unsortable&quot; | Notes<br /> |-<br /> | 1996<br /> |''[[Bone Chillers]]''<br /> |Sarah<br /> |13 episodes<br /> |-<br /> | 1997<br /> |''[[3rd Rock from the Sun]]''<br /> |Lorna<br /> |Episode: &quot;Dickmalion&quot;<br /> |-<br /> | 1997<br /> |''[[Pacific Palisades (TV series)|Pacific Palisades]]''<br /> |Sara<br /> |2 episodes<br /> |-<br /> | 1997<br /> |''[[Clueless (TV series)|Clueless]]''<br /> |Oddrey<br /> |Episode: &quot;Chick Fight Tonight&quot;<br /> |-<br /> | 1997<br /> |''[[Step by Step (TV series)|Step by Step]]''<br /> |Cassie Evans<br /> |Episode: &quot;Girls Just Wanna Have Fun&quot;<br /> |-<br /> |1998<br /> |''[[Promised Land (1996 TV series)|Promised Land]]''<br /> |Amber<br /> |Episode: &quot;Chasin' the Blues&quot;<br /> |-<br /> | 1998<br /> |''[[Kenan &amp; Kel]]''<br /> |Becky<br /> |Episode: &quot;Chicago Witch Trials&quot;<br /> |-<br /> |1998–1999<br /> |''[[Guys Like Us]]''<br /> |Jude<br /> |6 episodes<br /> |-<br /> |1998–1999<br /> |''[[Boy Meets World]]''<br /> |Lauren<br /> |4 episodes<br /> |-<br /> | 1999<br /> | ''Dying to Live''<br /> | Leslie Dugger<br /> | Television film<br /> |-<br /> |1999<br /> |''[[The Lot]]''<br /> |June Parker<br /> |4 episodes<br /> |-<br /> |1999–2000<br /> |''[[Freaks and Geeks]]''<br /> |[[Lindsay Weir (Freaks and Geeks)|Lindsay Weir]]<br /> |18 episodes<br /> |-<br /> |2003<br /> |''[[The Twilight Zone (2002 TV series)|The Twilight Zone]]''<br /> |Ali Warner<br /> |Episode: &quot;[[The Path (The Twilight Zone)|The Path]]&quot;<br /> |-<br /> |2003–2009<br /> |''[[ER (TV series)|ER]]''<br /> |[[Samantha Taggart]]<br /> |128 episodes<br /> |-<br /> |2005–2012<br /> |''[[Robot Chicken]]''<br /> |Velma Dinkley / Various voices<br /> |3 episodes<br /> |-<br /> |2007<br /> |''[[Human Giant]]''<br /> |Melody Richards<br /> |Episode: &quot;Mind Explosion&quot;<br /> |-<br /> |2008<br /> |''[[Comanche Moon (TV miniseries)|Comanche Moon]]''<br /> |Clara Forsythe<br /> |3 episodes<br /> |-<br /> |2009<br /> |''[[Cupid (2009 TV series)|Cupid]]''<br /> |Masseuse<br /> |Episode: &quot;My Fair Masseuse&quot; (uncredited){{citation needed|date=July 2015}}<br /> |-<br /> |2009<br /> |''[[The Goode Family]]''<br /> |Bliss Goode (voice)<br /> |13 episodes<br /> |-<br /> |2011<br /> |''[[Person of Interest (TV series)|Person of Interest]]''<br /> |Dr. Megan Tillman<br /> |Episode: &quot;Cura Te Ipsum&quot;<br /> |-<br /> |2011–2013<br /> |''[[Scooby-Doo! Mystery Incorporated]]''<br /> |Marcy 'Hot Dog Water' Fleach / Various voices<br /> |8 episodes<br /> |-<br /> |2012–present<br /> |''[[Regular Show]]''<br /> |C.J. (voice)<br /> |24 episodes<br /> |-<br /> |2012–present<br /> |''[[Gravity Falls]]''<br /> |Wendy Corduroy (voice)<br /> |29 episodes<br /> |-<br /> |2013<br /> |''[[Out There (2013 TV series)|Out There]]''<br /> |Sharla Lemoyne (voice)<br /> |5 episodes<br /> |-<br /> |2013–2015<br /> |''[[Mad Men]]''<br /> |Sylvia Rosen<br /> |9 episodes<br /> |-<br /> |2013–present<br /> |''[[Sanjay and Craig]]''<br /> |Megan Sparkles (voice)<br /> |27 episodes<br /> |-<br /> |2014<br /> |''[[New Girl]]''<br /> |Abby Day<br /> |3 episodes<br /> |-<br /> |2015–present<br /> |''[[Bloodline (TV series)|Bloodline]]''<br /> |Meg Rayburn<br /> |13 episodes<br /> |}<br /> <br /> ===Music videos===<br /> {| class=&quot;wikitable&quot;<br /> |-<br /> ! Year<br /> ! Title<br /> ! Artist<br /> |-<br /> | 2002<br /> | &quot;[[Land of a Million Drums]]&quot;<br /> | [[Outkast]]<br /> |-<br /> | 2008<br /> | &quot;[[Sing Along]]&quot;<br /> | [[Virginia Coalition]]<br /> |}<br /> <br /> ===Video games===<br /> {| class=&quot;wikitable&quot;<br /> |-<br /> ! Year<br /> ! Title<br /> ! Voice role<br /> |-<br /> |2003<br /> |''[[Gladius (video game)|Gladius]]''<br /> |Ursula<br /> |-<br /> |2004<br /> |''Scooby-Doo 2: Monsters Unleashed''<br /> |Velma Dinkley<br /> |-<br /> |2012<br /> |''[[Lollipop Chainsaw]]''<br /> |Cordelia Starling<br /> |}<br /> <br /> ==Awards and nominations==<br /> {| class=&quot;wikitable sortable&quot;<br /> |-<br /> ! Year<br /> ! Association<br /> ! Category<br /> ! Nominated work<br /> ! Result<br /> |-<br /> |2005<br /> | [[Gotham Awards]]<br /> |Best Ensemble Cast{{citation needed|date=April 2015}}<br /> |rowspan=2|''Brokeback Mountain''<br /> | {{nom}}<br /> |-<br /> |2006<br /> | [[Screen Actors Guild]]<br /> |[[Screen Actors Guild Award for Outstanding Performance by a Cast in a Motion Picture|Outstanding Performance by a Cast in a Motion Picture]]<br /> | {{nom}}<br /> |-<br /> |2009<br /> | [[TV Land Awards]]<br /> |[[TV Land Award#Recipients|Icon]]<br /> |''ER''<br /> | {{won}}<br /> |-<br /> |rowspan=2|2013<br /> | [[Independent Spirit Awards]]<br /> |[[Independent Spirit Award for Best Female Lead|Best Female Lead]]<br /> |''Return''<br /> | {{nom}}<br /> |-<br /> | [[Primetime Emmy Awards]]<br /> |[[Primetime Emmy Award for Outstanding Guest Actress in a Drama Series|Outstanding Guest Actress in a Drama Series]]<br /> |''Mad Men''<br /> | {{nom}}<br /> |}<br /> <br /> == References ==<br /> {{Reflist<br /> | colwidth = 30em<br /> | refs =<br /> &lt;ref name=&quot;NYDN&quot;&gt;{{cite news|title=Young Actress Takes Shine To Playing A Movie Starlet|first=Donna|last=Petrozzello|work=New York Daily News|date=August 19, 1999|url=http://articles.nydailynews.com/1999-08-19/entertainment/18114779_1_linda-cardellini-jonathan-frakes-rue-mcclanahan}}&lt;/ref&gt;<br /> &lt;ref name=&quot;AskMen&quot;&gt;[http://www.askmen.com/women/actress_200/212_linda_cardellini.html Linda Cardellini]. AskMen.com.&lt;/ref&gt;<br /> &lt;ref name=&quot;ew&quot;&gt;{{cite web|last=Stransky|first=Tanner|date=August 17, 2007|title=Where are the 'Freaks and Geeks' now?|work=Entertainment Weekly|url=http://www.ew.com/ew/article/0,,20052164,00.html}}&lt;/ref&gt;<br /> &lt;ref name=&quot;drgod&quot;&gt;{{cite web|title=Angels &amp; Prophets: Linda Cardellini|url=http://www.drgodcomedy.com/angels-prophets/linda-cardellini/|publisher=drgodcomedy.com}}&lt;/ref&gt;<br /> &lt;ref name=&quot;sfsketch&quot;&gt;{{cite web|title=Performers 2011 Line Up : Linda Cardellini|publisher=SFSketchFest.com|url=http://www.sfsketchfest.com/performers/#}}&lt;/ref&gt;<br /> }}<br /> <br /> == External links ==<br /> {{Portal|United States|Biography|Film}}<br /> *{{Commons category-inline}}<br /> * {{IMDb name|0004802}}<br /> * [http://www.nbc.com/ER/bios/Linda_Cardellini.html Linda Cardellini] at [[NBC]]<br /> * [http://vimeo.com/10190008 Linda Cardellini on stage with ''Dr. God'']. Vimeo.com, Neil Garguilo.&lt;!-- authorized video: Neil Garguilo is a member of Dr. God --&gt;<br /> <br /> {{Authority control}}<br /> <br /> {{Persondata &lt;!-- Metadata: see [[Wikipedia:Persondata]]. --&gt;<br /> | NAME = Cardellini, Linda<br /> | ALTERNATIVE NAMES =<br /> | SHORT DESCRIPTION = Actress<br /> | DATE OF BIRTH = June 25, 1975<br /> | PLACE OF BIRTH = Redwood City, California, U.S.<br /> | DATE OF DEATH =<br /> | PLACE OF DEATH =<br /> }}<br /> {{DEFAULTSORT:Cardellini, Linda}}<br /> [[Category:1975 births]]<br /> [[Category:Living people]]<br /> [[Category:20th-century American actresses]]<br /> [[Category:21st-century American actresses]]<br /> [[Category:Actresses from California]]<br /> [[Category:American child actresses]]<br /> [[Category:American film actresses]]<br /> [[Category:American people of English descent]]<br /> [[Category:American people of German descent]]<br /> [[Category:American people of Irish descent]]<br /> [[Category:American people of Italian descent]]<br /> [[Category:American television actresses]]<br /> [[Category:American voice actresses]]<br /> [[Category:Loyola Marymount University alumni]]<br /> [[Category:People from Redwood City, California]]<br /> [[Category:Actresses of Italian descent]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Cotton_swab&diff=697783897 Cotton swab 2016-01-01T22:22:01Z <p>PuercoPop: /* Medical risks */ Request for citation</p> <hr /> <div>{{hatnote|&quot;Q-tip&quot; redirects here. For the rapper, see [[Q-Tip (musician)]]. For the band, see [[Q-Tips (band)]].}}<br /> [[Image:White menbo.jpg|thumb|220px|A tool used for aural hygiene and cosmetics application, and even to clear the belly button.]]<br /> [[Image:Cotton swabs (or cotton buds) -in round container.jpg|right|thumb|220px|Many cotton swabs in a round container]]<br /> [[Image:Q Tips plain BG.jpg|upright|thumb|220px|A pack of 54 Q-tips safety swabs]]<br /> '''Cotton swabs''' (American) or '''cotton buds''' (British) consist of a small wad of [[cotton]] wrapped around one or both ends of a short rod, usually made of either wood, rolled paper, or plastic. They are commonly used in a variety of applications including [[first aid]], [[cosmetics]] application, cleaning, and arts and crafts. <br /> The cotton swab is a tool invented in the 1920s by [[Leo Gerstenzang]]&lt;ref name=&quot;howproductsmade&quot;&gt;<br /> {{Citation<br /> | last=Schueller<br /> | first=Randy<br /> | contribution=Cotton Swab<br /> | editor-last= <br /> | editor-first= <br /> | title=History<br /> | volume=4<br /> | pages= <br /> | publisher=FindArticles.com<br /> | place= <br /> | year=1996<br /> | contribution-url=http://findarticles.com/p/articles/mi_gx5205/is_1996/ai_n19124735}}&lt;/ref&gt; after he attached wads of cotton to [[toothpick]]s.&lt;ref name=&quot;History of Q-tips&quot;&gt;{{Citation<br /> | last=<br /> | first=<br /> | contribution=Cotton Swab<br /> | editor-last= <br /> | editor-first= <br /> | title=Q-tips History<br /> | volume=<br /> | pages= <br /> | publisher=Unilever Home and Personal Care<br /> | place= <br /> | year=2007–2008<br /> | contribution-url=http://www.qtips.com/history.php}}&lt;/ref&gt; His product, which he named &quot;Baby Gays&quot;, went on to become the most widely sold brand name, &quot;'''Q-tips'''&quot;, with the Q standing for &quot;quality&quot;. The term &quot;Q-tips&quot; is often used as a [[genericized trademark]] for cotton swabs in the [[United States|USA]] and [[Canada]].&lt;ref&gt;http://www.qtips.com/home/about&lt;/ref&gt; Although doctors have said for years that usage of the cotton swab for ear cleaning or scratching is not safe, such use remains the most common.&lt;ref&gt;Rod Moser, PA, PhD, [http://blogs.webmd.com/all-ears/2006/11/q-tips-weapons-of-ear-destruction.html Q-Tips – Weapons of Ear Destruction?], WebMD, Nov. 13, 2006&lt;/ref&gt;&lt;ref&gt;Joel Stein, [http://content.time.com/time/nation/article/0,8599,105556,00.html Something Evil in the Ear Canal], ''Time'', Mar. 26, 2001&lt;/ref&gt;<br /> <br /> ==Construction==<br /> The traditional cotton swab has a single tip on a wooden handle, and these are still often used, especially in medical settings. They are usually relatively long, about six inches (15&amp;nbsp;cm). These often are packaged sterile, one or two to a paper or plastic sleeve. The advantage of the paper sleeve and the wooden handle is that the package can be [[autoclave]]d to be sterilized (plastic sleeves or handles would melt in the autoclave).<br /> <br /> Cotton swabs manufactured for home use are usually shorter, about three inches (7.6&amp;nbsp;cm) long, and usually double-tipped. The handles were first made of wood, then made of rolled paper, which is still most common (although tubular plastic is also used). They are often sold in large quantities, 100 or more to a container.<br /> <br /> Plastic swab stems exist in a wide variety of colors, such as blue, pink or green. However, the cotton itself is traditionally white.<br /> <br /> ==Usage==<br /> The most common use for cotton swabs is to clean or caress the [[ear canal]] and/or to remove [[earwax]], despite this not being a medically recommended method for removing [[earwax]]. Cotton swabs are also commonly used for applying and removing makeup, as well as for household uses such as cleaning and arts and crafts.<br /> <br /> Medical-type swabs are often used to take [[microbiology|microbiological]] cultures. They are swabbed onto or into the infected area, then wiped across the [[culture medium]], such as an [[agar plate]], where bacteria from the swab may grow. They are also used to take DNA samples, most commonly by scraping cells from the inner cheek in the case of humans. They can be used to apply medicines to a targeted area, to selectively remove substances from a targeted area, or to apply cleaning substances like [[Betadine]]. They are also used as an applicator for various cosmetics, ointments, and other substances.<br /> <br /> A related area is the use of swabs for microbiological environmental monitoring. Once taken, the swab can be streaked onto an agar plate, or the contents of the tip removed by agitation or dilution into the broth. The broth can either then be filtered or incubated and examined for microbial growth.&lt;ref&gt;{{Cite journal|author=Sandle, T. |title=A study of a new type of swab for the environmental monitoring of isolators and cleanrooms|journal=[[PDA (journal)|European Journal of Pharenteral and Pharmaceutical Sciences]] |volume=16 |issue=2 |pages=42–48|date=July 2011 }}&lt;/ref&gt;<br /> <br /> Cotton swabs are also often used outside of the field of personal hygiene:<br /> <br /> * Often used in [[Plastic model|plastic model kits]] construction, for various applications during decaling or painting. Special brands of cotton swabs exist for this purpose, characterised by sturdier cotton heads and varied shapes of those heads.<br /> * Can be used in the [[Dyne|dyne test]] for measuring [[surface energy]]. This use is problematic, as manufacturers differ in the binders they use to fix the cotton to the stem, affecting the outcome of the test.&lt;ref&gt;{{cite web |url=http://pffc-online.com/mag/paper_taking_measure_surface/ |title=Taking the measure of surface treatment is a learning process |publisher=PFFC: Paper, Film &amp; Foil Converter |date=Sep 1, 1996 |author=Edward Boyle |accessdate=2010-03-20 }}&lt;/ref&gt;<br /> * They are frequently used for cleaning the laser of an [[optical drive]] in conjunction with rubbing alcohol. Similarly, they're used for cleaning larger computer parts such as video cards, and fans. They were also used widely in the past to clean video game cartridges.<br /> <br /> ==Medical risks==<br /> The use of cotton swabs in the ear canal is associated with no medical benefits and poses definite medical risks{{ citation needed}}. [[Cerumen]] (ear wax) is a naturally occurring, normally extruded product of the external auditory canal that protects the skin inside the ear, serves beneficial lubrication and cleaning functions, and provides some protection from bacteria, fungi, insects, and water.&lt;ref&gt;{{cite journal|last=McCarter|first=Daniel F.|title=Cerumen Impaction|journal=American Family Physician|date=May 2007|volume=75|issue=10|pages=1523–1528|url=http://www.aafp.org/afp/2007/0515/p1523.html|accessdate=5 September 2012|display-authors=etal}}&lt;/ref&gt;&lt;ref&gt;[http://american-hearing.org/disorders/ear-wax/#whatis Earwax] at the American Hearing Research Foundation. Chicago, Illinois 2008.&lt;/ref&gt; A 2004 study found that the &quot;[u]se of a cotton-tip applicator to clean the ear seems to be the leading cause of [[otitis externa]] in children and should be avoided.&quot;&lt;ref name=Nussinovitch&gt;{{cite journal|last=Nussinovitch|first=Moshe|title=Cotton-tip applicators as a leading cause of otitis externa|journal=International Journal of Pediatric Otorhinolaryngology|date=April 2004|volume=68|issue=4|pages=433–435|url=http://www.ijporlonline.com/article/S0165-5876(03)00484-1/abstract|accessdate=5 September 2012|doi=10.1016/j.ijporl.2003.11.014|display-authors=etal}}&lt;/ref&gt; Attempts to remove cerumen with cotton swabs may result in cerumen impaction, a buildup or blockage of cerumen in the ear canal, which can cause pain, hearing problems, ringing in the ear, or dizziness, and may require medical treatment to resolve.&lt;ref Name=AAFP&gt;{{cite journal|last=American Academy of Family Physicians|title=Information from Your Family Doctor---Earwax: What You Should Know|journal=American Family Physician|date=May 2007|volume=75|issue=10|pages=1530|url=http://www.aafp.org/afp/2007/0515/p1523.html}}&lt;/ref&gt; The use of cotton swabs in the ear canal is one of most common causes of [[perforated eardrum]], a condition which sometimes requires surgery to correct.&lt;ref&gt;{{cite journal|last=Smith|first=Matthew|author2=Darrat|title=Otologic complications of cotton swab use: One institution's experience|journal=The Laryngoscope|date=February 2012|volume=122|issue=2|pages=409–411|url=http://onlinelibrary.wiley.com/doi/10.1002/lary.22437/abstract|doi=10.1002/lary.22437}}&lt;/ref&gt; For these reasons, the American Academy of Family Physicians, among many other professional medical associations, recommends never placing cotton swabs in the ear canal.&lt;ref name=&quot;AAFP&quot; /&gt;<br /> <br /> ==See also==<br /> * [[Ear pick]]<br /> <br /> ==References==<br /> {{Reflist|2}}<br /> <br /> ==External links==<br /> {{Commons category|Cotton swabs}}<br /> <br /> [[Category:Personal hygiene products]]<br /> [[Category:Microbiology equipment]]<br /> [[Category:American inventions]]<br /> [[Category:Cotton]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Futures_and_promises&diff=697313705 Futures and promises 2015-12-29T18:06:06Z <p>PuercoPop: /* List of implementations */ add a CL implementation to the list, blackbird</p> <hr /> <div>{{merge|Promise theory|date=December 2015}}<br /> {{Use dmy dates|date=July 2013}}<br /> In [[computer science]], '''future''', '''promise''', and '''delay''' refer to constructs used for synchronization in some [[concurrent programming language]]s. They describe an object that acts as a proxy for a result that is initially unknown, usually because the [[computation]] of its value is yet incomplete.<br /> <br /> The term ''promise'' was proposed in 1976 by [[Daniel P. Friedman]] and David Wise,&lt;ref&gt;{{cite conference<br /> | first = Daniel<br /> | last = Friedman<br /> |author2=David Wise<br /> | year = 1976<br /> | title = The Impact of Applicative Programming on Multiprocessing<br /> | conference= International Conference on Parallel Processing<br /> | page=263-272.<br /> }}&lt;/ref&gt;<br /> and Peter Hibbard called it ''eventual''.&lt;ref&gt;{{cite conference<br /> | first = Peter<br /> | last = Hibbard<br /> | year = 1976<br /> | title = Parallel Processing Facilities<br /> | conference= New Directions in Algorithmic Languages, (ed.) Stephen A. Schuman, IRIA, 1976.<br /> }}&lt;/ref&gt;<br /> A somewhat similar concept ''future'' was introduced in 1977 in a paper by [[Henry Baker (computer scientist)|Henry Baker]] and [[Carl Hewitt]].&lt;ref&gt;<br /> {{cite conference<br /> | author =Henry Baker and Carl Hewitt<br /> | title = The Incremental Garbage Collection of Processes<br /> | conference= Proceedings of the Symposium on Artificial Intelligence Programming Languages,<br /> | publisher= ACM Sigplan Notices 12, 8 <br /> | date=August 1977<br /> | pages=55-59<br /> | url=http://home.pipeline.com/~hbaker1/Futures.html<br /> }}&lt;/ref&gt; <br /> <br /> The terms ''future'', ''promise'', and ''delay'' are often used interchangeably, although some differences in usage between ''future'' and ''promise'' are treated below. Specifically, when usage is distinguished, a future is a ''read-only'' placeholder view of a variable, while a promise is a writable, [[single assignment]] container which sets the value of the future.&lt;ref&gt;&quot;[http://docs.scala-lang.org/sips/completed/futures-promises.html SIP-14 - Futures and Promises]&quot;&lt;/ref&gt; Notably, a future may be defined without specifying which specific promise will set its value, and different possible promises may set the value of a given future, though this can be done only once for a given future. In other cases a future and a promise are created together and associated with each other: the future is the value, the promise is the function that sets the value – essentially the return value (future) of an asynchronous function (promise). Setting the value of a future is also called ''resolving'', ''fulfilling'', or ''binding'' it.<br /> <br /> ==Applications==<br /> Futures and promises originated in [[functional programming]] and related paradigms (such as [[logic programming]]) to decouple a value (a future) from how it was computed (a promise), allowing the computation to be done more flexibly, notably by parallelizing it. It later found use in [[distributed computing]], in reducing the latency from communication round trips. More recently, it has gained popularity by allowing writing asynchronous programs in [[direct style]], rather than in [[continuation-passing style]].<br /> <br /> ==Implicit vs. explicit==<br /> Use of futures may be ''implicit'' (any use of the future automatically obtains its value, as if it were an ordinary [[reference (programming)|reference]]) or ''explicit'' (the user must call a function to obtain the value, such as the &lt;code&gt;get&lt;/code&gt; method of {{Javadoc:SE|package=java.util.concurrent|java/util/concurrent|Future}} in [[Java (programming language)|Java]]). Obtaining the value of an explicit future can be called ''stinging'' or ''forcing''. Explicit futures can be implemented as a library, whereas implicit futures are usually implemented as part of the language.<br /> <br /> The original Baker and Hewitt paper described implicit futures, which are naturally supported in the [[Actor model]] of computation and pure [[object-oriented programming]] languages like [[Smalltalk]]. The Friedman and Wise paper described only explicit futures, probably reflecting the difficulty of efficiently implementing implicit futures on stock hardware. The difficulty is that stock hardware does not deal with futures for primitive data types like integers. For example, an add instruction does not know how to deal with &lt;code&gt;3 + ''future '' factorial(100000)&lt;/code&gt;. In pure object or Actor languages this problem can be solved by sending &lt;code&gt;''future '' factorial(100000)&lt;/code&gt; the message &lt;code&gt;+[3]&lt;/code&gt;, which asks the future to add &lt;code&gt;3&lt;/code&gt; to itself and return the result. Note that the message passing approach works regardless of when &lt;code&gt;factorial(100000)&lt;/code&gt; finishes computation and that no stinging/forcing is needed.<br /> <br /> ==Promise pipelining==<br /> The use of futures can dramatically reduce [[latency (engineering)|latency]] in [[distributed computing|distributed systems]]. For instance, futures enable ''promise pipelining'',&lt;ref&gt;[http://www.erights.org/elib/distrib/pipeline.html Promise Pipelining at erights.org]&lt;/ref&gt;&lt;ref&gt;[http://c2.com/cgi/wiki?PromisePipelining Promise Pipelining on the C2 wiki]&lt;/ref&gt; as implemented in the languages [[E (programming language)|E]] and [[Joule (programming language)|Joule]], which was also called ''call-stream'' in the language [[Argus (programming language)|Argus]].<br /> <br /> Consider an expression involving conventional [[remote procedure call]]s, such as:<br /> &lt;source lang=&quot;e&quot;&gt;<br /> t3 := ( x.a() ).c( y.b() )<br /> &lt;/source&gt;<br /> which could be expanded to<br /> &lt;source lang=&quot;e&quot;&gt;<br /> t1 := x.a();<br /> t2 := y.b();<br /> t3 := t1.c(t2);<br /> &lt;/source&gt;<br /> Each statement needs a message to be sent and a reply received before the next statement can proceed. Suppose, for example, that &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt;, &lt;code&gt;t1&lt;/code&gt;, and &lt;code&gt;t2&lt;/code&gt; are all located on the same remote machine. In this case, two complete network round-trips to that machine must take place before the third statement can begin to execute. The third statement will then cause yet another round-trip to the same remote machine.<br /> <br /> Using futures, the above expression could be written<br /> &lt;source lang=&quot;e&quot;&gt;<br /> t3 := (x &lt;- a()) &lt;- c(y &lt;- b())<br /> &lt;/source&gt;<br /> <br /> which could be expanded to<br /> &lt;source lang=&quot;e&quot;&gt;<br /> t1 := x &lt;- a();<br /> t2 := y &lt;- b();<br /> t3 := t1 &lt;- c(t2);<br /> &lt;/source&gt;<br /> <br /> The syntax used here is that of the language E, where &lt;code&gt;x &lt;- a()&lt;/code&gt; means to send the message &lt;code&gt;a()&lt;/code&gt; asynchronously to &lt;code&gt;x&lt;/code&gt;. All three variables are immediately assigned futures for their results, and execution proceeds to subsequent statements. Later attempts to resolve the value of &lt;code&gt;t3&lt;/code&gt; may cause a delay; however, pipelining can reduce the number of round-trips needed. If, as in the previous example, &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt;, &lt;code&gt;t1&lt;/code&gt;, and &lt;code&gt;t2&lt;/code&gt; are all located on the same remote machine, a pipelined implementation can compute &lt;code&gt;t3&lt;/code&gt; with one round-trip instead of three. Because all three messages are destined for objects which are on the same remote machine, only one request need be sent and only one response need be received containing the result. Note also that the send &lt;code&gt;t1 &lt;- c(t2)&lt;/code&gt; would not block even if &lt;code&gt;t1&lt;/code&gt; and &lt;code&gt;t2&lt;/code&gt; were on different machines to each other, or to &lt;code&gt;x&lt;/code&gt; or &lt;code&gt;y&lt;/code&gt;.<br /> <br /> Promise pipelining should be distinguished from parallel asynchronous message passing. In a system supporting parallel message passing but not pipelining, the message sends &lt;code&gt;x &lt;- a()&lt;/code&gt; and &lt;code&gt;y &lt;- b()&lt;/code&gt; in the above example could proceed in parallel, but the send of &lt;code&gt;t1 &lt;- c(t2)&lt;/code&gt; would have to wait until both &lt;code&gt;t1&lt;/code&gt; and &lt;code&gt;t2&lt;/code&gt; had been received, even when &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt;, &lt;code&gt;t1&lt;/code&gt;, and &lt;code&gt;t2&lt;/code&gt; are on the same remote machine. The relative latency advantage of pipelining becomes even greater in more complicated situations involving many messages.<br /> <br /> Promise pipelining also should not be confused with [[Actor model#No requirement on order of message arrival|pipelined message processing]] in Actor systems, where it is possible for an actor to specify and begin executing a behaviour for the next message before having completed processing of the current message.<br /> <br /> ==Read-only views==<br /> In some programming languages such as [[Oz (programming language)|Oz]], [[E (programming language)|E]], and [[AmbientTalk]], it is possible to obtain a ''read-only view'' of a future, which allows reading its value when resolved, but does not permit resolving it:<br /> <br /> * In Oz, the &lt;code&gt;!!&lt;/code&gt; operator is used to obtain a read-only view.<br /> * In E and AmbientTalk, a future is represented by a pair of values called a ''promise/resolver pair''. The promise represents the read-only view, and the resolver is needed in order to set the future's value.<br /> * In [[C++11]] a &lt;code&gt;std::future&lt;/code&gt; provides a read-only view. The value is set directly by using a &lt;code&gt;std::promise&lt;/code&gt;, or set to the result of a function call using &lt;code&gt;std::packaged_task&lt;/code&gt; or &lt;code&gt;std::async&lt;/code&gt;.<br /> * In the [[Dojo Toolkit]]'s Deferred API as of version 1.5, a ''consumer-only promise object'' represents a read-only view.&lt;ref&gt;{{citation | url = http://www.sitepen.com/blog/2010/05/03/robust-promises-with-dojo-deferred-1-5/ | publisher = Site Pen | date = 2010-05-03 | title = Robust promises with Dojo deferred}}.&lt;/ref&gt;<br /> * In [[Alice ML]], futures only provide a ''read-only view'', whereas a promise contains both a future and the ability to resolve the future&lt;ref name = &quot;Alice ML promise&quot;&gt;{{citation | url = http://www.ps.uni-sb.de/alice/manual/library/promise.html | title = Alice Manual | chapter = Promise | publisher = Uni-SB | place = DE}}.&lt;/ref&gt;&lt;ref name = &quot;Alice ML future&quot;&gt;{{citation | url = http://www.ps.uni-sb.de/alice/manual/library/future.html | title = Alice manual | chapter = Future | publisher = Uni-SB | place = DE}}.&lt;/ref&gt;<br /> * In [[.NET Framework 4.0|.NET 4.0]] &lt;code&gt;System.Threading.Tasks.Task&lt;T&gt;&lt;/code&gt; represents a read-only view. Resolving the value can be done through &lt;code&gt;System.Threading.Tasks.TaskCompletionSource&lt;T&gt;&lt;/code&gt;.<br /> <br /> Support for read-only views is consistent with the [[Principle of Least Authority]], since it enables the ability to set the value to be restricted to [[subject (access control)|subjects]] that need to set it. In a system that also supports pipelining, the sender of an asynchronous message (with result) receives the read-only promise for the result, and the target of the message receives the resolver.<br /> <br /> ==Thread-specific futures==<br /> Some languages, such as [[Alice (programming language)|Alice ML]], define futures that are associated with a specific thread that computes the future's value.&lt;ref name = &quot;Alice ML future&quot; /&gt; This computation may be started either [[eager evaluation|eagerly]] when the future is created, or [[lazy evaluation|lazily]] when its value is first needed. A lazy future is similar to a [[thunk (functional programming)|thunk]] (in the sense of a delayed computation).<br /> <br /> Alice ML also supports futures that can be resolved by any thread, and calls these ''promises''.&lt;ref name = &quot;Alice ML promise&quot; /&gt; Note that this usage of ''promise'' is different from its usage in E as described [[#Read-only views|above]]: an Alice promise is ''not'' a read-only view, and Alice also does not support pipelining for promises themselves. Instead, pipelining naturally happens for futures (including ones associated with promises).<br /> <br /> ==Blocking vs non-blocking semantics==<br /> If the value of a future is accessed asynchronously, for example by sending a message to it, or by explicitly waiting for it using a construct such as &lt;code&gt;when&lt;/code&gt; in E, then there is no difficulty in delaying until the future is resolved before the message can be received or the wait completes. This is the only case to be considered in purely asynchronous systems such as pure Actor languages.<br /> <br /> However, in some systems it may also be possible to attempt to ''immediately'' or ''synchronously'' access a future's value. Then there is a design choice to be made:<br /> <br /> * the access could block the current thread or process until the future is resolved (possibly with a timeout). This is the semantics of ''dataflow variables'' in the language [[Oz (programming language)|Oz]].<br /> * the attempted synchronous access could always signal an error, for example throwing an [[exception (computer science)|exception]]. This is the semantics of remote promises in E.&lt;ref&gt;{{citation |url=http://wiki.erights.org/wiki/Promise | title = Promise | publisher = E rights}}.&lt;/ref&gt;<br /> * potentially, the access could succeed if the future is already resolved, but signal an error if it is not. This would have the disadvantage of introducing nondeterminism and the potential for [[race conditions]], and does not appear to be a common design choice.<br /> <br /> As an example of the first possibility, in [[C++11]], a thread that needs the value of a future can block until it is available by calling the &lt;code&gt;wait()&lt;/code&gt; or &lt;code&gt;get()&lt;/code&gt; member functions. You can also specify a timeout on the wait using the &lt;code&gt;wait_for()&lt;/code&gt; or &lt;code&gt;wait_until()&lt;/code&gt; member functions to avoid indefinite blocking. If the future arose from a call to &lt;code&gt;std::async&lt;/code&gt; then a blocking wait (without a timeout) may cause synchronous invocation of the function to compute the result on the waiting thread.<br /> <br /> ==Related constructs==<br /> An ''I-var'' (as in the language [[Id (programming language)|Id]]) is a future with blocking semantics as defined above. An ''I-structure'' is a [[data structure]] containing I-vars. A related synchronization construct that can be set multiple times with different values is called an ''M-var''. M-vars support atomic operations to ''take'' or ''put'' the current value, where taking the value also sets the M-var back to its initial ''empty'' state.&lt;ref&gt;{{citation | url = http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Concurrent-MVar.html | publisher = Haskell | title = Control Concurrent MVar}}.&lt;/ref&gt;<br /> <br /> A ''concurrent logic variable'' is similar to a future, but is updated by [[unification (computing)|unification]], in the same way as ''logic variables'' in [[logic programming]]. Thus it can be bound more than once to unifiable values (but cannot be set back to an empty or unresolved state). The dataflow variables of Oz act as concurrent logic variables, and also have blocking semantics as mentioned above.<br /> <br /> A ''concurrent constraint variable'' is a generalization of concurrent logic variables to support [[constraint logic programming]]: the constraint may be ''narrowed'' multiple times, indicating smaller sets of possible values. Typically there is a way to specify a thunk that should be run whenever the constraint is narrowed further; this is necessary to support ''constraint propagation''.<br /> <br /> ==Relations between the expressiveness of different forms of future==<br /> Eager thread-specific futures can be straightforwardly implemented in terms of non-thread-specific futures, by creating a thread to calculate the value at the same time as creating the future. In this case it is desirable to return a read-only view to the client, so that only the newly created thread is able to resolve this future.<br /> <br /> To implement implicit lazy thread-specific futures (as provided by Alice ML, for example) in terms in non-thread-specific futures, needs a mechanism to determine when the future's value is first needed (for example, the &lt;code&gt;WaitNeeded&lt;/code&gt; construct in Oz&lt;ref&gt;{{citation | url = http://www.mozart-oz.org/home/doc/base/node13.html | title = WaitNeeded | publisher= Mozart Oz}}.&lt;/ref&gt;). If all values are objects, then the ability to implement transparent forwarding objects is sufficient, since the first message sent to the forwarder indicates that the future's value is needed.<br /> <br /> Non-thread-specific futures can be implemented in terms of thread-specific futures, assuming that the system supports message passing, by having the resolving thread send a message to the future's own thread. However, this could be argued to be unnecessary complexity: in programming languages based on threads, the most expressive approach appears to be to provide a combination of non-thread-specific futures, read-only views, and either a 'WaitNeeded' construct or support for transparent forwarding.<br /> <br /> ==Evaluation strategy==<br /> {{further|Call by future}}<br /> <br /> The [[evaluation strategy]] of futures, which may be termed '''[[call by future]]''', is non-deterministic: the value of a future will be evaluated at some time between when the future is created and when its value is used, but the precise time is not determined beforehand and can change from run to run. The computation may be started as soon as the future is created ([[eager evaluation]]) or only when the value is actually needed ([[lazy evaluation]]), and may be suspended part-way through or executed in one run. Once the value of a future is assigned, it is not recomputed on future accesses; this is like the [[memoization]] used in [[call by need]].<br /> <br /> A '''{{visible anchor|lazy future}}''' is a future that deterministically has lazy evaluation semantics: the computation of the future's value starts when the value is first needed, as in call by need. Lazy futures are of use in languages whose evaluation strategy is by default not lazy. For example, in [[C++11]] such lazy futures can be created by passing the &lt;code&gt;std::launch::deferred&lt;/code&gt; launch policy to &lt;code&gt;std::async&lt;/code&gt;, along with the function to compute the value.<br /> <br /> ==Semantics of futures in the Actor model==<br /> In the Actor model, an expression of the form &lt;code&gt;''future'' &lt;Expression&gt;&lt;/code&gt; is defined by how it responds to an &lt;code&gt;Eval&lt;/code&gt; message with environment ''E'' and customer ''C'' as follows: The future expression responds to the &lt;code&gt;Eval&lt;/code&gt; message by sending the customer ''C'' a newly created actor ''F'' (the proxy for the response of evaluating &lt;code&gt;&lt;Expression&gt;&lt;/code&gt;) as a return value ''concurrently'' with sending &lt;code&gt;&lt;Expression&gt;&lt;/code&gt; an &lt;code&gt;Eval&lt;/code&gt; message with environment ''E'' and customer ''C''. The default behavior of ''F'' is as follows:<br /> <br /> * When ''F'' receives a request ''R'', then it checks to see if it has already received a response (that can either be a return value or a thrown exception) from evaluating &lt;code&gt;&lt;Expression&gt;&lt;/code&gt; proceeding as follows:<br /> *# If it already has a response ''V'', then<br /> *#*If ''V'' is a return value, then it is sent the request ''R''.<br /> *#*If ''V'' is an exception, then it is thrown to the customer of the request ''R''.<br /> *# If it does not already have a response, then ''R'' is stored in the queue of requests inside the ''F''.<br /> <br /> * When ''F'' receives the response ''V'' from evaluating &lt;code&gt;&lt;Expression&gt;&lt;/code&gt;, then ''V'' is stored in ''F'' and<br /> **If ''V'' is a return value, then all of the queued requests are sent to ''V''.<br /> **If ''V'' is an exception, then it is thrown to the customer of each of the queued requests.<br /> <br /> However, some futures can deal with requests in special ways to provide greater parallelism. For example, the expression &lt;code&gt;1 + future factorial(n)&lt;/code&gt; can create a new future that will behave like the number &lt;code&gt;1+factorial(n)&lt;/code&gt;. This trick does not always work. For example the following conditional expression:<br /> : &lt;code&gt;''if'' m&gt;future factorial(n) ''then'' print(&quot;bigger&quot;) ''else'' print(&quot;smaller&quot;)&lt;/code&gt;<br /> suspends until the future for &lt;code&gt;factorial(n)&lt;/code&gt; has responded to the request asking if &lt;code&gt;m&lt;/code&gt; is greater than itself.<br /> <br /> ==History==<br /> The ''future'' and/or ''promise'' constructs were first implemented in programming languages such as [[MultiLisp]] and [[Actor model|Act 1]]. The use of logic variables for communication in [[concurrency (computer science)|concurrent]] [[logic programming]] languages was quite similar to futures. These started with ''Prolog with Freeze'' and ''IC Prolog'', and became a true concurrency primitive with [[Relational Language]], [[Concurrent Prolog]], [[Guarded Horn Clauses]] (GHC), [[Parlog]], [[Strand (programming language)|Strand]], [[Vulcan (programming language)|Vulcan]], [[Janus (programming language)|Janus]], [[Mozart Programming System|Mozart]]/[[Oz (programming language)|Oz]], [[Flow Java]], and [[Alice (programming language)|Alice ML]]. The single-assignment ''I-var'' from [[dataflow programming]] languages, originating in [[Id (programming language)|Id]] and included in Reppy's ''[[Concurrent ML]]'', is much like the concurrent logic variable.<br /> <br /> The promise pipelining technique (using futures to overcome latency) was invented by [[Barbara Liskov]] and [[Liuba Shrira]] in 1988,&lt;ref&gt;{{cite journal<br /> | author = Barbara Liskov and Liuba Shrira<br /> | title = Promises: Linguistic Support for Efficient Asynchronous Procedure Calls in Distributed Systems<br /> | year = 1988<br /> | doi = 10.1145/53990.54016<br /> | publisher = Proceedings of the SIGPLAN '88 Conference on Programming Language Design and Implementation; Atlanta, Georgia, United States, pp. 260&amp;ndash;267. ISBN 0-89791-269-1, published by ACM. Also published in ACM SIGPLAN Notices, Volume 23, Issue 7, July 1988<br /> }}&lt;/ref&gt; and independently by [[Mark S. Miller]], Dean Tribble and Rob Jellinghaus in the context of [[Project Xanadu]] circa 1989.&lt;ref&gt;{{citation | url = http://www.sunless-sea.net/Transcripts/promise.html | publisher = Sunless Sea | title = Promise | archiveurl = http://web.archive.org/web/20071023111712/http://www.sunless-sea.net/Transcripts/promise.html | archivedate = October 23, 2007}}.&lt;/ref&gt;<br /> <br /> The term ''promise'' was coined by Liskov and Shrira, although they referred to the pipelining mechanism by the name ''call-stream'', which is now rarely used.<br /> <br /> Both the design described in Liskov and Shrira's paper, and the implementation of promise pipelining in Xanadu, had the limitation that promise values were not [[first-class value|first-class]]: an argument to, or the value returned by a call or send could not directly be a promise (so the example of promise pipelining given earlier, which uses a promise for the result of one send as an argument to another, would not have been directly expressible in the call-stream design or in the Xanadu implementation). It appears that promises and call-streams were never implemented in any public release of Argus&lt;ref&gt;{{citation | url = http://www.pmg.csail.mit.edu/Argus.html | publisher = MIT | title = Argus}}.&lt;/ref&gt; (the programming language used in the Liskov and Shrira paper); Argus development stopped around 1988.&lt;ref&gt;{{citation | url = http://www.ieeeghn.org/wiki/index.php/Oral-History:Barbara_Liskov#Distributed_Computing_and_Argus | publisher = IEEE GHN | series = Oral history | first = Barbara | last = Liskov | title = Distributed computing and Argus}}.&lt;/ref&gt; The Xanadu implementation of promise pipelining only became publicly available with the release of the source code for Udanax Gold&lt;ref&gt;{{citation | url = http://www.udanax.com/gold/ | publisher = Udanax | title = Gold}}.&lt;/ref&gt; in 1999, and was never explained in any published document.&lt;ref&gt;{{citation | url = http://www.erights.org/elib/distrib/pipeline.html | publisher = E rights | title = Pipeline}}.&lt;/ref&gt; The later implementations in Joule and E support fully first-class promises and resolvers.<br /> <br /> Several early Actor languages, including the Act series of languages,&lt;ref&gt;{{cite journal<br /> | author = Henry Lieberman<br /> | title = A Preview of Act 1<br /> |date=June 1981<br /> | publisher = MIT AI memo 625<br /> }}&lt;/ref&gt;&lt;ref&gt;{{cite journal<br /> | author = Henry Lieberman<br /> | title = Thinking About Lots of Things at Once without Getting Confused: Parallelism in Act 1<br /> |date=June 1981<br /> | publisher = MIT AI memo 626<br /> }}&lt;/ref&gt; supported both parallel message passing and pipelined message processing, but not promise pipelining. (Although it is technically possible to implement the last of these features in terms of the first two, there is no evidence that the Act languages did so.)<br /> <br /> More recently, there has been a major revival of interest in futures and promises, due particularly to their use in [[responsiveness]] of user interfaces, and their use in [[web development]], due to the [[request–response]] model of message-passing. Several mainstream languages now have language support for futures and promises, most notably popularized by the &lt;code&gt;async&lt;/code&gt; and &lt;code&gt;await&lt;/code&gt; constructions in .NET 4.5 (announced 2010, released 2012)&lt;ref name=&quot;asyncdotnet45&quot;&gt;{{cite web|url=http://blogs.msdn.com/b/dotnet/archive/2012/04/03/async-in-4-5-worth-the-await.aspx |title=Async in 4.5: Worth the Await - .NET Blog - Site Home - MSDN Blogs |publisher=Blogs.msdn.com |date= |accessdate=2014-05-13}}&lt;/ref&gt;&lt;ref name=&quot;dotnetasyncawait&quot;&gt;{{cite web|url=http://msdn.microsoft.com/en-us/library/hh191443.aspx |title=Asynchronous Programming with Async and Await (C# and Visual Basic) |publisher=Msdn.microsoft.com |date= |accessdate=2014-05-13}}&lt;/ref&gt; largely inspired by the ''asynchronous workflows'' of F#,&lt;ref&gt;{{cite web<br /> |title=Asynchronous C# and F# (I.): Simultaneous introduction<br /> |url=http://tomasp.net/blog/csharp-fsharp-async-intro.aspx/<br /> |date=29 October 2010<br /> |author=Tomas Petricek<br /> }}&lt;/ref&gt; which dates to 2007.&lt;ref&gt;{{cite web<br /> |title=The F# Asynchronous Programming Model, PADL 2011<br /> |url=http://blogs.msdn.com/b/dsyme/archive/2010/10/21/the-f-asynchronous-programming-model-padl-2010-pre-publication-draft.aspx<br /> |date=21 Oct 2010 <br /> |author1=Don Syme<br /> |author2=Tomas Petricek<br /> |author3=Dmitry Lomov<br /> }}&lt;/ref&gt; This has subsequently been adopted by other languages, notably Dart (2014),&lt;ref name=&quot;dart&quot;/&gt; Python (2015),&lt;ref name=&quot;python&quot;&gt;{{cite web<br /> |title=PEP 0492 -- Coroutines with async and await syntax<br /> |url=https://www.python.org/dev/peps/pep-0492/<br /> }}&lt;/ref&gt; Hack (HHVM), and drafts of ECMAScript 7 (JavaScript), Scala, and C++.<br /> <br /> ==List of implementations==<br /> Languages supporting futures, promises, concurrent logic variables, dataflow variables, or I-vars, either by direct language support or in the standard library, include:<br /> * ABCL/f&lt;ref&gt;{{cite conference<br /> | author = Kenjiro Taura, Satoshi Matsuoka, and Akinori Yonezawa<br /> | year = 1994<br /> | title = ABCL/f: A Future-Based Polymorphic Typed Concurrent Object-Oriented Language -- Its Design and Implementation.<br /> | booktitle = In Proceedings of the DIMACS workshop on Specification of Parallel Algorithms, number 18 in Dimacs Series in Discrete Mathematics and Theoretical Computer Science<br /> | pages = 275–292<br /> | url = http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.23.1161<br /> | doi = <br /> | publisher = American Mathematical Society<br /> }}&lt;/ref&gt;<br /> * [[Alice (programming language)|Alice ML]]<br /> * [[AmbientTalk]] (including first-class resolvers and read-only promises)<br /> * [[Clojure]]&lt;ref&gt;{{cite web<br /> | author = Rich Hickey<br /> | year = 2009<br /> | title = changes.txt at 1.1.x from richhickey's clojure<br /> | url = https://github.com/richhickey/clojure/blob/1.1.x/changes.txt#L130<br /> }}&lt;/ref&gt;<br /> * [[C++11#Threading facilities|C++11]] (std::future and std::promise)<br /> * [[C Sharp (programming language)|C#]], since .NET 4.5,&lt;ref name=&quot;asyncdotnet45&quot;/&gt; through the &lt;code&gt;async&lt;/code&gt; and &lt;code&gt;await&lt;/code&gt; keywords.&lt;ref name=&quot;dotnetasyncawait&quot;/&gt;<br /> * [[Compositional C++]]<br /> * [[Dart (programming language)|Dart]] (with ''Future''/''Completer'' classes&lt;ref name=&quot;dartCompleter&quot;&gt; {{cite url<br /> |url=https://api.dartlang.org/1.12.1/dart-async/Completer-class.html<br /> |title=Dart SDK dart async Completer<br /> }}&lt;/ref&gt; and the ''await''/''async'' keywords&lt;ref name=&quot;dart&quot;&gt;{{cite url<br /> |url=https://www.dartlang.org/articles/await-async/<br /> |title=Dart Language Asynchrony Support: Phase 1<br /> |author=Gilad Bracha <br /> |date=October 2014<br /> }}&lt;/ref&gt;)<br /> * [[Flow Java]]<br /> * Glasgow [[Haskell (programming language)|Haskell]] (I-vars and M-vars only)<br /> * [[Id (programming language)|Id]] (I-vars and M-vars only)<br /> * [[Io (programming language)|Io]]&lt;ref&gt;{{cite web<br /> | author = Steve Dekorte<br /> | year = 2005<br /> | title = Io, The Programming Language<br /> | url = http://iolanguage.com/docs/manual<br /> }}&lt;/ref&gt;<br /> * [[Java (programming language)|Java]] through {{Javadoc:SE|package=java.util.concurrent|java/util/concurrent|Future}}<br /> * [[JavaScript]] (limited, as of ECMAScript 6)<br /> * [[Lucid (programming language)|Lucid]] (dataflow only)<br /> * [[MultiLisp]]<br /> * [[.NET_Framework|.NET]] through ''Task''s<br /> * [[Oxygene (programming language)|Oxygene]]<br /> * [[Oz (programming language)|Oz]] version 3&lt;ref&gt;{{cite web|url=http://www.mozart-oz.org/documentation/tutorial/node1.html|title=Tutorial of Oz|publisher=MOzart Global User Library|accessdate=12 April 2011|author=Seif Haridi|author2=Nils Franzen}}&lt;/ref&gt;<br /> * [[Python (programming language)|Python]] [https://docs.python.org/3/library/concurrent.futures.html concurrent.futures], since 3.2,&lt;ref&gt;[https://www.python.org/download/releases/3.2/ Python 3.2 Release]&lt;/ref&gt; as proposed by the [https://www.python.org/dev/peps/pep-3148/ PEP 3148], and Python 3.5 added async and await &lt;ref&gt;[https://www.python.org/downloads/release/python-350/ Python 3.5 Release]&lt;/ref&gt;<br /> * [[R (programming language)|R]] (promises for lazy evaluation - still single threaded)<br /> * [[Racket (programming language)|Racket]]&lt;ref&gt;{{cite web|url=http://docs.racket-lang.org/guide/performance.html#(part._effective-futures)|title=Parallelism with Futures|publisher=PLT|accessdate=2 March 2012|author=}}&lt;/ref&gt;<br /> * [[Scala (programming language)|Scala]]<br /> * [[Scheme (programming language)|Scheme]]<br /> * [[Squeak Smalltalk]]<br /> * [[Strand (programming language)|Strand]]<br /> * [[Swift (Apple programming language)|Swift]]<br /> * [[Visual Basic.NET|Visual Basic]] 11 (through the ''Async'' and ''Await'' keywords)&lt;ref name=&quot;dotnetasyncawait&quot;/&gt;<br /> * [[μC++]]<br /> <br /> Languages also supporting promise pipelining include:<br /> * [[E (programming language)|E]]<br /> * [[Joule (programming language)|Joule]]<br /> <br /> Non-standard library based implementations of futures:<br /> * For [[Common Lisp]]:<br /> ** [http://orthecreedence.github.io/blackbird/ Blackbird]<br /> ** [http://common-lisp.net/project/eager-future/ Eager Future2]<br /> ** [http://marijnhaverbeke.nl/pcall/ PCall] <br /> * For C++: <br /> ** [[Boost (C++ libraries)|Boost library]] &lt;ref&gt;{{cite web<br /> |url=http://www.boost.org/doc/libs/release/doc/html/thread.html<br /> |title=Chapter 30. Thread 4.0.0<br /> |accessdate=26 June 2013}}&lt;/ref&gt;<br /> ** [[Dlib]] &lt;ref&gt;{{cite web<br /> |url=http://www.boost.org/doc/libs/release/doc/html/thread.html<br /> |title=Dlib C++ Library #thread_pool<br /> |accessdate=26 June 2013}}&lt;/ref&gt;<br /> ** [[Qt (framework)|Qt]] &lt;ref&gt;{{cite web<br /> |url=https://qt-project.org/doc/qt-5.0/qtcore/qfuture.html<br /> |title=QtCore 5.0: QFuture Class<br /> |publisher=Qt Project<br /> |accessdate=26 June 2013}}&lt;/ref&gt;<br /> * For [[C Sharp (programming language)|C#]] and other [[.NET Framework|.NET]] languages: The [[Parallel Extensions]] library<br /> * For [[Groovy (programming language)|Groovy]]: [http://gpars.codehaus.org GPars]<br /> * For [[JavaScript]]:<br /> ** [http://cujojs.com Cujo.js's] [https://github.com/cujojs/when when.js] provides promises conforming to the [http://promisesaplus.com Promises/A+] 1.1 specification.<br /> ** The [[Dojo Toolkit]] supplies both [http://dojotoolkit.org/documentation/tutorials/1.6/promises/ promises] and [[Twisted (software)|Twisted]] style Deferreds<br /> ** [[MochiKit]] [http://mochi.github.io/mochikit/doc/html/MochiKit/Async.html MochKit.Async] inspired by [[Twisted (software)#Deferreds|Twisted's Deferreds]] <br /> ** [http://jquery.com/ jQuery's] [//api.jquery.com/category/deferred-object/ Deferred Object] is based on the [http://wiki.commonjs.org/wiki/Promises/A CommonJS Promises/A] design.<br /> ** [http://angularjs.org/ Angularjs]<br /> ** [https://github.com/kriszyp/node-promise node-promise]<br /> ** [http://documentup.com/kriskowal/q Q] by Kris Kowal, conforms to Promises/A+ 1.1.<br /> ** [https://github.com/tildeio/rsvp.js RSVP.js] also conforms to Promises/A+ 1.1.<br /> ** [http://yuilibrary.com/ YUI's] [http://yuilibrary.com/yui/docs/promise/ Promise class] conforms to the Promises/A+ 1.0 specification.<br /> ** [https://github.com/petkaantonov/bluebird Bluebird] by Petka Antonov<br /> ** The [[Google_Closure_Tools#Closure_Library|Closure Library]]'s [https://github.com/google/closure-library/tree/master/closure/goog/promise promise] package conforms to the Promises/A+ specification.<br /> ** See [http://promisesaplus.com/implementations Promise/A+'s] list for more implementations based on the Promise/A+ design.<br /> <br /> * For [[Java (programming language)|Java]]:<br /> ** [http://jdeferred.org JDeferred] provides Deferred/Promise API and behavior similar to [[JQuery]].Deferred object<br /> ** [https://github.com/linkedin/parseq/wiki ParSeq] provides Task/Promise API ideal for asynchronous pipelining and branching, maintained by [[LinkedIn]].<br /> * For [[Objective-C]]: [https://github.com/mikeash/MAFuture MAFuture] ([http://www.mikeash.com/pyblog/friday-qa-2010-02-26-futures.html reference]), [https://github.com/couchdeveloper/RXPromise RXPromise], [https://github.com/Strilanc/ObjC-CollapsingFutures ObjC-CollapsingFutures], [http://promisekit.org/ PromiseKit], [https://github.com/mproberts/objc-promise objc-promise], [https://github.com/oleganza/OAPromise OAPromise]<br /> * For [[OCaml]]: [http://caml.inria.fr/pub/docs/manual-ocaml/libref/Lazy.html Lazy] module implements lazy explicit futures.<br /> * For [[Perl]]: [http://metacpan.org/module/Future Future], [https://metacpan.org/pod/Promises Promises] and [http://metacpan.org/module/Reflex/ Reflex] <br /> * For [[Php|PHP]]: [https://github.com/reactphp/promise React/Promise]<br /> * For [[Python (programming language)|Python]]:<br /> ** [https://docs.python.org/3/library/asyncio-task.html#future Built-in implementation]<br /> ** [http://code.google.com/p/pythonfutures/ pythonfutures]<br /> ** [[Twisted (software)|Twisted's]] [http://twistedmatrix.com/documents/current/core/howto/defer.html Deferreds]<br /> * For [[R (programming language)|R]]:<br /> ** [https://cran.r-project.org/package=future future] provides an extendable Future API and an implementation of lazy and eager synchronous and multi-core asynchronous futures.<br /> * For [[Ruby (programming language)|Ruby]]:<br /> ** The [http://rubygems.org/gems/promise Promise] gem<br /> ** [https://github.com/cotag/libuv libuv] gem, which implements promises<br /> ** [http://celluloid.io Celluloid] gem, which implements futures<br /> ** [https://github.com/adhearsion/future-resource future-resource]<br /> * For [[Swift (Apple programming language)|Swift]]: <br /> ** The [https://bitbucket.org/al45tair/async Async] framework, which implements C#-style &lt;code&gt;async&lt;/code&gt;/non-blocking &lt;code&gt;await&lt;/code&gt;<br /> ** [https://github.com/FutureKit/FutureKit FutureKit] - which implements a version specifically targeting [https://developer.apple.com/library/prerelease/mac/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html Apple GCD].<br /> ** [https://github.com/couchdeveloper/FutureLib FutureLib] A pure Swift 2 library implementing Scala-style Futures and Promises with TPL-style cancellation.<br /> ===Coroutines===<br /> Futures can be implemented in terms of [[coroutine]]s&lt;ref name=&quot;python&quot;/&gt; or generators,&lt;ref&gt;[https://esdiscuss.org/topic/does-async-await-solve-a-real-problem#content-2 Does async/await solve a real problem?]&lt;/ref&gt; resulting in the same evaluation strategy (e.g., cooperative multitasking or lazy evaluation).<br /> <br /> ===Channels===<br /> {{main|Channel (programming)}}<br /> Futures can easily be implemented in terms of [[Channel (programming)|channels]]: a future is a one-element channel, and a promise is a process that sends to the channel, fulfilling the future.&lt;ref&gt;&quot;[https://sites.google.com/site/gopatterns/concurrency/futures Futures]&quot;, ''[https://sites.google.com/site/gopatterns Go Language Patterns]''&lt;/ref&gt; This allows futures to be implemented in concurrent programming languages with support for channels, such as CSP and [[Go (programming language)|Go]] – the resulting futures are explicit, as they must be accessed by reading from the channel, rather than just evaluation.<br /> <br /> == References ==<br /> &lt;references/&gt;<br /> <br /> == External links ==<br /> *[http://shairosenfeld.com/concurrency.html Concurrency patterns presentation] given at [http://scaleconf.org scaleconf]<br /> * [http://c2.com/cgi/wiki?FutureValue Future Value] and [http://c2.com/cgi/wiki?PromisePipelining Promise Pipelining] at the [[Portland Pattern Repository]]<br /> * [http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/84317 Easy Threading with Futures] in [[Python (language)|Python]]<br /> <br /> {{DEFAULTSORT:Futures and promises}}<br /> [[Category:Inter-process communication]]<br /> [[Category:Actor model]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Coin_in_the_fish%27s_mouth&diff=690187211 Coin in the fish's mouth 2015-11-11T20:38:28Z <p>PuercoPop: Citation needed</p> <hr /> <div>[[File:Tuenger Facetie.jpg|thumb|[[Apostle Peter]] paying the temple tax with coin from the fish's mouth by Augustin Tünger, 1486.]]<br /> [[File:Tilapia zilli Kineret.jpg|thumb|Tilapia zilli (&quot;[[St. Peter's fish]]&quot;) - served in a [[Tiberias]] restaurant.]]<br /> The '''coin in the fish's mouth''' is one of the [[miracles of Jesus]], told in the Gospel of {{bibleverse||Matthew|17:24-27|NIV}}.&lt;ref&gt;Daniel J. Scholz 2009 ''Introducing the New Testament'' ISBN 0-88489-955-1 page 86&lt;/ref&gt;&lt;ref&gt;Steven L. Cox, Kendell H Easley, 2007 Harmony of the Gospels ISBN 0-8054-9444-8 page 349&lt;/ref&gt;&lt;ref&gt;[[Herbert Lockyer]], ''All the Miracles of the Bible'' (Zondervan, 1988) page 219.&lt;/ref&gt;<br /> <br /> In the Gospel account, in [[Capernaum]] the collectors of the two-[[Greek drachma|drachma]] temple tax ask [[Apostle Peter|Peter]] whether Jesus pays the tax, and he replies that he does. When Peter returns to where they are staying, Jesus speaks of the matter, asking his opinion: &quot;From whom do the kings of the earth collect duty and taxes — from their own children or from others?&quot; Peter answers, &quot;from others,&quot; and Jesus replies: &quot;Then the children are exempt. But so that we may not cause offense, go to the lake and throw out your line. Take the first fish you catch; open its mouth and you will find a [[Tetradrachm|four-drachma coin]]. Take it and give it to them for my tax and yours.&quot; <br /> <br /> The story ends at this point, without stating that Peter caught the fish as Jesus predicted.&lt;ref name=Twelftree&gt;[[Graham Twelftree|Graham H. Twelftree]], ''Jesus the Miracle Worker: A Historical and Theological Study'' (InterVarsity Press, 1999), page 137.&lt;/ref&gt;<br /> <br /> The four-drachma coin would be exactly enough to pay the [[temple tax]] (two-drachma coin) for two people.&lt;ref&gt;[[Craig S. Keener|Keener, Craig S.]], 2009, ''The Gospel of Matthew: A Socio-Rhetorical Commentary'', Wm. B. Eerdmans Publishing, ISBN 0-8028-6498-8, page [http://books.google.com/books?id=8C2Y_HaL5W0C&amp;pg=PA445 445].&lt;/ref&gt; The coin in the fish's mouth is generally seen as a symbolic act or sign, but there is little agreement concerning what it signifies.&lt;ref name=Twelftree /&gt;<br /> <br /> The Bible does not specify the species of the fish caught by Peter, but [[Tilapia]] is sometimes referred to as &quot;St. Peter's fish&quot;{{citation required}}.<br /> <br /> ==See also==<br /> * [[Render unto Caesar]]<br /> * [[Life of Jesus in the New Testament]]<br /> * [[Miracles of Jesus]]<br /> * [[The Tribute Money (Masaccio)]]<br /> <br /> ==References==<br /> {{Reflist}}<br /> <br /> {{Jesus footer}}<br /> {{Miracles of Jesus|state=expanded}}<br /> <br /> [[Category:Miracles of Jesus]]<br /> [[Category:Coins in the Bible]]<br /> [[Category:Interactions between humans and fish]]<br /> [[Category:Gospel of Matthew]]<br /> [[Category:Peter the Apostle]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Common_Lisp&diff=689834701 Common Lisp 2015-11-09T18:13:31Z <p>PuercoPop: /* Sorting a list of person objects */ Fix code tag left openned from the previous edit</p> <hr /> <div>{{Infobox programming language<br /> | name = Common Lisp<br /> | family = [[Lisp (programming language)|Lisp]]<br /> | paradigm = [[Multi-paradigm programming language|Multi-paradigm]]: [[procedural programming|procedural]], [[functional programming|functional]], [[object-oriented programming|object-oriented]], [[metaprogramming|meta]], [[reflective programming|reflective]], [[generic programming|generic]]<br /> | generation = [[3GL]]<br /> | released = 1984, 1994 for ANSI Common Lisp<br /> | designer = [[Scott Fahlman]], [[Richard P. Gabriel]], [[Dave Moon]], [[Guy Steele]], [[Dan Weinreb]]<br /> | developer = ANSI [[X3J13]] committee<br /> | standard reference = [[Common Lisp HyperSpec]]<br /> | latest release version =<br /> | latest release date =<br /> | typing = [[Dynamic typing|dynamic]], [[Strongly-typed programming language|strong]]<br /> | scope = lexical, optionally dynamic<br /> | namespace style = Lisp-2<br /> | implementations = [[Allegro Common Lisp|Allegro CL]], [[Armed Bear Common Lisp|ABCL]], [[CLISP]], [[Clozure CL]], [[CMUCL]], [[Embeddable Common Lisp|ECL]], [[GNU Common Lisp|GCL]], [[LispWorks]], [[Scieneer Common Lisp|Scieneer CL]], [[SBCL]], [[Genera (operating system)|Symbolics Common Lisp]]<br /> | dialects = CLtL1, CLtL2, ANSI Common Lisp<br /> | influenced_by = [[Lisp (programming language)|Lisp]], [[Lisp Machine Lisp]], [[Maclisp]], [[Scheme (programming language)|Scheme]], [[Interlisp]]<br /> | influenced = [[Clojure]], [[Dylan (programming language)|Dylan]], [[Emacs Lisp]], [[EuLisp]], [[ISLISP]], [[Julia (programming language)|Julia]], [[Moose (Perl)|Moose]], [[R (programming language)|R]], [[Cadence SKILL|SKILL]], [[SubL]]<br /> | operating_system = [[Cross-platform]]<br /> | license =<br /> | website = {{URL|http://common-lisp.net/}}<br /> | file_ext = .lisp, .lsp, .l, .cl, .fasl<br /> }}<br /> <br /> '''Common Lisp''' ('''CL''') is a dialect of the [[Lisp (programming language)|Lisp]] [[programming language]], published in [[American National Standards Institute|ANSI]] standard document ''ANSI INCITS 226-1994 (R2004)'' (formerly ''X3.226-1994 (R1999)'').&lt;ref&gt;Quoted from cover of cited standard. ANSI INCITS 226-1994 (R2004), for sale on standard's [http://webstore.ansi.org/RecordDetail.aspx?sku=ANSI+INCITS+226-1994+(R2004) document page].&lt;/ref&gt; From the ANSI Common Lisp standard the [[Common Lisp HyperSpec]], a hyperlinked HTML version, has been derived.&lt;ref&gt;[http://www.lispworks.com/documentation/HyperSpec/Front/Help.htm#Authorship Authorship of the Common Lisp HyperSpec]&lt;/ref&gt;<br /> <br /> The Common Lisp language was developed as a standardized and improved successor of [[Maclisp]]. Thus it is not an implementation, but rather a language [[specification]].&lt;ref&gt;[http://www.lispworks.com/documentation/HyperSpec/Body/01_ab.htm Common Lisp HyperSpec 1.1.2 History]&lt;/ref&gt; Several [[#Implementations|implementations]] of the Common Lisp standard are available, including [[free and open source software]] and proprietary products.&lt;ref&gt;[http://common-lisp.net/~dlw/LispSurvey.html Common Lisp Implementations: A Survey]&lt;/ref&gt;<br /> <br /> The first language documentation was published 1984 as [[Common Lisp the Language]], first edition. A second edition, published in 1990, incorporated many changes to the language, made during the ANSI Common Lisp standardization process. The final ANSI Common Lisp standard then was published in 1994. Since then no update to the standard has been published. Various extensions and improvements to Common Lisp (examples are Unicode, Concurrency, CLOS-based IO) have been provided by implementations.<br /> <br /> Common Lisp is a general-purpose, [[multi-paradigm programming language]]. It supports a combination of [[procedural programming|procedural]], [[functional programming|functional]], and [[object-oriented programming]] paradigms. As a [[dynamic programming language]], it facilitates evolutionary and [[Iterative and incremental development|incremental software development]], with iterative [[Compiler|compilation]] into efficient run-time programs. This incremental development is often done interactively without interrupting the running application.<br /> <br /> It also supports optional type annotation and casting, which can be added as necessary at the later profiling and optimization stages, to permit the compiler to generate more efficient code. For instance, &lt;code&gt;fixnum&lt;/code&gt; can hold an [[Boxing (computer science)|unboxed]] integer in a range supported by the hardware and implementation, permitting more efficient arithmetic than on big integers or arbitrary precision types. Similarly, the compiler can be told on a per-module or per-function basis which type safety level is wanted, using ''optimize'' declarations.<br /> <br /> Common Lisp includes [[Common Lisp Object System|CLOS]], an [[object system]] that supports [[multimethods]] and method combinations. It is often implemented with a [[Metaobject]] Protocol.<br /> <br /> Common Lisp is extensible through standard features such as Lisp [[Macro (computer science)|macros]] (code transformations) and reader macros (input parsers for characters).<br /> <br /> Common Lisp provides some backwards compatibility to [[Maclisp]] and to John McCarthy's original [[Lisp (programming language)|Lisp]]. This allows older Lisp software to be ported to Common Lisp.&lt;ref&gt;{{cite web<br /> | url = http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html<br /> | title = Old LISP programs still run in Common Lisp | accessdate = 2015-05-13<br /> }}&lt;/ref&gt;<br /> <br /> ==Syntax==<br /> <br /> Common Lisp is a dialect of Lisp; it uses [[S-expression]]s to denote both code and data structure. Function calls, macro forms and special forms are written as lists, with the name of the function first, as in these examples:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (+ 2 2) ; adds 2 and 2, yielding 4. The function's name is '+'. Lisp has no operators as such.<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defvar *x*) ; Ensures that a variable *x* exists,<br /> ; without giving it a value. The asterisks are part of<br /> ; the name, by convention denoting a special (global) variable. <br /> ; The symbol *x* is also hereby endowed with the property that<br /> ; subsequent bindings of it are dynamic, rather than lexical.<br /> (setf *x* 42.1) ; sets the variable *x* to the floating-point value 42.1<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Define a function that squares a number:<br /> (defun square (x)<br /> (* x x))<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Execute the function:<br /> (square 3) ; Returns 9<br /> &lt;/source&gt;<br /> &lt;!-- I truncated this a bit; in smaller browsers, it runs off the side--&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; the 'let' construct creates a scope for local variables. Here<br /> ;; the variable 'a' is bound to 6 and the variable 'b' is bound<br /> ;; to 4. Inside the 'let' is a 'body', where the last computed value is returned.<br /> ;; Here the result of adding a and b is returned from the 'let' expression.<br /> ;; The variables a and b have lexical scope, unless the symbols have been<br /> ;; marked as special variables (for instance by a prior DEFVAR).<br /> (let ((a 6)<br /> (b 4))<br /> (+ a b)) ; returns 10<br /> &lt;/source&gt;<br /> <br /> ==Data types==<br /> Common Lisp has many data types.<br /> <br /> ===Scalar types===<br /> ''Number'' types include [[integer]]s, [[ratio]]s, [[Floating point|floating-point number]]s, and [[complex number]]s.&lt;ref name=&quot;reddy&quot;&gt;{{cite web<br /> | url = http://random-state.net/features-of-common-lisp.html<br /> | title = Features of Common Lisp<br /> | first = Abhishek | last = Reddy<br /> | date = 2008-08-22<br /> }}&lt;/ref&gt; Common Lisp uses [[Arbitrary-precision arithmetic|bignum]]s to represent numerical values of arbitrary size and precision. The ratio type represents fractions exactly, a facility not available in many languages. Common Lisp automatically coerces numeric values among these types as appropriate.<br /> <br /> The Common Lisp ''[[character (computing)|character]]'' type is not limited to [[ASCII]] characters. Most modern implementations allow [[Unicode]] characters.&lt;ref&gt;{{cite web<br /> | url = http://www.cliki.net/Unicode%20Support<br /> | title = Unicode support | work = The Common Lisp Wiki | accessdate = 2008-08-21<br /> }}&lt;/ref&gt;<br /> <br /> The ''[[Symbol (programming)|symbol]]'' type is common to Lisp languages, but largely unknown outside them. A symbol is a unique, named data object with several parts: name, value, function, property list and package. Of these, ''value cell'' and ''function cell'' are the most important. Symbols in Lisp are often used similarly to identifiers in other languages: to hold the value of a variable; however there are many other uses. Normally, when a symbol is evaluated, its value is returned. Some symbols evaluate to themselves, for example all symbols in the keyword package are self-evaluating. Boolean values in Common Lisp are represented by the self-evaluating symbols T and NIL. Common Lisp has namespaces for symbols, called 'packages'.<br /> <br /> A number of functions are available for [[rounding]] scalar numeric values in various ways. The function &lt;code&gt;round&lt;/code&gt; rounds the argument to the nearest integer, with halfway cases rounded to the even integer. The functions &lt;code&gt;truncate&lt;/code&gt;, &lt;code&gt;floor&lt;/code&gt;, and &lt;code&gt;ceiling&lt;/code&gt; round towards zero, down, or up respectively. All these functions return the discarded fractional part as a secondary value. For example, &lt;code&gt;(floor -2.5)&lt;/code&gt; yields -3, 0.5; &lt;code&gt;(ceiling -2.5)&lt;/code&gt; yields -2, -0.5; &lt;code&gt;(round 2.5)&lt;/code&gt; yields 2, 0.5; and &lt;code&gt;(round 3.5)&lt;/code&gt; yields 4, -0.5.<br /> <br /> ===Data structures===<br /> ''Sequence'' types in Common Lisp include lists, vectors, bit-vectors, and strings. There are many operations which can work on any sequence type.<br /> <br /> As in almost all other Lisp dialects, ''lists'' in Common Lisp are composed of ''conses'', sometimes called ''cons cells'' or ''pairs''. A cons is a data structure with two slots, called its ''car'' and ''cdr''. A list is a linked chain of conses or the empty list. Each cons's car refers to a member of the list (possibly another list). Each cons's cdr refers to the next cons—except for the last cons in a list, whose cdr refers to the &lt;code&gt;nil&lt;/code&gt; value. Conses can also easily be used to implement trees and other complex data structures; though it is usually advised to use structure or class instances instead. It is also possible to create circular data structures with conses.<br /> <br /> Common Lisp supports multidimensional ''arrays'', and can dynamically resize ''adjustable'' arrays if required. Multidimensional arrays can be used for matrix mathematics. A ''vector'' is a one-dimensional array. Arrays can carry any type as members (even mixed types in the same array) or can be specialized to contain a specific type of members, as in a vector of bits. Usually only a few types are supported. Many implementations can optimize array functions when the array used is type-specialized. Two type-specialized array types are standard: a ''string'' is a vector of characters, while a ''bit-vector'' is a vector of [[bit]]s.<br /> <br /> ''[[Hash table]]s'' store associations between data objects. Any object may be used as key or value. Hash tables are automatically resized as needed.<br /> <br /> ''Packages'' are collections of symbols, used chiefly to separate the parts of a program into [[namespaces]]. A package may ''export'' some symbols, marking them as part of a public interface. Packages can use other packages.<br /> <br /> ''Structures'', similar in use to [[C (programming language)|C]] structs and [[Pascal (programming language)|Pascal]] records, represent arbitrary complex data structures with any number and type of fields (called ''slots''). Structures allow single-inheritance.<br /> <br /> ''Classes'' are similar to structures, but offer more dynamic features and multiple-inheritance. (See [[Common Lisp Object System|CLOS]]). Classes have been added late to Common Lisp and there is some conceptual overlap with structures. Objects created of classes are called ''Instances''. A special case are Generic Functions. Generic Functions are both functions and instances.<br /> <br /> ===Functions===<br /> Common Lisp supports [[first-class function]]s. For instance, it is possible to write functions that take other functions as arguments or return functions as well. This makes it possible to describe very general operations.<br /> <br /> The Common Lisp library relies heavily on such higher-order functions. For example, the &lt;code&gt;sort&lt;/code&gt; function takes a [[relational operator]] as an argument and key function as an optional keyword argument. This can be used not only to sort any type of data, but also to sort data structures according to a key.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Sorts the list using the &gt; and &lt; function as the relational operator.<br /> (sort (list 5 2 6 3 1 4) #'&gt;) ; Returns (6 5 4 3 2 1)<br /> (sort (list 5 2 6 3 1 4) #'&lt;) ; Returns (1 2 3 4 5 6)<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Sorts the list according to the first element of each sub-list.<br /> (sort (list '(9 A) '(3 B) '(4 C)) #'&lt; :key #'first) ; Returns ((3 B) (4 C) (9 A))<br /> &lt;/source&gt;<br /> <br /> The evaluation model for functions is very simple. When the evaluator encounters a form &lt;code&gt;(f a1 a2...)&lt;/code&gt; then it presumes that the symbol named f is one of the following:<br /> <br /> # A special operator (easily checked against a fixed list)<br /> # A macro operator (must have been defined previously)<br /> # The name of a function (default), which may either be a symbol, or a sub-form beginning with the symbol &lt;code&gt;lambda&lt;/code&gt;.<br /> <br /> If f is the name of a function, then the arguments a1, a2, ..., an are evaluated in left-to-right order, and the function is found and invoked with those values supplied as parameters.<br /> <br /> ====Defining functions====<br /> The [[Defun|macro &lt;code&gt;defun&lt;/code&gt;]] defines functions where a function definition gives the name of the function, the names of any arguments, and a function body:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun square (x)<br /> (* x x))<br /> &lt;/source&gt;<br /> <br /> Function definitions may include compiler [[Directive (programming)|directives]], known as ''declarations'', which provide hints to the compiler about optimization settings or the data types of arguments. They may also include ''documentation strings'' (docstrings), which the Lisp system may use to provide interactive documentation:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun square (x)<br /> &quot;Calculates the square of the single-float x.&quot;<br /> (declare (single-float x) (optimize (speed 3) (debug 0) (safety 1)))<br /> (the single-float (* x x)))<br /> &lt;/source&gt;<br /> <br /> Anonymous functions ([[function literal]]s) are defined using &lt;code&gt;lambda&lt;/code&gt; expressions, e.g. &lt;code&gt;(lambda&amp;nbsp;(x)&amp;nbsp;(*&amp;nbsp;x&amp;nbsp;x))&lt;/code&gt; for a function that squares its argument. Lisp programming style frequently uses higher-order functions for which it is useful to provide anonymous functions as arguments.<br /> <br /> Local functions can be defined with &lt;code&gt;flet&lt;/code&gt; and &lt;code&gt;labels&lt;/code&gt;.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (flet ((square (x)<br /> (* x x)))<br /> (square 3))<br /> &lt;/source&gt;<br /> <br /> There are a number of other operators related to the definition and manipulation of functions. For instance, a function may be compiled with the &lt;code&gt;compile&lt;/code&gt; operator. (Some Lisp systems run functions using an interpreter by default unless instructed to compile; others compile every function).<br /> <br /> ====Defining generic functions and methods====<br /> The macro &lt;code&gt;defgeneric&lt;/code&gt; defines generic functions.<br /> The macro &lt;code&gt;defmethod&lt;/code&gt; defines methods. Generic functions are a collection of methods.<br /> <br /> Methods can specialize their parameters over CLOS ''standard classes'', ''system classes'', ''structure classes'' or objects. For many types there are corresponding ''system classes''.<br /> <br /> When a generic function is called, multiple-dispatch will determine the effective method to use.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defgeneric add (a b))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a number) (b number))<br /> (+ a b))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a vector) (b number))<br /> (map 'vector (lambda (n) (+ n b)) a))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a vector) (b vector))<br /> (map 'vector #'+ a b))<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a string)(b string))<br /> (concatenate 'string a b) )<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (add 2 3) ; returns 5<br /> (add #(1 2 3 4) 7) ; returns #(8 9 10 11)<br /> (add #(1 2 3 4) #(4 3 2 1)) ; returns #(5 5 5 5)<br /> (add &quot;COMMON &quot; &quot;LISP&quot;) ; returns &quot;COMMON LISP&quot;<br /> &lt;/source&gt;<br /> <br /> Generic Functions are also a first class data type. There are many more features to Generic Functions and Methods than described above.<br /> <br /> ====The function namespace====<br /> &lt;!-- This section name is linked from several places; if you change it, update the links. --&gt;<br /> <br /> The namespace for function names is separate from the namespace for data variables. This is a key difference between Common Lisp and [[Scheme (programming language)|Scheme]]. For Common Lisp, operators that define names in the function namespace include &lt;code&gt;defun&lt;/code&gt;, &lt;code&gt;flet&lt;/code&gt;, &lt;code&gt;labels&lt;/code&gt;, &lt;code&gt;defmethod&lt;/code&gt; and &lt;code&gt;defgeneric&lt;/code&gt;.<br /> <br /> To pass a function by name as an argument to another function, one must use the &lt;code&gt;function&lt;/code&gt; special operator, commonly abbreviated as &lt;code&gt;#'&lt;/code&gt;. The first &lt;code&gt;sort&lt;/code&gt; example above refers to the function named by the symbol &lt;code&gt;&amp;gt;&lt;/code&gt; in the function namespace, with the code &lt;code&gt;#'&amp;gt;&lt;/code&gt;. Conversely, to call a function passed in such a way, one would use the &lt;code&gt;funcall&lt;/code&gt; operator on the argument.<br /> <br /> [[Scheme (programming language)|Scheme's]] evaluation model is simpler: there is only one namespace, and all positions in the form are evaluated (in any order) -- not just the arguments. Code written in one dialect is therefore sometimes confusing to programmers more experienced in the other. For instance, many Common Lisp programmers like to use descriptive variable names such as ''list'' or ''string'' which could cause problems in Scheme, as they would locally shadow function names.<br /> <br /> Whether a separate namespace for functions is an advantage is a source of contention in the Lisp community. It is usually referred to as the ''Lisp-1 vs. Lisp-2 debate''. Lisp-1 refers to Scheme's model and Lisp-2 refers to Common Lisp's model. These names were coined in a 1988 paper by [[Richard P. Gabriel]] and [[Kent Pitman]], which extensively compares the two approaches.&lt;ref&gt;{{cite journal |title=Technical Issues of Separation in Function Cells and Value Cells |url=http://www.nhplace.com/kent/Papers/Technical-Issues.html |authors=Richard P. Gabriel, Kent M. Pitman |journal=Lisp and Symbolic Computation |date = June 1988|volume=1 |issue=1 |pages=81–101 |doi=10.1007/bf01806178}}&lt;/ref&gt;<br /> <br /> ===Other types===<br /> Other data types in Common Lisp include:<br /> <br /> *''Pathnames'' represent files and directories in the [[filesystem]]. The Common Lisp pathname facility is more general than most operating systems' file naming conventions, making Lisp programs' access to files broadly portable across diverse systems.<br /> *Input and output ''streams'' represent sources and sinks of binary or textual data, such as the terminal or open files.<br /> *Common Lisp has a built-in [[pseudo-random number generator]] (PRNG). ''Random state'' objects represent reusable sources of pseudo-random numbers, allowing the user to seed the PRNG or cause it to replay a sequence.<br /> *''Conditions'' are a type used to represent errors, exceptions, and other &quot;interesting&quot; events to which a program may respond.<br /> *''Classes'' are [[first-class object]]s, and are themselves instances of classes called [[metaclasses|metaobject classes]] ([[metaclasses]] for short).<br /> *''Readtables'' are a type of object which control how Common Lisp's reader parses the text of source code. By controlling which readtable is in use when code is read in, the programmer can change or extend the language's syntax.<br /> <br /> ==Scope==<br /> <br /> Like programs in many other programming languages, Common Lisp programs make use of names to refer to variables, functions, and many other kinds of entities. Named references are subject to scope.<br /> <br /> The association between a name and the entity which the name refers to is called a binding.<br /> <br /> Scope refers to the set of circumstances in which a name is determined to have a particular binding.<br /> <br /> ===Determiners of scope===<br /> <br /> The circumstances which determine scope in Common Lisp include:<br /> <br /> * the location of a reference within an expression. If it's the leftmost position of a compound, it refers to a special operator or a macro or function binding, otherwise to a variable binding or something else.<br /> * the kind of expression in which the reference takes place. For instance, &lt;code&gt;(go x)&lt;/code&gt; means transfer control to label &lt;code&gt;x&lt;/code&gt;, whereas &lt;code&gt;(print x)&lt;/code&gt; refers to the variable &lt;code&gt;x&lt;/code&gt;. Both scopes of &lt;code&gt;x&lt;/code&gt; can be active in the same region of program text, since tagbody labels are in a separate namespace from variable names. A special form or macro form has complete control over the meanings of all symbols in its syntax. For instance in &lt;code&gt;(defclass x (a b) ())&lt;/code&gt;, a class definition, the &lt;code&gt;(a b)&lt;/code&gt; is a list of base classes, so these names are looked up in the space of class names, and &lt;code&gt;x&lt;/code&gt; isn't a reference to an existing binding, but the name of a new class being derived from &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;. These facts emerge purely from the semantics of &lt;code&gt;defclass&lt;/code&gt;. The only generic fact about this expression is that &lt;code&gt;defclass&lt;/code&gt; refers to a macro binding; everything else is up to &lt;code&gt;defclass&lt;/code&gt;.<br /> * the location of the reference within the program text. For instance, if a reference to variable &lt;code&gt;x&lt;/code&gt; is enclosed in a binding construct such as a &lt;code&gt;let&lt;/code&gt; which defines a binding for &lt;code&gt;x&lt;/code&gt;, then the reference is in the scope created by that binding.<br /> * for a variable reference, whether or not a variable symbol has been, locally or globally, declared special. This determines whether the reference is resolved within a lexical environment, or within a dynamic environment.<br /> * the specific instance of the environment in which the reference is resolved. An environment is a run-time dictionary which maps symbols to bindings. Each kind of reference uses its own kind of environment. References to lexical variables are resolved in a lexical environment, et cetera. More than one environment can be associated with the same reference. For instance, thanks to recursion or the use of multiple threads, multiple activations of the same function can exist at the same time. These activations share the same program text, but each has its own lexical environment instance.<br /> <br /> To understand what a symbol refers to, the Common Lisp programmer must know what kind of reference is being expressed, what kind of scope it uses if it is a variable reference (dynamic versus lexical scope), and also the run-time situation: in what environment is the reference resolved, where was the binding introduced into the environment, et cetera.<br /> <br /> ===Kinds of environment===<br /> <br /> ====Global====<br /> <br /> Some environments in Lisp are globally pervasive. For instance, if a new type is defined, it is known everywhere thereafter. References to that type look it up in this global environment.<br /> <br /> ====Dynamic====<br /> <br /> One type of environment in Common Lisp is the dynamic environment. Bindings established in this environment have dynamic extent, which means that a binding is established at the start of the execution of some construct, such as a &lt;code&gt;let&lt;/code&gt; block, and disappears when that construct finishes executing: its lifetime is tied to the dynamic activation and deactivation of a block. However, a dynamic binding is not just visible within that block; it is also visible to all functions invoked from that block. This type of visibility is known as indefinite scope. Bindings which exhibit dynamic extent (lifetime tied to the activation and deactivation of a block) and indefinite scope (visible to all functions which are called from that block) are said to have dynamic scope.<br /> <br /> Common Lisp has support for dynamically scoped variables, which are also called special variables. Certain other kinds of bindings are necessarily dynamically scoped also, such as restarts and catch tags. Function bindings cannot be dynamically scoped using &lt;code&gt;flet&lt;/code&gt; (which only provides lexically scoped function bindings), but function objects (a first-level object in Common Lisp) can be assigned to dynamically scoped variables, bound using &lt;code&gt;let&lt;/code&gt; in dynamic scope, then called using &lt;code&gt;funcall&lt;/code&gt; or &lt;code&gt;APPLY&lt;/code&gt;.<br /> <br /> Dynamic scope is extremely useful because it adds referential clarity and discipline to [[global variable]]s. Global variables are frowned upon in computer science as potential sources of error, because they can give rise to ad-hoc, covert channels of communication among modules that lead to unwanted, surprising interactions.<br /> <br /> In Common Lisp, a special variable which has only a top-level binding behaves just like a global variable in other programming languages. A new value can be stored into it, and that value simply replaces what is in the top-level binding. Careless replacement of the value of a global variable is at the heart of bugs caused by use of global variables. However, another way to work with a special variable is to give it a new, local binding within an expression. This is sometimes referred to as &quot;rebinding&quot; the variable. Binding a dynamically scoped variable temporarily creates a new memory location for that variable, and associates the name with that location. While that binding is in effect, all references to that variable refer to the new binding; the previous binding is hidden. When execution of the binding expression terminates, the temporary memory location is gone, and the old binding is revealed, with the original value intact. Of course, multiple dynamic bindings for the same variable can be nested.<br /> <br /> In Common Lisp implementations which support multithreading, dynamic scopes are specific to each thread of execution. Thus special variables serve as an abstraction for thread local storage. If one thread rebinds a special variable, this rebinding has no effect on that variable in other threads. The value stored in a binding can only be retrieved by the thread which created that binding. If each thread binds some special variable &lt;code&gt;*x*&lt;/code&gt;, then &lt;code&gt;*x*&lt;/code&gt; behaves like thread-local storage. Among threads which do not rebind &lt;code&gt;*x*&lt;/code&gt;, it behaves like an ordinary global: all of these threads refer to the same top-level binding of &lt;code&gt;*x*&lt;/code&gt;.<br /> <br /> Dynamic variables can be used to extend the execution context with additional context information which is implicitly passed from function to function without having to appear as an extra function parameter. This is especially useful when the control transfer has to pass through layers of unrelated code, which simply cannot be extended with extra parameters to pass the additional data. A situation like this usually calls for a global variable. That global variable must be saved and restored, so that the scheme doesn't break under recursion: dynamic variable rebinding takes care of this. And that variable must be made thread-local (or else a big mutex must be used) so the scheme doesn't break under threads: dynamic scope implementations can take care of this also.<br /> <br /> In the Common Lisp library, there are many standard special variables. For instance, all standard I/O streams are stored in the top-level bindings of well-known special variables. The standard output stream is stored in *standard-output*.<br /> <br /> Suppose a function foo writes to standard output:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun foo ()<br /> (format t &quot;Hello, world&quot;))<br /> &lt;/source&gt;<br /> <br /> To capture its output in a character string, *standard-output* can be bound to a string stream and called:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (with-output-to-string (*standard-output*)<br /> (foo))<br /> &lt;/source&gt;<br /> <br /> -&gt; &quot;Hello, world&quot; ; gathered output returned as a string<br /> <br /> ====Lexical====<br /> <br /> Common Lisp supports lexical environments. Formally, the bindings in a lexical environment have [[lexical scope]] and may have either indefinite extent or dynamic extent, depending on the type of namespace. [[Lexical scope]] means that visibility is physically restricted to the block in which the binding is established. References which are not textually (i.e. lexically) embedded in that block simply do not see that binding.<br /> <br /> The tags in a TAGBODY have lexical scope. The expression (GO X) is erroneous if it is not actually embedded in a TAGBODY which contains a label X. However, the label bindings disappear when the TAGBODY terminates its execution, because they have dynamic extent. If that block of code is re-entered by the invocation of a lexical closure, it is invalid for the body of that closure to try to transfer control to a tag via GO:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defvar *stashed*) ;; will hold a function<br /> <br /> (tagbody<br /> (setf *stashed* (lambda () (go some-label)))<br /> (go end-label) ;; skip the (print &quot;Hello&quot;)<br /> some-label<br /> (print &quot;Hello&quot;)<br /> end-label)<br /> -&gt; NIL<br /> &lt;/source&gt;<br /> <br /> When the TAGBODY is executed, it first evaluates the setf form which stores a function in the special variable *stashed*. Then the (go end-label) transfers control to end-label, skipping the code (print &quot;Hello&quot;). Since end-label is at the end of the tagbody, the tagbody terminates, yielding NIL. Suppose that the previously remembered function is now called:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (funcall *stashed*) ;; Error!<br /> &lt;/source&gt;<br /> <br /> This situation is erroneous. One implementation's response is an error condition containing the message, &quot;GO: tagbody for tag SOME-LABEL has already been left&quot;. The function tried to evaluate (go some-label), which is lexically embedded in the tagbody, and resolves to the label. However, the tagbody isn't executing (its extent has ended), and so the control transfer cannot take place.<br /> <br /> Local function bindings in Lisp have [[lexical scope]], and variable bindings also have lexical scope by default. By contrast with GO labels, both of these have indefinite extent. When a lexical function or variable binding is established, that binding continues to exist for as long as references to it are possible, even after the construct which established that binding has terminated. References to lexical variables and functions after the termination of their establishing construct are possible thanks to [[lexical closure]]s.<br /> <br /> Lexical binding is the default binding mode for Common Lisp variables. For an individual symbol, it can be switched to dynamic scope, either by a local declaration, by a global declaration. The latter may occur implicitly through the use of a construct like DEFVAR or DEFPARAMETER. It is an important convention in Common Lisp programming that special (i.e. dynamically scoped) variables have names which begin and end with an asterisk [[Sigil (computer programming)|sigil]] &lt;code&gt;*&lt;/code&gt; in what is called the “[[earmuff]] convention”.&lt;ref&gt;[http://letoverlambda.com/index.cl/guest/chap2.html Chapter 2] of [[Let Over Lambda]]&lt;/ref&gt; If adhered to, this convention effectively creates a separate namespace for special variables, so that variables intended to be lexical are not accidentally made special.<br /> <br /> [[Lexical scope]] is useful for several reasons.<br /> <br /> Firstly, references to variables and functions can be compiled to efficient machine code, because the run-time environment structure is relatively simple. In many cases it can be optimized to stack storage, so opening and closing lexical scopes has minimal overhead. Even in cases where full closures must be generated, access to the closure's environment is still efficient; typically each variable becomes an offset into a vector of bindings, and so a variable reference becomes a simple load or store instruction with a base-plus-offset [[addressing mode]].<br /> <br /> Secondly, lexical scope (combined with indefinite extent) gives rise to the [[lexical closure]], which in turn creates a whole paradigm of programming centered around the use of functions being first-class objects, which is at the root of functional programming.<br /> <br /> Thirdly, perhaps most importantly, even if lexical closures are not exploited, the use of lexical scope isolates program modules from unwanted interactions. Due to their restricted visibility, lexical variables are private. If one module A binds a lexical variable X, and calls another module B, references to X in B will not accidentally resolve to the X bound in A. B simply has no access to X. For situations in which disciplined interactions through a variable are desirable, Common Lisp provides special variables. Special variables allow for a module A to set up a binding for a variable X which is visible to another module B, called from A. Being able to do this is an advantage, and being able to prevent it from happening is also an advantage; consequently, Common Lisp supports both lexical and [[dynamic scope]].<br /> <br /> ==Macros==<br /> A ''[[Macro (computer science)|macro]]'' in Lisp superficially resembles a function in usage. However, rather than representing an expression which is evaluated, it represents a transformation of the program source code. The macro gets the source it surrounds as arguments, binds them to its parameters and computes a new source form. This new form can also use a macro. The macro expansion is repeated until the new source form does not use a macro. The final computed form is the source code executed at runtime.<br /> <br /> Typical uses of macros in Lisp:<br /> <br /> * new control structures (example: looping constructs, branching constructs)<br /> * scoping and binding constructs<br /> * simplified syntax for complex and repeated source code<br /> * top-level defining forms with compile-time side-effects<br /> * data-driven programming<br /> * embedded domain specific languages (examples: SQL, HTML, Prolog)<br /> * implicit finalization forms<br /> <br /> Various standard Common Lisp features also need to be implemented as macros, such as:<br /> <br /> * the standard &lt;code&gt;setf&lt;/code&gt; abstraction, to allow custom compile-time expansions of assignment/access operators<br /> * &lt;code&gt;with-accessors&lt;/code&gt;, &lt;code&gt;with-slots&lt;/code&gt;, &lt;code&gt;with-open-file&lt;/code&gt; and other similar &lt;code&gt;WITH&lt;/code&gt; macros<br /> * Depending on implementation, &lt;code&gt;if&lt;/code&gt; or &lt;code&gt;cond&lt;/code&gt; is a macro built on the other, the special operator; &lt;code&gt;when&lt;/code&gt; and &lt;code&gt;unless&lt;/code&gt; consist of macros<br /> * The powerful &lt;code&gt;loop&lt;/code&gt; domain-specific language<br /> <br /> Macros are defined by the ''defmacro'' macro. The special operator ''macrolet'' allows the definition of local (lexically scoped) macros. It is also possible to define macros for symbols using ''define-symbol-macro'' and ''symbol-macrolet''.<br /> <br /> [[Paul Graham (computer programmer)|Paul Graham]]'s book [[On Lisp]] describes the use of macros in Common Lisp in detail. [[Doug Hoyte]]'s book [[Let Over Lambda]] extends the discussion on macros, claiming &quot;Macros are the single greatest advantage that lisp has as a programming language and the single greatest advantage of any programming language.&quot; Hoyte provides several examples of iterative development of macros.<br /> <br /> ===Example using a macro to define a new control structure===<br /> Macros allow Lisp programmers to create new syntactic forms in the language. One typical use is to create new control structures. The example macro provides an &lt;code&gt;until&lt;/code&gt; looping construct. The syntax is:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> (until test form*)<br /> &lt;/source&gt;<br /> <br /> The macro definition for ''until'':<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmacro until (test &amp;body body)<br /> (let ((start-tag (gensym &quot;START&quot;))<br /> (end-tag (gensym &quot;END&quot;)))<br /> `(tagbody ,start-tag<br /> (when ,test (go ,end-tag))<br /> (progn ,@body)<br /> (go ,start-tag)<br /> ,end-tag)))<br /> &lt;/source&gt;<br /> <br /> ''tagbody'' is a primitive Common Lisp special operator which provides the ability to name tags and use the ''go'' form to jump to those tags. The backquote ''`'' provides a notation that provides code templates, where the value of forms preceded with a comma are filled in. Forms preceded with comma and at-sign are ''spliced'' in. The tagbody form tests the end condition. If the condition is true, it jumps to the end tag. Otherwise the provided body code is executed and then it jumps to the start tag.<br /> <br /> An example form using above ''until'' macro:<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (until (= (random 10) 0)<br /> (write-line &quot;Hello&quot;))<br /> &lt;/source&gt;<br /> <br /> The code can be expanded using the function ''macroexpand-1''. The expansion for above example looks like this:<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (TAGBODY<br /> #:START1136<br /> (WHEN (ZEROP (RANDOM 10))<br /> (GO #:END1137))<br /> (PROGN (WRITE-LINE &quot;hello&quot;))<br /> (GO #:START1136)<br /> #:END1137)<br /> &lt;/source&gt;<br /> <br /> During macro expansion the value of the variable ''test'' is ''(= (random 10) 0)'' and the value of the variable ''body'' is ''((write-line &quot;Hello&quot;))''. The body is a list of forms.<br /> <br /> Symbols are usually automatically upcased. The expansion uses the TAGBODY with two labels. The symbols for these labels are computed by GENSYM and are not interned in any package. Two ''go'' forms use these tags to jump to. Since ''tagbody'' is a primitive operator in Common Lisp (and not a macro), it will not be expanded into something else. The expanded form uses the ''when'' macro, which also will be expanded. Fully expanding a source form is called ''code walking''.<br /> <br /> In the fully expanded (''walked'') form, the ''when'' form is replaced by the primitive ''if'':<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (TAGBODY<br /> #:START1136<br /> (IF (ZEROP (RANDOM 10))<br /> (PROGN (GO #:END1137))<br /> NIL)<br /> (PROGN (WRITE-LINE &quot;hello&quot;))<br /> (GO #:START1136))<br /> #:END1137)<br /> &lt;/source&gt;<br /> <br /> All macros must be expanded before the source code containing them can be evaluated or compiled normally. Macros can be considered functions that accept and return [[abstract syntax tree]]s (Lisp S-expressions). These functions<br /> are invoked before the evaluator or compiler to produce the final source code.<br /> Macros are written in normal Common Lisp, and may use any Common Lisp (or third-party) operator available.<br /> <br /> ===Variable capture and shadowing===<br /> Common Lisp macros are capable of what is commonly called ''variable capture'', where symbols in the macro-expansion body coincide with those in the calling context, allowing the programmer to create macros wherein various symbols have special meaning. The term ''variable capture'' is somewhat misleading, because all namespaces are vulnerable to unwanted capture, including the operator and function namespace, the tagbody label namespace, catch tag, condition handler and restart namespaces.<br /> <br /> ''Variable capture'' can introduce software defects. This happens in one of the following two ways:<br /> <br /> * In the first way, a macro expansion can inadvertently make a symbolic reference which the macro writer assumed will resolve in a global namespace, but the code where the macro is expanded happens to provide a local, shadowing definition which steals that reference. Let this be referred to as type 1 capture.<br /> <br /> * The second way, type 2 capture, is just the opposite: some of the arguments of the macro are pieces of code supplied by the macro caller, and those pieces of code are written such that they make references to surrounding bindings. However, the macro inserts these pieces of code into an expansion which defines its own bindings that accidentally captures some of these references.<br /> <br /> The Scheme dialect of Lisp provides a macro-writing system which provides the referential transparency that eliminates both types of capture problem. This type of macro system is sometimes called &quot;hygienic&quot;, in particular by its proponents (who regard macro systems which do not automatically solve this problem as unhygienic). {{Citation needed|date=May 2011}}<br /> <br /> In Common Lisp, macro hygiene is ensured one of two different ways.<br /> <br /> One approach is to use [[gensym]]s: guaranteed-unique symbols which can be used in a macro-expansion without threat of capture. The use of gensyms in a macro definition is a manual chore, but macros can be written which simplify the instantiation and use of gensyms. Gensyms solve type 2 capture easily, but they are not applicable to type 1 capture in the same way, because the macro expansion cannot rename the interfering symbols in the surrounding code which capture its references. Gensyms could be used to provide stable aliases for the global symbols which the macro expansion needs. The macro expansion would use these secret aliases rather than the well-known names, so redefinition of the well-known names would have no ill effect on the macro.<br /> <br /> Another approach is to use packages. A macro defined in its own package can simply use internal symbols in that package in its expansion. The use of packages deals with type 1 and type 2 capture.<br /> <br /> However, packages don't solve the type 1 capture of references to standard Common Lisp functions and operators. The reason is that the use of packages to solve capture problems revolves around the use of private symbols (symbols in one package, which are not imported into, or otherwise made visible in other packages). Whereas the Common Lisp library symbols are external, and frequently imported into or made visible in user-defined packages.<br /> <br /> The following is an example of unwanted capture in the operator namespace, occurring in the expansion of a macro:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; expansion of UNTIL makes liberal use of DO<br /> (defmacro until (expression &amp;body body)<br /> `(do () (,expression) ,@body))<br /> <br /> ;; macrolet establishes lexical operator binding for DO<br /> (macrolet ((do (...) ... something else ...))<br /> (until (= (random 10) 0) (write-line &quot;Hello&quot;)))<br /> &lt;/source&gt;<br /> <br /> The &lt;code&gt;until&lt;/code&gt; macro will expand into a form which calls &lt;code&gt;do&lt;/code&gt; which is intended to refer to the standard Common Lisp macro &lt;code&gt;do&lt;/code&gt;. However, in this context, &lt;code&gt;do&lt;/code&gt; may have a completely different meaning, so &lt;code&gt;until&lt;/code&gt; may not work properly.<br /> <br /> Common Lisp solves the problem of the shadowing of standard operators and functions by forbidding their redefinition. Because it redefines the standard operator &lt;code&gt;do&lt;/code&gt;, the preceding is actually a fragment of non-conforming Common Lisp, which allows implementations to diagnose and reject it.<br /> <br /> ==Condition system==<br /> The ''condition system'' is responsible for [[exception handling]] in Common Lisp.&lt;ref name=&quot;Seibel2005&quot;&gt;{{cite book|author=Peter Seibel|title=Practical Common Lisp|url=http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html|date=7 April 2005|publisher=Apress|isbn=978-1-59059-239-7}}&lt;/ref&gt; It provides ''conditions'', ''handler''s and ''restart''s. ''Condition''s are objects describing an exceptional situation (for example an error). If a ''condition'' is signaled, the Common Lisp system searches for a ''handler'' for this condition type and calls the handler. The ''handler'' can now search for restarts and use one of these restarts to repair the current problem. As part of a user interface (for example of a debugger), these restarts can also be presented to the user, so that the user can select and invoke one of the available restarts. Since the condition handler is called in the context of the error (without unwinding the stack), full error recovery is possible in many cases, where other exception handling systems would have already terminated the current routine. The debugger itself can also be customized or replaced using the &lt;code&gt;*debugger-hook*&lt;/code&gt; dynamic variable.<br /> <br /> In the following example (using [[Symbolics Genera]]) the user tries to open a file in a Lisp function ''test'' called from the Read-Eval-Print-LOOP ([[REPL]]), when the file does not exist. The Lisp system presents four restarts. The user selects the ''Retry OPEN using a different pathname'' restart and enters a different pathname (lispm-init.lisp instead of lispm-int.lisp). The user code does not contain any error handling code. The whole error handling and restart code is provided by the Lisp system, which can handle and repair the error without terminating the user code.<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> Command: (test &quot;&gt;zippy&gt;lispm-int.lisp&quot;)<br /> <br /> Error: The file was not found.<br /> For lispm:&gt;zippy&gt;lispm-int.lisp.newest<br /> <br /> LMFS:OPEN-LOCAL-LMFS-1<br /> Arg 0: #P&quot;lispm:&gt;zippy&gt;lispm-int.lisp.newest&quot;<br /> <br /> s-A, &lt;Resume&gt;: Retry OPEN of lispm:&gt;zippy&gt;lispm-int.lisp.newest<br /> s-B: Retry OPEN using a different pathname<br /> s-C, &lt;Abort&gt;: Return to Lisp Top Level in a TELNET server<br /> s-D: Restart process TELNET terminal<br /> <br /> -&gt; Retry OPEN using a different pathname<br /> Use what pathname instead [default lispm:&gt;zippy&gt;lispm-int.lisp.newest]:<br /> lispm:&gt;zippy&gt;lispm-init.lisp.newest<br /> <br /> ...the program continues<br /> &lt;/source&gt;<br /> <br /> ==Common Lisp Object System (CLOS)==<br /> <br /> {{Main|Common Lisp Object System}}<br /> <br /> Common Lisp includes a toolkit for [[object-oriented programming]], the Common Lisp Object System or [[Common Lisp Object System|CLOS]], which is one of the most powerful object systems available in any language. For example, [[Peter Norvig]] explains how many [[Design pattern (computer science)|Design Patterns]] are simpler to implement in a dynamic language with the features of CLOS (Multiple Inheritance, Mixins, Multimethods, Metaclasses, Method combinations, etc.).&lt;ref&gt;[http://norvig.com/design-patterns/ppframe.htm Peter Norvig, Design Patterns in Dynamic Programming]&lt;/ref&gt;<br /> Several extensions to Common Lisp for object-oriented programming have been proposed to be included into the ANSI Common Lisp standard, but eventually CLOS was adopted as the standard object-system for Common Lisp. CLOS is a [[dynamic programming language|dynamic]] object system with [[multiple dispatch]] and [[multiple inheritance]], and differs radically from the OOP facilities found in static languages such as [[C++]] or [[Java (programming language)|Java]]. As a dynamic object system, CLOS allows changes at runtime to generic functions and classes. Methods can be added and removed, classes can be added and redefined, objects can be updated for class changes and the class of objects can be changed.<br /> <br /> CLOS has been integrated into ANSI Common Lisp. Generic Functions can be used like normal functions and are a first-class data type. Every CLOS class is integrated into the Common Lisp type system. Many Common Lisp types have a corresponding class. There is more potential use of CLOS for Common Lisp. The specification does not say whether conditions are implemented with CLOS. Pathnames and streams could be implemented with CLOS. These further usage possibilities of CLOS for ANSI Common Lisp are not part of the standard. Actual Common Lisp implementations are using CLOS for pathnames, streams, input/output, conditions, the implementation of CLOS itself and more.<br /> <br /> ==Compiler and interpreter==<br /> Several implementations of earlier Lisp dialects provided both an interpreter and a compiler. Unfortunately often the semantics were different. These earlier Lisps implemented lexical scoping in the compiler and dynamic scoping in the interpreter. Common Lisp requires that both the interpreter and compiler use lexical scoping by default. The Common Lisp standard describes both the semantics of the interpreter and a compiler. The compiler can be called using the function ''compile'' for individual functions and using the function ''compile-file'' for files. Common Lisp allows type declarations and provides ways to influence the compiler code generation policy. For the latter various optimization qualities can be given values between 0 (not important) and 3 (most important): ''speed'', ''space'', ''safety'', ''debug'' and ''compilation-speed''.<br /> <br /> There is also a function to evaluate Lisp code: ''eval''. ''eval'' takes code as pre-parsed s-expressions and not, like in some other languages, as text strings. This way code can be constructed with the usual Lisp functions for constructing lists and symbols and then this code can be evaluated with ''eval''. Several Common Lisp implementations (like Clozure CL and SBCL) are implementing ''eval'' using their compiler. This way code is compiled, even though it is evaluated using the function ''eval''.<br /> <br /> The file compiler is invoked using the function ''compile-file''. The generated file with compiled code is called a ''fasl'' (from ''fast load'') file. These ''fasl'' files and also source code files can be loaded with the function ''load'' into a running Common Lisp system. Depending on the implementation, the file compiler generates byte-code (for example for the [[Java Virtual Machine]]), [[C (programming language)|C language]] code (which then is compiled with a C compiler) or, directly, native code.<br /> <br /> Common Lisp implementations can be used interactively, even though the code gets fully compiled. The idea of an [[Interpreted language]] thus does not apply for interactive Common Lisp.<br /> <br /> The language makes distinction between read-time, compile-time, load-time and run-time, and allows user code to also make this distinction to perform the wanted type of processing at the wanted step.<br /> <br /> Some special operators are provided to especially suit interactive development; for instance, &lt;code&gt;defvar&lt;/code&gt; will only assign a value to its provided variable if it wasn't already bound, while &lt;code&gt;defparameter&lt;/code&gt; will always perform the assignment. This distinction is useful when interactively evaluating, compiling and loading code in a live image.<br /> <br /> Some features are also provided to help writing compilers and interpreters. Symbols consist of first-level objects and are directly manipulable by user code. The &lt;code&gt;progv&lt;/code&gt; special operator allows to create lexical bindings programmatically, while packages are also manipulable. The Lisp compiler itself is available at runtime to compile files or individual functions. These make it easy to use Lisp as an intermediate compiler or interpreter for another language.<br /> <br /> ==Code examples==<br /> <br /> ===Birthday paradox===<br /> The following program calculates the smallest number of people in a room for whom the probability of completely unique birthdays is less than 50% (the [[birthday paradox]], where for 1 person the probability is obviously 100%, for 2 it is 364/365, etc.). The Answer is 23.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; By convention, constants in Common Lisp are enclosed with + characters.<br /> (defconstant +year-size+ 365)<br /> <br /> (defun birthday-paradox (probability number-of-people)<br /> (let ((new-probability (* (/ (- +year-size+ number-of-people)<br /> +year-size+)<br /> probability)))<br /> (if (&lt; new-probability 0.5)<br /> (1+ number-of-people)<br /> (birthday-paradox new-probability (1+ number-of-people)))))<br /> &lt;/source&gt;<br /> <br /> Calling the example function using the [[REPL]] (Read Eval Print Loop):<br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (birthday-paradox 1.0 1)<br /> 23<br /> &lt;/source&gt;<br /> <br /> ===Sorting a list of person objects===<br /> <br /> We define a class &lt;code&gt;person&lt;/code&gt; and a method for displaying the name and age of a person.<br /> Next we define a group of persons as a list of PERSON objects.<br /> Then we iterate over the sorted list.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defclass person ()<br /> ((name :initarg :name :reader person-name)<br /> (age :initarg :age :reader person-age))<br /> (:documentation &quot;The class PERSON with slots NAME and AGE.&quot;))<br /> <br /> (defmethod print-object ((object person) stream)<br /> &quot;Displaying a PERSON object to an output stream.&quot;<br /> (print-unreadable-object (object stream :type t)<br /> (format stream &quot;~a (~a)&quot; (person-name object) (person-age object))))<br /> <br /> (defparameter *group*<br /> (list (make-instance 'person :name &quot;Bob&quot; :age 33)<br /> (make-instance 'person :name &quot;Chris&quot; :age 16)<br /> (make-instance 'person :name &quot;Ash&quot; :age 23))<br /> &quot;A list of PERSON objects.&quot;)<br /> <br /> (dolist (person (sort (copy-list *group*)<br /> #'&gt;<br /> :key #'person-age))<br /> (print person))<br /> &lt;/source&gt;<br /> <br /> It prints the three names with descending age.<br /> &lt;source lang=&quot;text&quot;&gt;<br /> #&lt;PERSON Bob (33)&gt; <br /> #&lt;PERSON Ash (23)&gt; <br /> #&lt;PERSON Chris (16)&gt; <br /> &lt;/source&gt;<br /> <br /> ===Exponentiating by squaring===<br /> <br /> Use of the LOOP macro is demonstrated:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun power (x n)<br /> (loop with result = 1<br /> while (plusp n)<br /> when (oddp n) do (setf result (* result x))<br /> do (setf x (* x x)<br /> n (truncate n 2))<br /> finally (return result)))<br /> &lt;/source&gt;<br /> <br /> Example use:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (power 2 200)<br /> 1606938044258990275541962092341162602522202993782792835301376<br /> &lt;/source&gt;<br /> <br /> Compare with the built in exponentiation:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (= (expt 2 200) (power 2 200))<br /> T<br /> &lt;/source&gt;<br /> <br /> ===Find the list of available shells===<br /> <br /> WITH-OPEN-FILE is a macro that opens a file and provides a stream. When the form is returning, the file is automatically closed. FUNCALL calls a function object. The LOOP collects all lines that match the predicate.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun list-matching-lines (file predicate)<br /> &quot;Returns a list of lines in file, for which the predicate applied to<br /> the line returns T.&quot;<br /> (with-open-file (stream file)<br /> (loop for line = (read-line stream nil nil)<br /> while line<br /> when (funcall predicate line)<br /> collect it)))<br /> &lt;/source&gt;<br /> <br /> The function AVAILABLE-SHELLS calls above function LIST-MATCHING-LINES with a pathname and an anonymous function as the predicate. The predicate returns the pathname of a shell or NIL (if the string is not the filename of a shell).<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun available-shells (&amp;optional (file #p&quot;/etc/shells&quot;))<br /> (list-matching-lines<br /> file<br /> (lambda (line)<br /> (and (plusp (length line))<br /> (char= (char line 0) #\/)<br /> (pathname<br /> (string-right-trim '(#\space #\tab) line))))))<br /> &lt;/source&gt;<br /> <br /> Example results (on Mac OS X 10.6):<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> CL-USER &gt; (available-shells)<br /> (#P&quot;/bin/bash&quot; #P&quot;/bin/csh&quot; #P&quot;/bin/ksh&quot; #P&quot;/bin/sh&quot; #P&quot;/bin/tcsh&quot; #P&quot;/bin/zsh&quot;)<br /> &lt;/source&gt;<br /> <br /> ==Comparison with other Lisps==<br /> &lt;!-- needs lots --&gt;<br /> Common Lisp is most frequently compared with, and contrasted to, [[Scheme (programming language)|Scheme]]—if only because they are the two most popular Lisp dialects. Scheme predates CL, and comes not only from the same Lisp tradition but from some of the same engineers—[[Guy L. Steele, Jr.|Guy L. Steele]], with whom [[Gerald Jay Sussman]] designed Scheme, chaired the standards committee for Common Lisp.<br /> <br /> Common Lisp is a general-purpose programming language, in contrast to Lisp variants such as [[Emacs Lisp]] and [[AutoLISP]] which are [[extension languages]] embedded in particular products. Unlike many earlier Lisps, Common Lisp (like [[Scheme (programming language)|Scheme]]) uses lexical variable [[scope (programming)|scope]] by default for both interpreted and compiled code.<br /> <br /> Most of the Lisp systems whose designs contributed to Common Lisp—such as [[ZetaLisp]] and Franz Lisp—used dynamically [[scope (programming)|scoped]] variables in their interpreters and lexically scoped variables in their compilers. Scheme introduced the sole use of lexically scoped variables to Lisp; an inspiration from [[ALGOL 68]] which was widely recognized as a good idea. CL supports dynamically scoped variables as well, but they must be explicitly declared as &quot;special&quot;. There are no differences in scoping between ANSI CL interpreters and compilers.<br /> <br /> Common Lisp is sometimes termed a ''Lisp-2'' and Scheme a ''Lisp-1'', referring to CL's use of separate namespaces for functions and variables. (In fact, CL has ''many'' namespaces, such as those for go tags, block names, and &lt;code&gt;loop&lt;/code&gt; keywords). There is a long-standing controversy between CL and Scheme advocates over the tradeoffs involved in multiple namespaces. In Scheme, it is (broadly) necessary to avoid giving variables names which clash with functions; Scheme functions frequently have arguments named &lt;code&gt;lis&lt;/code&gt;, &lt;code&gt;lst&lt;/code&gt;, or &lt;code&gt;lyst&lt;/code&gt; so as not to conflict with the system function &lt;code&gt;list&lt;/code&gt;. However, in CL it is necessary to explicitly refer to the function namespace when passing a function as an argument—which is also a common occurrence, as in the &lt;code&gt;sort&lt;/code&gt; example above.<br /> <br /> CL also differs from Scheme in its handling of boolean values. Scheme uses the special values #t and #f to represent truth and falsity. CL follows the older Lisp convention of using the symbols T and NIL, with NIL standing also for the empty list. In CL, ''any'' non-NIL value is treated as true by conditionals, such as &lt;code&gt;if&lt;/code&gt;, whereas in Scheme all non-#f values are treated as true. These conventions allow some operators in both languages to serve both as predicates (answering a boolean-valued question) and as returning a useful value for further computation, but in Scheme the value '() which is equivalent to NIL in Common Lisp evaluates to true in a boolean expression.<br /> <br /> Lastly, the Scheme standards documents require [[tail recursion|tail-call optimization]], which the CL standard does not. Most CL implementations do offer tail-call optimization, although often only when the programmer uses an optimization directive. Nonetheless, common CL coding style does not favor the ubiquitous use of recursion that Scheme style prefers—what a Scheme programmer would express with tail recursion, a CL user would usually express with an iterative expression in &lt;code&gt;do&lt;/code&gt;, &lt;code&gt;dolist&lt;/code&gt;, &lt;code&gt;loop&lt;/code&gt;, or (more recently) with the &lt;code&gt;iterate&lt;/code&gt; package.<br /> <br /> ==Implementations==<br /> <br /> See the Category [[:Category:Common Lisp implementations|Common Lisp implementations]].<br /> <br /> Common Lisp is defined by a specification (like [[Ada (programming language)|Ada]] and [[C (programming language)|C]]) rather than by one implementation (like [[Perl]] before version 6). There are many implementations, and the standard details areas in which they may validly differ.<br /> <br /> In addition, implementations tend to come with library packages, which provide functionality not covered in the standard. [[Free and open source software]] libraries have been created to support such features in a portable way, and are most notably found in the repositories of the [http://common-lisp.net/ Common-Lisp.net] and [http://clocc.sourceforge.net/ Common Lisp Open Code Collection] projects.<br /> <br /> Common Lisp implementations may use any mix of native code compilation, byte code compilation or interpretation. Common Lisp has been designed to support [[incremental compiler]]s, file compilers and block compilers. Standard declarations to optimize compilation (such as function inlining or type specialization) are proposed in the language specification. Most Common Lisp implementations compile source code to native [[machine code]]. Some implementations can create (optimized) stand-alone applications. Others compile to interpreted [[bytecode]], which is less efficient than native code, but eases binary-code portability. There are also compilers that compile Common Lisp code to C code. The misconception that Lisp is a purely interpreted language is most likely because Lisp environments provide an interactive prompt and that code is compiled one-by-one, in an incremental way. With Common Lisp incremental compilation is widely used.<br /> <br /> Some [[Unix]]-based implementations ([[CLISP]], [[SBCL]]) can be used as a [[scripting language]]; that is, invoked by the system transparently in the way that a [[Perl]] or [[Unix shell]] interpreter is.&lt;ref&gt;[http://clisp.cons.org/impnotes/quickstart.html#quickstart-unix CLISP as a scripting language under Unix]&lt;/ref&gt;<br /> <br /> ===List of implementations===<br /> <br /> ====Commercial implementations====<br /> <br /> ; [[Allegro Common Lisp]]: for Microsoft Windows, FreeBSD, Linux, Apple Mac OS X and various UNIX variants. Allegro CL provides an [[integrated development environment|Integrated Development Environment (IDE)]] (for Windows and Linux) and extensive capabilities for application delivery.<br /> ; [[Liquid Common Lisp]]: formerly called [[Lucid Common Lisp]]. Only maintenance, no new releases.<br /> ; [[LispWorks]]: for Microsoft Windows, FreeBSD, Linux, Apple Mac OS X and various UNIX variants. LispWorks provides an [[integrated development environment|Integrated Development Environment (IDE)]] (available for all platforms) and extensive capabilities for application delivery.<br /> ; [[mocl]]: for iOS, Android and Mac OS X.<br /> ; [[Open Genera]]: for DEC Alpha.<br /> ; [[Scieneer Common Lisp]]: which is designed for high-performance scientific computing.<br /> <br /> ====Freely redistributable implementations====<br /> <br /> ; Armed Bear Common Lisp (ABCL) : A CL implementation that runs on the [[Java Virtual Machine]].&lt;ref&gt;{{cite web | url = http://common-lisp.net/project/armedbear/ | title = Armed Bear Common Lisp }}&lt;/ref&gt; It includes a compiler to [[Java byte code]], and allows access to Java libraries from CL. It was formerly just a component of the [[Armed Bear J Editor]].<br /> ; [[CLISP]]: A bytecode-compiling implementation, portable and runs on a number of Unix and Unix-like systems (including [[Mac OS X]]), as well as Microsoft Windows and several other systems.<br /> ; [[Clozure CL]] (CCL) : Originally a [[free and open source software|free and open source]] fork of Macintosh Common Lisp. As that history implies, CCL was written for the Macintosh, but Clozure CL now runs on [[Mac OS X]], [[FreeBSD]], [[Linux]], [[Solaris (operating system)|Solaris]] and [[Microsoft Windows|Windows]]. 32 and 64 bit [[x86]] ports are supported on each platform. Additionally there are Power PC ports for Mac OS and Linux. CCL was previously known as OpenMCL, but that name is no longer used, to avoid confusion with the open source version of Macintosh Common Lisp.<br /> ; [[CMUCL]]: Originally from [[Carnegie Mellon University]], now maintained as [[free and open source software]] by a group of volunteers. CMUCL uses a fast native-code compiler. It is available on [[Linux]] and [[Berkeley Software Distribution|BSD]] for Intel x86; [[Linux]] for Alpha; [[Mac OS X]] for Intel x86 and PowerPC; and Solaris, IRIX, and HP-UX on their native platforms.<br /> ; [[Corman Common Lisp]]: for Microsoft Windows. In January 2015 Corman Lisp has been published under MIT license.&lt;ref&gt;{{cite web|title=Corman Lisp sources are now available|url=http://lispblog.xach.com/post/107215169193/corman-lisp-sources-are-now-available}}&lt;/ref&gt;<br /> ; [[Embeddable Common Lisp]] (ECL) : ECL includes a bytecode interpreter and compiler. It can also compile Lisp code to machine code via a C compiler. ECL then compiles Lisp code to C, compiles the C code with a C compiler and can then load the resulting machine code. It is also possible to embed ECL in [[C (programming language)|C]] programs, and C code into Common Lisp programs.<br /> ; [[GNU Common Lisp]] (GCL) : The [[GNU]] Project's Lisp compiler. Not yet fully ANSI-compliant, GCL is however the implementation of choice for several large projects including the mathematical tools [[Maxima (software)|Maxima]], [[Axiom (computer algebra system)|AXIOM]] and (historically) [[ACL2]]. GCL runs on [[Linux]] under eleven different architectures, and also under Windows, Solaris, and [[FreeBSD]].<br /> ; [[Macintosh Common Lisp]] (MCL) : Version 5.2 for Apple Macintosh computers with a PowerPC processor running Mac OS X is open source. RMCL (based on MCL 5.2) runs on Intel-based Apple Macintosh computers using the Rosetta binary translator from Apple.<br /> ; [[ManKai Common Lisp]] (MKCL) : A branch of [[Embeddable Common Lisp|ECL]]. MKCL emphasises reliability, stability and overall code quality through a heavily reworked, natively multi-threaded, runtime system. On Linux, MKCL features a fully POSIX compliant runtime system.<br /> ; [[Movitz]]: Implements a Lisp environment for [[x86]] computers without relying on any underlying OS.<br /> ; [[Poplog]]: Poplog implements a version of CL, with [[POP-11]], and optionally [[Prolog]], and [[Standard ML]] (SML), allowing mixed language programming. For all, the implementation language is POP-11, which is compiled incrementally. It also has an integrated [[Emacs]]-like editor that communicates with the compiler.<br /> ; [[Steel Bank Common Lisp]] (SBCL) : A branch from [[CMUCL]]. &quot;Broadly speaking, SBCL is distinguished from CMU CL by a greater emphasis on maintainability.&quot;&lt;ref&gt;{{cite web<br /> | url = http://sbcl.sourceforge.net/history.html<br /> | title = History and Copyright | work = Steel Bank Common Lisp<br /> }}&lt;/ref&gt; SBCL runs on the platforms CMUCL does, except HP/UX; in addition, it runs on Linux for AMD64, PowerPC, SPARC, MIPS, Windows x86&lt;ref&gt;{{cite web<br /> | url = http://www.sbcl.org/platform-table.html<br /> | title = Platform Table | work = Steel Bank Common Lisp<br /> }}&lt;/ref&gt; and has experimental support for running on Windows AMD64. SBCL does not use an interpreter by default; all expressions are compiled to native code unless the user switches the interpreter on. The SBCL compiler generates fast native code.&lt;ref&gt;[http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?test=all&amp;lang=all SBCL ranks above other dynamic language implementations in the 'Computer Language Benchmark Game']&lt;/ref&gt;<br /> ; [[Ufasoft Common Lisp]]: port of CLISP for windows platform with core written in C++.<br /> <br /> ====Other implementations====<br /> {{unreferenced section|date=July 2013}}<br /> ; Austin Kyoto Common Lisp : an evolution of [[Kyoto Common Lisp]]<br /> ; Butterfly Common Lisp : an implementation written in Scheme for the [[BBN Butterfly]] multi-processor computer<br /> ; CLICC : a Common Lisp to C compiler<br /> ; CLOE : Common Lisp for PCs by [[Symbolics]]<br /> ; Codemist Common Lisp : used for the commercial version of the computer algebra system Axiom<br /> ; ExperCommon Lisp : an early implementation for the Apple Macintosh by ExperTelligence<br /> ; [[Golden Common Lisp]]: an implementation for the PC by GoldHill Inc.<br /> ; Ibuki Common Lisp : a commercialized version of Kyoto Common Lisp<br /> ; [[Kyoto Common Lisp]]: the first Common Lisp compiler that used C as a target language. GCL, ECL and MKCL originate from this Common Lisp implementation.<br /> ; L : a small version of Common Lisp for embedded systems developed by IS Robotics, now iRobot<br /> ; [[Lisp Machine]]s (from [[Symbolics]], TI and Xerox): provided implementations of Common Lisp in addition to their native Lisp dialect (Lisp Machine Lisp or Interlisp). CLOS was also available. Symbolics provides a version of Common Lisp that is based on ANSI Common Lisp.<br /> ; Procyon Common Lisp : an implementation for Windows and Mac OS, used by Franz for their Windows port of Allegro CL<br /> ; Star Sapphire Common LISP : an implementation for the PC<br /> ; [[SubL]]: a variant of Common Lisp used for the implementation of the [[Cyc]] knowledge-based system<br /> ; Top Level Common Lisp : an early implementation for concurrent execution<br /> ; WCL : a shared library implementation<br /> ; [[Vax Common Lisp]]: [[Digital Equipment Corporation]]'s implementation that ran on [[VAX]] systems running [[OpenVMS|VMS]] or [[ULTRIX]]<br /> ; [[XLISP]] by David Betz<br /> <br /> ==Applications==<br /> See the Category [[:Category:Common Lisp software|Common Lisp software]].<br /> <br /> Common Lisp is used to develop research applications (often in Artificial Intelligence), for rapid development of prototypes or for deployed applications.<br /> <br /> Common Lisp is used in many commercial applications, including the [[Yahoo!]] Store web-commerce site, which originally involved [[Paul Graham (computer programmer)|Paul Graham]] and was later rewritten in C++ and Perl.&lt;ref name=&quot;doubt-not-corporate-foolishness&quot;&gt;&quot;In January 2003, Yahoo released a new version of the editor written in C++ and Perl. It's hard to say whether the program is no longer written in Lisp, though, because to translate this program into C++ they literally had to write a Lisp interpreter: the source files of all the page-generating templates are still, as far as I know, Lisp code.&quot; [[Paul Graham (computer programmer)|Paul Graham]], [http://www.paulgraham.com/avg.html Beating the Averages]&lt;/ref&gt; Other notable examples include:<br /> <br /> * [[ACT-R]], a cognitive architecture used in a large number of research projects.<br /> * Authorizer's Assistant,&lt;ref&gt;[http://www.aaai.org/Papers/IAAI/1989/IAAI89-031.pdf Authorizer's Assistant]&lt;/ref&gt;&lt;ref&gt;[http://www.prenhall.com/divisions/bp/app/alter/student/useful/ch9amex.html American Express Authorizer's Assistant]&lt;/ref&gt; a large rule-based system used by American Express, analyzing credit requests.<br /> * [[Cyc]], a long running project with the aim to create a knowledge-based system that provides a huge amount of common sense knowledge<br /> * The [[Dynamic Analysis and Replanning Tool]] (DART), which is said to alone have paid back during the years from 1991 to 1995 for all thirty years of [[DARPA]] investments in AI research.<br /> * G2 from Gensym, a real-time business rules engine (BRE)&lt;ref&gt;[http://www.gensym.com/index.php?option=com_content&amp;view=article&amp;id=47&amp;Itemid=54 Real-time Application Development]. Gensym. Retrieved on 2013-07-17.&lt;/ref&gt;<br /> * [http://www.genworks.com Genworks GDL], based on the open-source [http://github.com/genworks/gendl Gendl] kernel.<br /> * The development environment for the [[Jak and Daxter]] video game series, developed by [[Naughty Dog]].<br /> * [[ITA Software]]'s low fare search engine, used by travel websites such as [[Orbitz]] and [[Kayak.com]] and airlines such as [[American Airlines]], [[Continental Airlines]] and [[US Airways]].<br /> * [[Mirai (software)|Mirai]], a 3d graphics suite. It was used to animate the face of Gollum in the movie Lord of the Rings: The Two Towers.<br /> * [[Prototype Verification System]] (PVS), a mechanized environment for formal specification and verification.<br /> * PWGL is a sophisticated visual programming environment based on Common Lisp, used in [[Computer assisted composition]] and sound synthesis.&lt;ref&gt;[http://www2.siba.fi/PWGL/ PWGL - Home]. . Retrieved on 2013-07-17.&lt;/ref&gt; <br /> * SPIKE, a scheduling system for earth or space based observatories and satellites, notably the Hubble Space Telescope.&lt;ref&gt;[http://www.stsci.edu/resources/software_hardware/spike/ Spike Planning and Scheduling System]. Stsci.edu. Retrieved on 2013-07-17.&lt;/ref&gt;<br /> <br /> There also exist open-source applications written in Common Lisp, such as:<br /> <br /> * [[ACL2]], a full-featured [[automated theorem prover]] for an [[applicative programming language|applicative]] variant of Common Lisp.<br /> * [[Axiom (computer algebra system)|Axiom]], a sophisticated [[computer algebra system]].<br /> * [[Maxima (software)|Maxima]], a sophisticated [[computer algebra system]].<br /> * [[OpenMusic]] is an object-oriented visual programming environment based on Common Lisp, used in [[Computer assisted composition]].<br /> * [[Stumpwm]], a tiling, keyboard driven X11 Window Manager written entirely in Common Lisp.<br /> <br /> ==Libraries==<br /> <br /> Since 2011 Zach Beane, with support of the Common Lisp Foundation, maintains the [[Quicklisp]] library manager. It allows easy access to several hundred libraries written in Common Lisp.<br /> <br /> ==See also==<br /> {{Portal|Computer Science|Computer programming}}<br /> *''[[Common Lisp the Language]]''<br /> *''[[On Lisp]]''<br /> *''[[Practical Common Lisp]]''<br /> {{Clear}}<br /> <br /> ==References==<br /> {{Reflist|2}}<br /> <br /> ==Bibliography==<br /> A chronological list of books published (or about to be published) about Common Lisp (the language) or about programming with Common Lisp (especially AI programming).<br /> {{Refbegin|2}}<br /> * [[Guy L. Steele]]: ''Common Lisp the Language, 1st Edition'', Digital Press, 1984, ISBN 0-932376-41-X<br /> * [[Rodney Allen Brooks]]: ''Programming in Common Lisp'', John Wiley and Sons Inc, 1985, ISBN 0-471-81888-7<br /> * [[Richard P. Gabriel]]: ''Performance and Evaluation of Lisp Systems'', The MIT Press, 1985, ISBN 0-262-57193-5, [http://www.dreamsongs.com/Files/Timrep.pdf PDF]<br /> * [[Robert Wilensky]]: ''Common LISPcraft'', W.W. Norton &amp; Co., 1986, ISBN 0-393-95544-3<br /> * [[Eugene Charniak]], [[Christopher K. Riesbeck]], [[Drew V. McDermott]], [[James R. Meehan]]: ''Artificial Intelligence Programming, 2nd Edition'', Lawrence Erlbaum, 1987, ISBN 0-89859-609-2<br /> * [[Wendy L. Milner]]: ''Common Lisp: A Tutorial'', Prentice Hall, 1987, ISBN 0-13-152844-0<br /> * [[Deborah G. Tatar]]: ''A Programmer's Guide to Common Lisp'', Longman Higher Education, 1987, ISBN 0-13-728940-5<br /> * [[Taiichi Yuasa]], [[Masami Hagiya]]: ''Introduction to Common Lisp'', Elsevier Ltd, 1987, ISBN 0-12-774860-1<br /> * [[Christian Queinnec]], [[Jerome Chailloux]]: ''Lisp Evolution and Standardization'', Ios Pr Inc., 1988, ISBN 90-5199-008-1<br /> * [[Taiichi Yuasa]], [[Richard Weyhrauch]], [[Yasuko Kitajima]]: ''Common Lisp Drill'', Academic Press Inc, 1988, ISBN 0-12-774861-X<br /> * [[Wade L. Hennessey]]: ''Common Lisp'', McGraw-Hill Inc., 1989, ISBN 0-07-028177-7<br /> * [[Tony Hasemer]], [[John Dominque]]: ''Common Lisp Programming for Artificial Intelligence'', Addison-Wesley Educational Publishers Inc, 1989, ISBN 0-201-17579-7<br /> * [[Sonya E. Keene]]: ''Object-Oriented Programming in Common Lisp: A Programmer's Guide to CLOS'', Addison-Wesley, 1989, ISBN 0-201-17589-4<br /> * [[David Jay Steele]]: ''Golden Common Lisp: A Hands-On Approach'', Addison Wesley, 1989, ISBN 0-201-41653-0<br /> * [[David S. Touretzky]]: ''Common Lisp: A Gentle Introduction to Symbolic Computation'', Benjamin-Cummings, 1989, ISBN 0-8053-0492-4. [http://www.cs.cmu.edu/~dst/LispBook/ Web/PDF] Dover reprint (2013) ISBN 978-0486498201<br /> * [[Christopher K. Riesbeck]], [[Roger C. Schank]]: ''Inside Case-Based Reasoning'', Lawrence Erlbaum, 1989, ISBN 0-89859-767-6<br /> * [[Patrick Winston]], [[Berthold Horn]]: ''Lisp, 3rd Edition'', Addison-Wesley, 1989, ISBN 0-201-08319-1, [http://people.csail.mit.edu/phw/Books/LISPBACK.HTML Web]<br /> * [[Gerard Gazdar]], [[Chris Mellish]]: ''Natural Language Processing in LISP: An Introduction to Computational Linguistics'', Addison-Wesley Longman Publishing Co., 1990, ISBN 0-201-17825-7<br /> * [[Patrick R. Harrison]]: ''Common Lisp and Artificial Intelligence'', Prentice Hall PTR, 1990, ISBN 0-13-155243-0<br /> * [[Timothy Koschmann]]: ''The Common Lisp Companion'', John Wiley &amp; Sons, 1990, ISBN 0-471-50308-8<br /> * [[Molly M. Miller]], [[Eric Benson]]: ''Lisp Style &amp; Design'', Digital Press, 1990, ISBN 1-55558-044-0<br /> * [[Guy L. Steele]]: ''[[Common Lisp the Language]], 2nd Edition'', Digital Press, 1990, ISBN 1-55558-041-6, [http://www.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html Web]<br /> * [[Steven L. Tanimoto]]: ''The Elements of Artificial Intelligence Using Common Lisp'', Computer Science Press, 1990, ISBN 0-7167-8230-8<br /> * [[Peter Lee (computer scientist)|Peter Lee]]: ''Topics in Advanced Language Implementation'', The MIT Press, 1991, ISBN 0-262-12151-4<br /> * [[John H. Riley]]: ''A Common Lisp Workbook'', Prentice Hall, 1991, ISBN 0-13-155797-1<br /> * [[Peter Norvig]]: ''Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp'', Morgan Kaufmann, 1991, ISBN 1-55860-191-0, [http://norvig.com/paip.html Web]<br /> * [[Gregor Kiczales]], [[Jim des Rivieres]], [[Daniel G. Bobrow]]: ''The Art of the Metaobject Protocol'', The MIT Press, 1991, ISBN 0-262-61074-4<br /> * [[Jo A. Lawless]], [[Molly M. Miller]]: ''Understanding CLOS: The Common Lisp Object System'', Digital Press, 1991, ISBN 0-13-717232-X<br /> * Mark Watson: ''Common Lisp Modules: Artificial Intelligence in the Era of Neural Networks and Chaos Theory'', Springer Verlag New York Inc., 1991, ISBN 0-387-97614-0<br /> * [[James L. Noyes]]: ''Artificial Intelligence with Common Lisp: Fundamentals of Symbolic and Numeric Processing'', Jones &amp; Bartlett Pub, 1992, ISBN 0-669-19473-5<br /> * [[Stuart C. Shapiro]]: ''COMMON LISP: An Interactive Approach'', Computer Science Press, 1992, ISBN 0-7167-8218-9, [http://www.cse.buffalo.edu/pub/WWW/faculty/shapiro/Commonlisp/ Web/PDF]<br /> * [[Kenneth D. Forbus]], [[Johan de Kleer]]: ''Building Problem Solvers'', The MIT Press, 1993, ISBN 0-262-06157-0<br /> * [[Andreas Paepcke]]: ''Object-Oriented Programming: The CLOS Perspective'', The MIT Press, 1993, ISBN 0-262-16136-2<br /> * [[Paul Graham (computer programmer)|Paul Graham]]: ''[[On Lisp]]'', Prentice Hall, 1993, ISBN 0-13-030552-9, [http://www.paulgraham.com/onlisp.html Web/PDF]<br /> * [[Paul Graham (computer programmer)|Paul Graham]]: ''ANSI Common Lisp'', Prentice Hall, 1995, ISBN 0-13-370875-6<br /> * [[Otto Mayer]]: ''Programmieren in Common Lisp'', German, Spektrum Akademischer Verlag, 1995, ISBN 3-86025-710-2<br /> * [[Stephen Slade]]: ''Object-Oriented Common Lisp'', Prentice Hall, 1997, ISBN 0-13-605940-6<br /> * [[Richard P. Gabriel]]: ''Patterns of Software: Tales from the Software Community'', Oxford University Press, 1998, ISBN 0-19-512123-6, [http://www.dreamsongs.org/Files/PatternsOfSoftware.pdf PDF]<br /> * [[Taiichi Yuasa]], [[Hiroshi G. Okuno]]: ''Advanced Lisp Technology'', CRC, 2002, ISBN 0-415-29819-9<br /> * [[David B. Lamkins]]: ''Successful Lisp: How to Understand and Use Common Lisp'', bookfix.com, 2004. ISBN 3-937526-00-5, [http://www.psg.com/~dlamkins/sl/contents.html Web]<br /> * [[Peter Seibel]]: ''[[Practical Common Lisp]]'', Apress, 2005. ISBN 1-59059-239-5, [http://www.gigamonkeys.com/book/ Web]<br /> * [[Doug Hoyte]]: ''Let Over Lambda'', Lulu.com, 2008, ISBN 1-4357-1275-7, [http://letoverlambda.com/ Web]<br /> * [[George F. Luger]], [[William A. Stubblefield]]: ''AI Algorithms, Data Structures, and Idioms in Prolog, Lisp and Java'', Addison Wesley, 2008, ISBN 0-13-607047-7, [http://wps.aw.com/wps/media/objects/5771/5909832/PDF/Luger_0136070477_1.pdf PDF]<br /> * [[Conrad Barski]]: ''Land of Lisp: Learn to program in Lisp, one game at a time!'', No Starch Press, 2010, ISBN 1-59327-200-6, [http://www.lisperati.com/landoflisp/ Web]<br /> * [[Pavel Penev]]: ''Lisp Web Tales'', Leanpub, 2013, [https://leanpub.com/lispwebtales Web]<br /> {{Refend}}<br /> <br /> ==External links==<br /> {{Wikibooks}}<br /> * The [http://www.cliki.net/ CLiki], a Wiki for [[free and open source software|free and open source]] Common Lisp systems running on Unix-like systems.<br /> * [http://www.common-lisp.net/ Common Lisp software repository].<br /> * {{cite web | url = http://www.lispworks.com/documentation/HyperSpec/Body/01_ab.htm | title = History | work = [[Common Lisp HyperSpec]] }}<br /> * [http://www.flownet.com/gat/jpl-lisp.html Lisping at JPL]<br /> * [http://www.defmacro.org/ramblings/lisp.html The Nature of Lisp] Essay that examines Lisp by comparison with XML.<br /> * [http://common-lisp.net/~dlw/LispSurvey.html Common Lisp Implementations: A Survey] Survey of maintained Common Lisp implementations.<br /> * [http://clqr.boundp.org Common Lisp Quick Reference]<br /> * [http://planet.lisp.org Planet Lisp] Articles about Common Lisp.<br /> <br /> {{Common Lisp}}<br /> <br /> [[Category:Common Lisp]]<br /> [[Category:Multi-paradigm programming languages]]<br /> [[Category:Functional languages]]<br /> [[Category:Dynamically typed programming languages]]<br /> [[Category:Dynamic programming languages]]<br /> [[Category:Object-oriented programming languages]]<br /> [[Category:Class-based programming languages]]<br /> [[Category:Procedural programming languages]]<br /> [[Category:Extensible syntax programming languages]]<br /> [[Category:Lisp programming language family]]<br /> [[Category:Lisp (programming language)]]<br /> [[Category:Articles with example Lisp code]]<br /> [[Category:Cross-platform software]]<br /> [[Category:Cross-platform free software]]<br /> [[Category:Programming languages created in 1984]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Common_Lisp&diff=689834551 Common Lisp 2015-11-09T18:12:31Z <p>PuercoPop: /* Sorting a list of person objects */ Use print-object instead of ad-hoc method display.</p> <hr /> <div>{{Infobox programming language<br /> | name = Common Lisp<br /> | family = [[Lisp (programming language)|Lisp]]<br /> | paradigm = [[Multi-paradigm programming language|Multi-paradigm]]: [[procedural programming|procedural]], [[functional programming|functional]], [[object-oriented programming|object-oriented]], [[metaprogramming|meta]], [[reflective programming|reflective]], [[generic programming|generic]]<br /> | generation = [[3GL]]<br /> | released = 1984, 1994 for ANSI Common Lisp<br /> | designer = [[Scott Fahlman]], [[Richard P. Gabriel]], [[Dave Moon]], [[Guy Steele]], [[Dan Weinreb]]<br /> | developer = ANSI [[X3J13]] committee<br /> | standard reference = [[Common Lisp HyperSpec]]<br /> | latest release version =<br /> | latest release date =<br /> | typing = [[Dynamic typing|dynamic]], [[Strongly-typed programming language|strong]]<br /> | scope = lexical, optionally dynamic<br /> | namespace style = Lisp-2<br /> | implementations = [[Allegro Common Lisp|Allegro CL]], [[Armed Bear Common Lisp|ABCL]], [[CLISP]], [[Clozure CL]], [[CMUCL]], [[Embeddable Common Lisp|ECL]], [[GNU Common Lisp|GCL]], [[LispWorks]], [[Scieneer Common Lisp|Scieneer CL]], [[SBCL]], [[Genera (operating system)|Symbolics Common Lisp]]<br /> | dialects = CLtL1, CLtL2, ANSI Common Lisp<br /> | influenced_by = [[Lisp (programming language)|Lisp]], [[Lisp Machine Lisp]], [[Maclisp]], [[Scheme (programming language)|Scheme]], [[Interlisp]]<br /> | influenced = [[Clojure]], [[Dylan (programming language)|Dylan]], [[Emacs Lisp]], [[EuLisp]], [[ISLISP]], [[Julia (programming language)|Julia]], [[Moose (Perl)|Moose]], [[R (programming language)|R]], [[Cadence SKILL|SKILL]], [[SubL]]<br /> | operating_system = [[Cross-platform]]<br /> | license =<br /> | website = {{URL|http://common-lisp.net/}}<br /> | file_ext = .lisp, .lsp, .l, .cl, .fasl<br /> }}<br /> <br /> '''Common Lisp''' ('''CL''') is a dialect of the [[Lisp (programming language)|Lisp]] [[programming language]], published in [[American National Standards Institute|ANSI]] standard document ''ANSI INCITS 226-1994 (R2004)'' (formerly ''X3.226-1994 (R1999)'').&lt;ref&gt;Quoted from cover of cited standard. ANSI INCITS 226-1994 (R2004), for sale on standard's [http://webstore.ansi.org/RecordDetail.aspx?sku=ANSI+INCITS+226-1994+(R2004) document page].&lt;/ref&gt; From the ANSI Common Lisp standard the [[Common Lisp HyperSpec]], a hyperlinked HTML version, has been derived.&lt;ref&gt;[http://www.lispworks.com/documentation/HyperSpec/Front/Help.htm#Authorship Authorship of the Common Lisp HyperSpec]&lt;/ref&gt;<br /> <br /> The Common Lisp language was developed as a standardized and improved successor of [[Maclisp]]. Thus it is not an implementation, but rather a language [[specification]].&lt;ref&gt;[http://www.lispworks.com/documentation/HyperSpec/Body/01_ab.htm Common Lisp HyperSpec 1.1.2 History]&lt;/ref&gt; Several [[#Implementations|implementations]] of the Common Lisp standard are available, including [[free and open source software]] and proprietary products.&lt;ref&gt;[http://common-lisp.net/~dlw/LispSurvey.html Common Lisp Implementations: A Survey]&lt;/ref&gt;<br /> <br /> The first language documentation was published 1984 as [[Common Lisp the Language]], first edition. A second edition, published in 1990, incorporated many changes to the language, made during the ANSI Common Lisp standardization process. The final ANSI Common Lisp standard then was published in 1994. Since then no update to the standard has been published. Various extensions and improvements to Common Lisp (examples are Unicode, Concurrency, CLOS-based IO) have been provided by implementations.<br /> <br /> Common Lisp is a general-purpose, [[multi-paradigm programming language]]. It supports a combination of [[procedural programming|procedural]], [[functional programming|functional]], and [[object-oriented programming]] paradigms. As a [[dynamic programming language]], it facilitates evolutionary and [[Iterative and incremental development|incremental software development]], with iterative [[Compiler|compilation]] into efficient run-time programs. This incremental development is often done interactively without interrupting the running application.<br /> <br /> It also supports optional type annotation and casting, which can be added as necessary at the later profiling and optimization stages, to permit the compiler to generate more efficient code. For instance, &lt;code&gt;fixnum&lt;/code&gt; can hold an [[Boxing (computer science)|unboxed]] integer in a range supported by the hardware and implementation, permitting more efficient arithmetic than on big integers or arbitrary precision types. Similarly, the compiler can be told on a per-module or per-function basis which type safety level is wanted, using ''optimize'' declarations.<br /> <br /> Common Lisp includes [[Common Lisp Object System|CLOS]], an [[object system]] that supports [[multimethods]] and method combinations. It is often implemented with a [[Metaobject]] Protocol.<br /> <br /> Common Lisp is extensible through standard features such as Lisp [[Macro (computer science)|macros]] (code transformations) and reader macros (input parsers for characters).<br /> <br /> Common Lisp provides some backwards compatibility to [[Maclisp]] and to John McCarthy's original [[Lisp (programming language)|Lisp]]. This allows older Lisp software to be ported to Common Lisp.&lt;ref&gt;{{cite web<br /> | url = http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html<br /> | title = Old LISP programs still run in Common Lisp | accessdate = 2015-05-13<br /> }}&lt;/ref&gt;<br /> <br /> ==Syntax==<br /> <br /> Common Lisp is a dialect of Lisp; it uses [[S-expression]]s to denote both code and data structure. Function calls, macro forms and special forms are written as lists, with the name of the function first, as in these examples:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (+ 2 2) ; adds 2 and 2, yielding 4. The function's name is '+'. Lisp has no operators as such.<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defvar *x*) ; Ensures that a variable *x* exists,<br /> ; without giving it a value. The asterisks are part of<br /> ; the name, by convention denoting a special (global) variable. <br /> ; The symbol *x* is also hereby endowed with the property that<br /> ; subsequent bindings of it are dynamic, rather than lexical.<br /> (setf *x* 42.1) ; sets the variable *x* to the floating-point value 42.1<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Define a function that squares a number:<br /> (defun square (x)<br /> (* x x))<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Execute the function:<br /> (square 3) ; Returns 9<br /> &lt;/source&gt;<br /> &lt;!-- I truncated this a bit; in smaller browsers, it runs off the side--&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; the 'let' construct creates a scope for local variables. Here<br /> ;; the variable 'a' is bound to 6 and the variable 'b' is bound<br /> ;; to 4. Inside the 'let' is a 'body', where the last computed value is returned.<br /> ;; Here the result of adding a and b is returned from the 'let' expression.<br /> ;; The variables a and b have lexical scope, unless the symbols have been<br /> ;; marked as special variables (for instance by a prior DEFVAR).<br /> (let ((a 6)<br /> (b 4))<br /> (+ a b)) ; returns 10<br /> &lt;/source&gt;<br /> <br /> ==Data types==<br /> Common Lisp has many data types.<br /> <br /> ===Scalar types===<br /> ''Number'' types include [[integer]]s, [[ratio]]s, [[Floating point|floating-point number]]s, and [[complex number]]s.&lt;ref name=&quot;reddy&quot;&gt;{{cite web<br /> | url = http://random-state.net/features-of-common-lisp.html<br /> | title = Features of Common Lisp<br /> | first = Abhishek | last = Reddy<br /> | date = 2008-08-22<br /> }}&lt;/ref&gt; Common Lisp uses [[Arbitrary-precision arithmetic|bignum]]s to represent numerical values of arbitrary size and precision. The ratio type represents fractions exactly, a facility not available in many languages. Common Lisp automatically coerces numeric values among these types as appropriate.<br /> <br /> The Common Lisp ''[[character (computing)|character]]'' type is not limited to [[ASCII]] characters. Most modern implementations allow [[Unicode]] characters.&lt;ref&gt;{{cite web<br /> | url = http://www.cliki.net/Unicode%20Support<br /> | title = Unicode support | work = The Common Lisp Wiki | accessdate = 2008-08-21<br /> }}&lt;/ref&gt;<br /> <br /> The ''[[Symbol (programming)|symbol]]'' type is common to Lisp languages, but largely unknown outside them. A symbol is a unique, named data object with several parts: name, value, function, property list and package. Of these, ''value cell'' and ''function cell'' are the most important. Symbols in Lisp are often used similarly to identifiers in other languages: to hold the value of a variable; however there are many other uses. Normally, when a symbol is evaluated, its value is returned. Some symbols evaluate to themselves, for example all symbols in the keyword package are self-evaluating. Boolean values in Common Lisp are represented by the self-evaluating symbols T and NIL. Common Lisp has namespaces for symbols, called 'packages'.<br /> <br /> A number of functions are available for [[rounding]] scalar numeric values in various ways. The function &lt;code&gt;round&lt;/code&gt; rounds the argument to the nearest integer, with halfway cases rounded to the even integer. The functions &lt;code&gt;truncate&lt;/code&gt;, &lt;code&gt;floor&lt;/code&gt;, and &lt;code&gt;ceiling&lt;/code&gt; round towards zero, down, or up respectively. All these functions return the discarded fractional part as a secondary value. For example, &lt;code&gt;(floor -2.5)&lt;/code&gt; yields -3, 0.5; &lt;code&gt;(ceiling -2.5)&lt;/code&gt; yields -2, -0.5; &lt;code&gt;(round 2.5)&lt;/code&gt; yields 2, 0.5; and &lt;code&gt;(round 3.5)&lt;/code&gt; yields 4, -0.5.<br /> <br /> ===Data structures===<br /> ''Sequence'' types in Common Lisp include lists, vectors, bit-vectors, and strings. There are many operations which can work on any sequence type.<br /> <br /> As in almost all other Lisp dialects, ''lists'' in Common Lisp are composed of ''conses'', sometimes called ''cons cells'' or ''pairs''. A cons is a data structure with two slots, called its ''car'' and ''cdr''. A list is a linked chain of conses or the empty list. Each cons's car refers to a member of the list (possibly another list). Each cons's cdr refers to the next cons—except for the last cons in a list, whose cdr refers to the &lt;code&gt;nil&lt;/code&gt; value. Conses can also easily be used to implement trees and other complex data structures; though it is usually advised to use structure or class instances instead. It is also possible to create circular data structures with conses.<br /> <br /> Common Lisp supports multidimensional ''arrays'', and can dynamically resize ''adjustable'' arrays if required. Multidimensional arrays can be used for matrix mathematics. A ''vector'' is a one-dimensional array. Arrays can carry any type as members (even mixed types in the same array) or can be specialized to contain a specific type of members, as in a vector of bits. Usually only a few types are supported. Many implementations can optimize array functions when the array used is type-specialized. Two type-specialized array types are standard: a ''string'' is a vector of characters, while a ''bit-vector'' is a vector of [[bit]]s.<br /> <br /> ''[[Hash table]]s'' store associations between data objects. Any object may be used as key or value. Hash tables are automatically resized as needed.<br /> <br /> ''Packages'' are collections of symbols, used chiefly to separate the parts of a program into [[namespaces]]. A package may ''export'' some symbols, marking them as part of a public interface. Packages can use other packages.<br /> <br /> ''Structures'', similar in use to [[C (programming language)|C]] structs and [[Pascal (programming language)|Pascal]] records, represent arbitrary complex data structures with any number and type of fields (called ''slots''). Structures allow single-inheritance.<br /> <br /> ''Classes'' are similar to structures, but offer more dynamic features and multiple-inheritance. (See [[Common Lisp Object System|CLOS]]). Classes have been added late to Common Lisp and there is some conceptual overlap with structures. Objects created of classes are called ''Instances''. A special case are Generic Functions. Generic Functions are both functions and instances.<br /> <br /> ===Functions===<br /> Common Lisp supports [[first-class function]]s. For instance, it is possible to write functions that take other functions as arguments or return functions as well. This makes it possible to describe very general operations.<br /> <br /> The Common Lisp library relies heavily on such higher-order functions. For example, the &lt;code&gt;sort&lt;/code&gt; function takes a [[relational operator]] as an argument and key function as an optional keyword argument. This can be used not only to sort any type of data, but also to sort data structures according to a key.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Sorts the list using the &gt; and &lt; function as the relational operator.<br /> (sort (list 5 2 6 3 1 4) #'&gt;) ; Returns (6 5 4 3 2 1)<br /> (sort (list 5 2 6 3 1 4) #'&lt;) ; Returns (1 2 3 4 5 6)<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Sorts the list according to the first element of each sub-list.<br /> (sort (list '(9 A) '(3 B) '(4 C)) #'&lt; :key #'first) ; Returns ((3 B) (4 C) (9 A))<br /> &lt;/source&gt;<br /> <br /> The evaluation model for functions is very simple. When the evaluator encounters a form &lt;code&gt;(f a1 a2...)&lt;/code&gt; then it presumes that the symbol named f is one of the following:<br /> <br /> # A special operator (easily checked against a fixed list)<br /> # A macro operator (must have been defined previously)<br /> # The name of a function (default), which may either be a symbol, or a sub-form beginning with the symbol &lt;code&gt;lambda&lt;/code&gt;.<br /> <br /> If f is the name of a function, then the arguments a1, a2, ..., an are evaluated in left-to-right order, and the function is found and invoked with those values supplied as parameters.<br /> <br /> ====Defining functions====<br /> The [[Defun|macro &lt;code&gt;defun&lt;/code&gt;]] defines functions where a function definition gives the name of the function, the names of any arguments, and a function body:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun square (x)<br /> (* x x))<br /> &lt;/source&gt;<br /> <br /> Function definitions may include compiler [[Directive (programming)|directives]], known as ''declarations'', which provide hints to the compiler about optimization settings or the data types of arguments. They may also include ''documentation strings'' (docstrings), which the Lisp system may use to provide interactive documentation:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun square (x)<br /> &quot;Calculates the square of the single-float x.&quot;<br /> (declare (single-float x) (optimize (speed 3) (debug 0) (safety 1)))<br /> (the single-float (* x x)))<br /> &lt;/source&gt;<br /> <br /> Anonymous functions ([[function literal]]s) are defined using &lt;code&gt;lambda&lt;/code&gt; expressions, e.g. &lt;code&gt;(lambda&amp;nbsp;(x)&amp;nbsp;(*&amp;nbsp;x&amp;nbsp;x))&lt;/code&gt; for a function that squares its argument. Lisp programming style frequently uses higher-order functions for which it is useful to provide anonymous functions as arguments.<br /> <br /> Local functions can be defined with &lt;code&gt;flet&lt;/code&gt; and &lt;code&gt;labels&lt;/code&gt;.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (flet ((square (x)<br /> (* x x)))<br /> (square 3))<br /> &lt;/source&gt;<br /> <br /> There are a number of other operators related to the definition and manipulation of functions. For instance, a function may be compiled with the &lt;code&gt;compile&lt;/code&gt; operator. (Some Lisp systems run functions using an interpreter by default unless instructed to compile; others compile every function).<br /> <br /> ====Defining generic functions and methods====<br /> The macro &lt;code&gt;defgeneric&lt;/code&gt; defines generic functions.<br /> The macro &lt;code&gt;defmethod&lt;/code&gt; defines methods. Generic functions are a collection of methods.<br /> <br /> Methods can specialize their parameters over CLOS ''standard classes'', ''system classes'', ''structure classes'' or objects. For many types there are corresponding ''system classes''.<br /> <br /> When a generic function is called, multiple-dispatch will determine the effective method to use.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defgeneric add (a b))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a number) (b number))<br /> (+ a b))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a vector) (b number))<br /> (map 'vector (lambda (n) (+ n b)) a))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a vector) (b vector))<br /> (map 'vector #'+ a b))<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a string)(b string))<br /> (concatenate 'string a b) )<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (add 2 3) ; returns 5<br /> (add #(1 2 3 4) 7) ; returns #(8 9 10 11)<br /> (add #(1 2 3 4) #(4 3 2 1)) ; returns #(5 5 5 5)<br /> (add &quot;COMMON &quot; &quot;LISP&quot;) ; returns &quot;COMMON LISP&quot;<br /> &lt;/source&gt;<br /> <br /> Generic Functions are also a first class data type. There are many more features to Generic Functions and Methods than described above.<br /> <br /> ====The function namespace====<br /> &lt;!-- This section name is linked from several places; if you change it, update the links. --&gt;<br /> <br /> The namespace for function names is separate from the namespace for data variables. This is a key difference between Common Lisp and [[Scheme (programming language)|Scheme]]. For Common Lisp, operators that define names in the function namespace include &lt;code&gt;defun&lt;/code&gt;, &lt;code&gt;flet&lt;/code&gt;, &lt;code&gt;labels&lt;/code&gt;, &lt;code&gt;defmethod&lt;/code&gt; and &lt;code&gt;defgeneric&lt;/code&gt;.<br /> <br /> To pass a function by name as an argument to another function, one must use the &lt;code&gt;function&lt;/code&gt; special operator, commonly abbreviated as &lt;code&gt;#'&lt;/code&gt;. The first &lt;code&gt;sort&lt;/code&gt; example above refers to the function named by the symbol &lt;code&gt;&amp;gt;&lt;/code&gt; in the function namespace, with the code &lt;code&gt;#'&amp;gt;&lt;/code&gt;. Conversely, to call a function passed in such a way, one would use the &lt;code&gt;funcall&lt;/code&gt; operator on the argument.<br /> <br /> [[Scheme (programming language)|Scheme's]] evaluation model is simpler: there is only one namespace, and all positions in the form are evaluated (in any order) -- not just the arguments. Code written in one dialect is therefore sometimes confusing to programmers more experienced in the other. For instance, many Common Lisp programmers like to use descriptive variable names such as ''list'' or ''string'' which could cause problems in Scheme, as they would locally shadow function names.<br /> <br /> Whether a separate namespace for functions is an advantage is a source of contention in the Lisp community. It is usually referred to as the ''Lisp-1 vs. Lisp-2 debate''. Lisp-1 refers to Scheme's model and Lisp-2 refers to Common Lisp's model. These names were coined in a 1988 paper by [[Richard P. Gabriel]] and [[Kent Pitman]], which extensively compares the two approaches.&lt;ref&gt;{{cite journal |title=Technical Issues of Separation in Function Cells and Value Cells |url=http://www.nhplace.com/kent/Papers/Technical-Issues.html |authors=Richard P. Gabriel, Kent M. Pitman |journal=Lisp and Symbolic Computation |date = June 1988|volume=1 |issue=1 |pages=81–101 |doi=10.1007/bf01806178}}&lt;/ref&gt;<br /> <br /> ===Other types===<br /> Other data types in Common Lisp include:<br /> <br /> *''Pathnames'' represent files and directories in the [[filesystem]]. The Common Lisp pathname facility is more general than most operating systems' file naming conventions, making Lisp programs' access to files broadly portable across diverse systems.<br /> *Input and output ''streams'' represent sources and sinks of binary or textual data, such as the terminal or open files.<br /> *Common Lisp has a built-in [[pseudo-random number generator]] (PRNG). ''Random state'' objects represent reusable sources of pseudo-random numbers, allowing the user to seed the PRNG or cause it to replay a sequence.<br /> *''Conditions'' are a type used to represent errors, exceptions, and other &quot;interesting&quot; events to which a program may respond.<br /> *''Classes'' are [[first-class object]]s, and are themselves instances of classes called [[metaclasses|metaobject classes]] ([[metaclasses]] for short).<br /> *''Readtables'' are a type of object which control how Common Lisp's reader parses the text of source code. By controlling which readtable is in use when code is read in, the programmer can change or extend the language's syntax.<br /> <br /> ==Scope==<br /> <br /> Like programs in many other programming languages, Common Lisp programs make use of names to refer to variables, functions, and many other kinds of entities. Named references are subject to scope.<br /> <br /> The association between a name and the entity which the name refers to is called a binding.<br /> <br /> Scope refers to the set of circumstances in which a name is determined to have a particular binding.<br /> <br /> ===Determiners of scope===<br /> <br /> The circumstances which determine scope in Common Lisp include:<br /> <br /> * the location of a reference within an expression. If it's the leftmost position of a compound, it refers to a special operator or a macro or function binding, otherwise to a variable binding or something else.<br /> * the kind of expression in which the reference takes place. For instance, &lt;code&gt;(go x)&lt;/code&gt; means transfer control to label &lt;code&gt;x&lt;/code&gt;, whereas &lt;code&gt;(print x)&lt;/code&gt; refers to the variable &lt;code&gt;x&lt;/code&gt;. Both scopes of &lt;code&gt;x&lt;/code&gt; can be active in the same region of program text, since tagbody labels are in a separate namespace from variable names. A special form or macro form has complete control over the meanings of all symbols in its syntax. For instance in &lt;code&gt;(defclass x (a b) ())&lt;/code&gt;, a class definition, the &lt;code&gt;(a b)&lt;/code&gt; is a list of base classes, so these names are looked up in the space of class names, and &lt;code&gt;x&lt;/code&gt; isn't a reference to an existing binding, but the name of a new class being derived from &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;. These facts emerge purely from the semantics of &lt;code&gt;defclass&lt;/code&gt;. The only generic fact about this expression is that &lt;code&gt;defclass&lt;/code&gt; refers to a macro binding; everything else is up to &lt;code&gt;defclass&lt;/code&gt;.<br /> * the location of the reference within the program text. For instance, if a reference to variable &lt;code&gt;x&lt;/code&gt; is enclosed in a binding construct such as a &lt;code&gt;let&lt;/code&gt; which defines a binding for &lt;code&gt;x&lt;/code&gt;, then the reference is in the scope created by that binding.<br /> * for a variable reference, whether or not a variable symbol has been, locally or globally, declared special. This determines whether the reference is resolved within a lexical environment, or within a dynamic environment.<br /> * the specific instance of the environment in which the reference is resolved. An environment is a run-time dictionary which maps symbols to bindings. Each kind of reference uses its own kind of environment. References to lexical variables are resolved in a lexical environment, et cetera. More than one environment can be associated with the same reference. For instance, thanks to recursion or the use of multiple threads, multiple activations of the same function can exist at the same time. These activations share the same program text, but each has its own lexical environment instance.<br /> <br /> To understand what a symbol refers to, the Common Lisp programmer must know what kind of reference is being expressed, what kind of scope it uses if it is a variable reference (dynamic versus lexical scope), and also the run-time situation: in what environment is the reference resolved, where was the binding introduced into the environment, et cetera.<br /> <br /> ===Kinds of environment===<br /> <br /> ====Global====<br /> <br /> Some environments in Lisp are globally pervasive. For instance, if a new type is defined, it is known everywhere thereafter. References to that type look it up in this global environment.<br /> <br /> ====Dynamic====<br /> <br /> One type of environment in Common Lisp is the dynamic environment. Bindings established in this environment have dynamic extent, which means that a binding is established at the start of the execution of some construct, such as a &lt;code&gt;let&lt;/code&gt; block, and disappears when that construct finishes executing: its lifetime is tied to the dynamic activation and deactivation of a block. However, a dynamic binding is not just visible within that block; it is also visible to all functions invoked from that block. This type of visibility is known as indefinite scope. Bindings which exhibit dynamic extent (lifetime tied to the activation and deactivation of a block) and indefinite scope (visible to all functions which are called from that block) are said to have dynamic scope.<br /> <br /> Common Lisp has support for dynamically scoped variables, which are also called special variables. Certain other kinds of bindings are necessarily dynamically scoped also, such as restarts and catch tags. Function bindings cannot be dynamically scoped using &lt;code&gt;flet&lt;/code&gt; (which only provides lexically scoped function bindings), but function objects (a first-level object in Common Lisp) can be assigned to dynamically scoped variables, bound using &lt;code&gt;let&lt;/code&gt; in dynamic scope, then called using &lt;code&gt;funcall&lt;/code&gt; or &lt;code&gt;APPLY&lt;/code&gt;.<br /> <br /> Dynamic scope is extremely useful because it adds referential clarity and discipline to [[global variable]]s. Global variables are frowned upon in computer science as potential sources of error, because they can give rise to ad-hoc, covert channels of communication among modules that lead to unwanted, surprising interactions.<br /> <br /> In Common Lisp, a special variable which has only a top-level binding behaves just like a global variable in other programming languages. A new value can be stored into it, and that value simply replaces what is in the top-level binding. Careless replacement of the value of a global variable is at the heart of bugs caused by use of global variables. However, another way to work with a special variable is to give it a new, local binding within an expression. This is sometimes referred to as &quot;rebinding&quot; the variable. Binding a dynamically scoped variable temporarily creates a new memory location for that variable, and associates the name with that location. While that binding is in effect, all references to that variable refer to the new binding; the previous binding is hidden. When execution of the binding expression terminates, the temporary memory location is gone, and the old binding is revealed, with the original value intact. Of course, multiple dynamic bindings for the same variable can be nested.<br /> <br /> In Common Lisp implementations which support multithreading, dynamic scopes are specific to each thread of execution. Thus special variables serve as an abstraction for thread local storage. If one thread rebinds a special variable, this rebinding has no effect on that variable in other threads. The value stored in a binding can only be retrieved by the thread which created that binding. If each thread binds some special variable &lt;code&gt;*x*&lt;/code&gt;, then &lt;code&gt;*x*&lt;/code&gt; behaves like thread-local storage. Among threads which do not rebind &lt;code&gt;*x*&lt;/code&gt;, it behaves like an ordinary global: all of these threads refer to the same top-level binding of &lt;code&gt;*x*&lt;/code&gt;.<br /> <br /> Dynamic variables can be used to extend the execution context with additional context information which is implicitly passed from function to function without having to appear as an extra function parameter. This is especially useful when the control transfer has to pass through layers of unrelated code, which simply cannot be extended with extra parameters to pass the additional data. A situation like this usually calls for a global variable. That global variable must be saved and restored, so that the scheme doesn't break under recursion: dynamic variable rebinding takes care of this. And that variable must be made thread-local (or else a big mutex must be used) so the scheme doesn't break under threads: dynamic scope implementations can take care of this also.<br /> <br /> In the Common Lisp library, there are many standard special variables. For instance, all standard I/O streams are stored in the top-level bindings of well-known special variables. The standard output stream is stored in *standard-output*.<br /> <br /> Suppose a function foo writes to standard output:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun foo ()<br /> (format t &quot;Hello, world&quot;))<br /> &lt;/source&gt;<br /> <br /> To capture its output in a character string, *standard-output* can be bound to a string stream and called:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (with-output-to-string (*standard-output*)<br /> (foo))<br /> &lt;/source&gt;<br /> <br /> -&gt; &quot;Hello, world&quot; ; gathered output returned as a string<br /> <br /> ====Lexical====<br /> <br /> Common Lisp supports lexical environments. Formally, the bindings in a lexical environment have [[lexical scope]] and may have either indefinite extent or dynamic extent, depending on the type of namespace. [[Lexical scope]] means that visibility is physically restricted to the block in which the binding is established. References which are not textually (i.e. lexically) embedded in that block simply do not see that binding.<br /> <br /> The tags in a TAGBODY have lexical scope. The expression (GO X) is erroneous if it is not actually embedded in a TAGBODY which contains a label X. However, the label bindings disappear when the TAGBODY terminates its execution, because they have dynamic extent. If that block of code is re-entered by the invocation of a lexical closure, it is invalid for the body of that closure to try to transfer control to a tag via GO:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defvar *stashed*) ;; will hold a function<br /> <br /> (tagbody<br /> (setf *stashed* (lambda () (go some-label)))<br /> (go end-label) ;; skip the (print &quot;Hello&quot;)<br /> some-label<br /> (print &quot;Hello&quot;)<br /> end-label)<br /> -&gt; NIL<br /> &lt;/source&gt;<br /> <br /> When the TAGBODY is executed, it first evaluates the setf form which stores a function in the special variable *stashed*. Then the (go end-label) transfers control to end-label, skipping the code (print &quot;Hello&quot;). Since end-label is at the end of the tagbody, the tagbody terminates, yielding NIL. Suppose that the previously remembered function is now called:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (funcall *stashed*) ;; Error!<br /> &lt;/source&gt;<br /> <br /> This situation is erroneous. One implementation's response is an error condition containing the message, &quot;GO: tagbody for tag SOME-LABEL has already been left&quot;. The function tried to evaluate (go some-label), which is lexically embedded in the tagbody, and resolves to the label. However, the tagbody isn't executing (its extent has ended), and so the control transfer cannot take place.<br /> <br /> Local function bindings in Lisp have [[lexical scope]], and variable bindings also have lexical scope by default. By contrast with GO labels, both of these have indefinite extent. When a lexical function or variable binding is established, that binding continues to exist for as long as references to it are possible, even after the construct which established that binding has terminated. References to lexical variables and functions after the termination of their establishing construct are possible thanks to [[lexical closure]]s.<br /> <br /> Lexical binding is the default binding mode for Common Lisp variables. For an individual symbol, it can be switched to dynamic scope, either by a local declaration, by a global declaration. The latter may occur implicitly through the use of a construct like DEFVAR or DEFPARAMETER. It is an important convention in Common Lisp programming that special (i.e. dynamically scoped) variables have names which begin and end with an asterisk [[Sigil (computer programming)|sigil]] &lt;code&gt;*&lt;/code&gt; in what is called the “[[earmuff]] convention”.&lt;ref&gt;[http://letoverlambda.com/index.cl/guest/chap2.html Chapter 2] of [[Let Over Lambda]]&lt;/ref&gt; If adhered to, this convention effectively creates a separate namespace for special variables, so that variables intended to be lexical are not accidentally made special.<br /> <br /> [[Lexical scope]] is useful for several reasons.<br /> <br /> Firstly, references to variables and functions can be compiled to efficient machine code, because the run-time environment structure is relatively simple. In many cases it can be optimized to stack storage, so opening and closing lexical scopes has minimal overhead. Even in cases where full closures must be generated, access to the closure's environment is still efficient; typically each variable becomes an offset into a vector of bindings, and so a variable reference becomes a simple load or store instruction with a base-plus-offset [[addressing mode]].<br /> <br /> Secondly, lexical scope (combined with indefinite extent) gives rise to the [[lexical closure]], which in turn creates a whole paradigm of programming centered around the use of functions being first-class objects, which is at the root of functional programming.<br /> <br /> Thirdly, perhaps most importantly, even if lexical closures are not exploited, the use of lexical scope isolates program modules from unwanted interactions. Due to their restricted visibility, lexical variables are private. If one module A binds a lexical variable X, and calls another module B, references to X in B will not accidentally resolve to the X bound in A. B simply has no access to X. For situations in which disciplined interactions through a variable are desirable, Common Lisp provides special variables. Special variables allow for a module A to set up a binding for a variable X which is visible to another module B, called from A. Being able to do this is an advantage, and being able to prevent it from happening is also an advantage; consequently, Common Lisp supports both lexical and [[dynamic scope]].<br /> <br /> ==Macros==<br /> A ''[[Macro (computer science)|macro]]'' in Lisp superficially resembles a function in usage. However, rather than representing an expression which is evaluated, it represents a transformation of the program source code. The macro gets the source it surrounds as arguments, binds them to its parameters and computes a new source form. This new form can also use a macro. The macro expansion is repeated until the new source form does not use a macro. The final computed form is the source code executed at runtime.<br /> <br /> Typical uses of macros in Lisp:<br /> <br /> * new control structures (example: looping constructs, branching constructs)<br /> * scoping and binding constructs<br /> * simplified syntax for complex and repeated source code<br /> * top-level defining forms with compile-time side-effects<br /> * data-driven programming<br /> * embedded domain specific languages (examples: SQL, HTML, Prolog)<br /> * implicit finalization forms<br /> <br /> Various standard Common Lisp features also need to be implemented as macros, such as:<br /> <br /> * the standard &lt;code&gt;setf&lt;/code&gt; abstraction, to allow custom compile-time expansions of assignment/access operators<br /> * &lt;code&gt;with-accessors&lt;/code&gt;, &lt;code&gt;with-slots&lt;/code&gt;, &lt;code&gt;with-open-file&lt;/code&gt; and other similar &lt;code&gt;WITH&lt;/code&gt; macros<br /> * Depending on implementation, &lt;code&gt;if&lt;/code&gt; or &lt;code&gt;cond&lt;/code&gt; is a macro built on the other, the special operator; &lt;code&gt;when&lt;/code&gt; and &lt;code&gt;unless&lt;/code&gt; consist of macros<br /> * The powerful &lt;code&gt;loop&lt;/code&gt; domain-specific language<br /> <br /> Macros are defined by the ''defmacro'' macro. The special operator ''macrolet'' allows the definition of local (lexically scoped) macros. It is also possible to define macros for symbols using ''define-symbol-macro'' and ''symbol-macrolet''.<br /> <br /> [[Paul Graham (computer programmer)|Paul Graham]]'s book [[On Lisp]] describes the use of macros in Common Lisp in detail. [[Doug Hoyte]]'s book [[Let Over Lambda]] extends the discussion on macros, claiming &quot;Macros are the single greatest advantage that lisp has as a programming language and the single greatest advantage of any programming language.&quot; Hoyte provides several examples of iterative development of macros.<br /> <br /> ===Example using a macro to define a new control structure===<br /> Macros allow Lisp programmers to create new syntactic forms in the language. One typical use is to create new control structures. The example macro provides an &lt;code&gt;until&lt;/code&gt; looping construct. The syntax is:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> (until test form*)<br /> &lt;/source&gt;<br /> <br /> The macro definition for ''until'':<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmacro until (test &amp;body body)<br /> (let ((start-tag (gensym &quot;START&quot;))<br /> (end-tag (gensym &quot;END&quot;)))<br /> `(tagbody ,start-tag<br /> (when ,test (go ,end-tag))<br /> (progn ,@body)<br /> (go ,start-tag)<br /> ,end-tag)))<br /> &lt;/source&gt;<br /> <br /> ''tagbody'' is a primitive Common Lisp special operator which provides the ability to name tags and use the ''go'' form to jump to those tags. The backquote ''`'' provides a notation that provides code templates, where the value of forms preceded with a comma are filled in. Forms preceded with comma and at-sign are ''spliced'' in. The tagbody form tests the end condition. If the condition is true, it jumps to the end tag. Otherwise the provided body code is executed and then it jumps to the start tag.<br /> <br /> An example form using above ''until'' macro:<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (until (= (random 10) 0)<br /> (write-line &quot;Hello&quot;))<br /> &lt;/source&gt;<br /> <br /> The code can be expanded using the function ''macroexpand-1''. The expansion for above example looks like this:<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (TAGBODY<br /> #:START1136<br /> (WHEN (ZEROP (RANDOM 10))<br /> (GO #:END1137))<br /> (PROGN (WRITE-LINE &quot;hello&quot;))<br /> (GO #:START1136)<br /> #:END1137)<br /> &lt;/source&gt;<br /> <br /> During macro expansion the value of the variable ''test'' is ''(= (random 10) 0)'' and the value of the variable ''body'' is ''((write-line &quot;Hello&quot;))''. The body is a list of forms.<br /> <br /> Symbols are usually automatically upcased. The expansion uses the TAGBODY with two labels. The symbols for these labels are computed by GENSYM and are not interned in any package. Two ''go'' forms use these tags to jump to. Since ''tagbody'' is a primitive operator in Common Lisp (and not a macro), it will not be expanded into something else. The expanded form uses the ''when'' macro, which also will be expanded. Fully expanding a source form is called ''code walking''.<br /> <br /> In the fully expanded (''walked'') form, the ''when'' form is replaced by the primitive ''if'':<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (TAGBODY<br /> #:START1136<br /> (IF (ZEROP (RANDOM 10))<br /> (PROGN (GO #:END1137))<br /> NIL)<br /> (PROGN (WRITE-LINE &quot;hello&quot;))<br /> (GO #:START1136))<br /> #:END1137)<br /> &lt;/source&gt;<br /> <br /> All macros must be expanded before the source code containing them can be evaluated or compiled normally. Macros can be considered functions that accept and return [[abstract syntax tree]]s (Lisp S-expressions). These functions<br /> are invoked before the evaluator or compiler to produce the final source code.<br /> Macros are written in normal Common Lisp, and may use any Common Lisp (or third-party) operator available.<br /> <br /> ===Variable capture and shadowing===<br /> Common Lisp macros are capable of what is commonly called ''variable capture'', where symbols in the macro-expansion body coincide with those in the calling context, allowing the programmer to create macros wherein various symbols have special meaning. The term ''variable capture'' is somewhat misleading, because all namespaces are vulnerable to unwanted capture, including the operator and function namespace, the tagbody label namespace, catch tag, condition handler and restart namespaces.<br /> <br /> ''Variable capture'' can introduce software defects. This happens in one of the following two ways:<br /> <br /> * In the first way, a macro expansion can inadvertently make a symbolic reference which the macro writer assumed will resolve in a global namespace, but the code where the macro is expanded happens to provide a local, shadowing definition which steals that reference. Let this be referred to as type 1 capture.<br /> <br /> * The second way, type 2 capture, is just the opposite: some of the arguments of the macro are pieces of code supplied by the macro caller, and those pieces of code are written such that they make references to surrounding bindings. However, the macro inserts these pieces of code into an expansion which defines its own bindings that accidentally captures some of these references.<br /> <br /> The Scheme dialect of Lisp provides a macro-writing system which provides the referential transparency that eliminates both types of capture problem. This type of macro system is sometimes called &quot;hygienic&quot;, in particular by its proponents (who regard macro systems which do not automatically solve this problem as unhygienic). {{Citation needed|date=May 2011}}<br /> <br /> In Common Lisp, macro hygiene is ensured one of two different ways.<br /> <br /> One approach is to use [[gensym]]s: guaranteed-unique symbols which can be used in a macro-expansion without threat of capture. The use of gensyms in a macro definition is a manual chore, but macros can be written which simplify the instantiation and use of gensyms. Gensyms solve type 2 capture easily, but they are not applicable to type 1 capture in the same way, because the macro expansion cannot rename the interfering symbols in the surrounding code which capture its references. Gensyms could be used to provide stable aliases for the global symbols which the macro expansion needs. The macro expansion would use these secret aliases rather than the well-known names, so redefinition of the well-known names would have no ill effect on the macro.<br /> <br /> Another approach is to use packages. A macro defined in its own package can simply use internal symbols in that package in its expansion. The use of packages deals with type 1 and type 2 capture.<br /> <br /> However, packages don't solve the type 1 capture of references to standard Common Lisp functions and operators. The reason is that the use of packages to solve capture problems revolves around the use of private symbols (symbols in one package, which are not imported into, or otherwise made visible in other packages). Whereas the Common Lisp library symbols are external, and frequently imported into or made visible in user-defined packages.<br /> <br /> The following is an example of unwanted capture in the operator namespace, occurring in the expansion of a macro:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; expansion of UNTIL makes liberal use of DO<br /> (defmacro until (expression &amp;body body)<br /> `(do () (,expression) ,@body))<br /> <br /> ;; macrolet establishes lexical operator binding for DO<br /> (macrolet ((do (...) ... something else ...))<br /> (until (= (random 10) 0) (write-line &quot;Hello&quot;)))<br /> &lt;/source&gt;<br /> <br /> The &lt;code&gt;until&lt;/code&gt; macro will expand into a form which calls &lt;code&gt;do&lt;/code&gt; which is intended to refer to the standard Common Lisp macro &lt;code&gt;do&lt;/code&gt;. However, in this context, &lt;code&gt;do&lt;/code&gt; may have a completely different meaning, so &lt;code&gt;until&lt;/code&gt; may not work properly.<br /> <br /> Common Lisp solves the problem of the shadowing of standard operators and functions by forbidding their redefinition. Because it redefines the standard operator &lt;code&gt;do&lt;/code&gt;, the preceding is actually a fragment of non-conforming Common Lisp, which allows implementations to diagnose and reject it.<br /> <br /> ==Condition system==<br /> The ''condition system'' is responsible for [[exception handling]] in Common Lisp.&lt;ref name=&quot;Seibel2005&quot;&gt;{{cite book|author=Peter Seibel|title=Practical Common Lisp|url=http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html|date=7 April 2005|publisher=Apress|isbn=978-1-59059-239-7}}&lt;/ref&gt; It provides ''conditions'', ''handler''s and ''restart''s. ''Condition''s are objects describing an exceptional situation (for example an error). If a ''condition'' is signaled, the Common Lisp system searches for a ''handler'' for this condition type and calls the handler. The ''handler'' can now search for restarts and use one of these restarts to repair the current problem. As part of a user interface (for example of a debugger), these restarts can also be presented to the user, so that the user can select and invoke one of the available restarts. Since the condition handler is called in the context of the error (without unwinding the stack), full error recovery is possible in many cases, where other exception handling systems would have already terminated the current routine. The debugger itself can also be customized or replaced using the &lt;code&gt;*debugger-hook*&lt;/code&gt; dynamic variable.<br /> <br /> In the following example (using [[Symbolics Genera]]) the user tries to open a file in a Lisp function ''test'' called from the Read-Eval-Print-LOOP ([[REPL]]), when the file does not exist. The Lisp system presents four restarts. The user selects the ''Retry OPEN using a different pathname'' restart and enters a different pathname (lispm-init.lisp instead of lispm-int.lisp). The user code does not contain any error handling code. The whole error handling and restart code is provided by the Lisp system, which can handle and repair the error without terminating the user code.<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> Command: (test &quot;&gt;zippy&gt;lispm-int.lisp&quot;)<br /> <br /> Error: The file was not found.<br /> For lispm:&gt;zippy&gt;lispm-int.lisp.newest<br /> <br /> LMFS:OPEN-LOCAL-LMFS-1<br /> Arg 0: #P&quot;lispm:&gt;zippy&gt;lispm-int.lisp.newest&quot;<br /> <br /> s-A, &lt;Resume&gt;: Retry OPEN of lispm:&gt;zippy&gt;lispm-int.lisp.newest<br /> s-B: Retry OPEN using a different pathname<br /> s-C, &lt;Abort&gt;: Return to Lisp Top Level in a TELNET server<br /> s-D: Restart process TELNET terminal<br /> <br /> -&gt; Retry OPEN using a different pathname<br /> Use what pathname instead [default lispm:&gt;zippy&gt;lispm-int.lisp.newest]:<br /> lispm:&gt;zippy&gt;lispm-init.lisp.newest<br /> <br /> ...the program continues<br /> &lt;/source&gt;<br /> <br /> ==Common Lisp Object System (CLOS)==<br /> <br /> {{Main|Common Lisp Object System}}<br /> <br /> Common Lisp includes a toolkit for [[object-oriented programming]], the Common Lisp Object System or [[Common Lisp Object System|CLOS]], which is one of the most powerful object systems available in any language. For example, [[Peter Norvig]] explains how many [[Design pattern (computer science)|Design Patterns]] are simpler to implement in a dynamic language with the features of CLOS (Multiple Inheritance, Mixins, Multimethods, Metaclasses, Method combinations, etc.).&lt;ref&gt;[http://norvig.com/design-patterns/ppframe.htm Peter Norvig, Design Patterns in Dynamic Programming]&lt;/ref&gt;<br /> Several extensions to Common Lisp for object-oriented programming have been proposed to be included into the ANSI Common Lisp standard, but eventually CLOS was adopted as the standard object-system for Common Lisp. CLOS is a [[dynamic programming language|dynamic]] object system with [[multiple dispatch]] and [[multiple inheritance]], and differs radically from the OOP facilities found in static languages such as [[C++]] or [[Java (programming language)|Java]]. As a dynamic object system, CLOS allows changes at runtime to generic functions and classes. Methods can be added and removed, classes can be added and redefined, objects can be updated for class changes and the class of objects can be changed.<br /> <br /> CLOS has been integrated into ANSI Common Lisp. Generic Functions can be used like normal functions and are a first-class data type. Every CLOS class is integrated into the Common Lisp type system. Many Common Lisp types have a corresponding class. There is more potential use of CLOS for Common Lisp. The specification does not say whether conditions are implemented with CLOS. Pathnames and streams could be implemented with CLOS. These further usage possibilities of CLOS for ANSI Common Lisp are not part of the standard. Actual Common Lisp implementations are using CLOS for pathnames, streams, input/output, conditions, the implementation of CLOS itself and more.<br /> <br /> ==Compiler and interpreter==<br /> Several implementations of earlier Lisp dialects provided both an interpreter and a compiler. Unfortunately often the semantics were different. These earlier Lisps implemented lexical scoping in the compiler and dynamic scoping in the interpreter. Common Lisp requires that both the interpreter and compiler use lexical scoping by default. The Common Lisp standard describes both the semantics of the interpreter and a compiler. The compiler can be called using the function ''compile'' for individual functions and using the function ''compile-file'' for files. Common Lisp allows type declarations and provides ways to influence the compiler code generation policy. For the latter various optimization qualities can be given values between 0 (not important) and 3 (most important): ''speed'', ''space'', ''safety'', ''debug'' and ''compilation-speed''.<br /> <br /> There is also a function to evaluate Lisp code: ''eval''. ''eval'' takes code as pre-parsed s-expressions and not, like in some other languages, as text strings. This way code can be constructed with the usual Lisp functions for constructing lists and symbols and then this code can be evaluated with ''eval''. Several Common Lisp implementations (like Clozure CL and SBCL) are implementing ''eval'' using their compiler. This way code is compiled, even though it is evaluated using the function ''eval''.<br /> <br /> The file compiler is invoked using the function ''compile-file''. The generated file with compiled code is called a ''fasl'' (from ''fast load'') file. These ''fasl'' files and also source code files can be loaded with the function ''load'' into a running Common Lisp system. Depending on the implementation, the file compiler generates byte-code (for example for the [[Java Virtual Machine]]), [[C (programming language)|C language]] code (which then is compiled with a C compiler) or, directly, native code.<br /> <br /> Common Lisp implementations can be used interactively, even though the code gets fully compiled. The idea of an [[Interpreted language]] thus does not apply for interactive Common Lisp.<br /> <br /> The language makes distinction between read-time, compile-time, load-time and run-time, and allows user code to also make this distinction to perform the wanted type of processing at the wanted step.<br /> <br /> Some special operators are provided to especially suit interactive development; for instance, &lt;code&gt;defvar&lt;/code&gt; will only assign a value to its provided variable if it wasn't already bound, while &lt;code&gt;defparameter&lt;/code&gt; will always perform the assignment. This distinction is useful when interactively evaluating, compiling and loading code in a live image.<br /> <br /> Some features are also provided to help writing compilers and interpreters. Symbols consist of first-level objects and are directly manipulable by user code. The &lt;code&gt;progv&lt;/code&gt; special operator allows to create lexical bindings programmatically, while packages are also manipulable. The Lisp compiler itself is available at runtime to compile files or individual functions. These make it easy to use Lisp as an intermediate compiler or interpreter for another language.<br /> <br /> ==Code examples==<br /> <br /> ===Birthday paradox===<br /> The following program calculates the smallest number of people in a room for whom the probability of completely unique birthdays is less than 50% (the [[birthday paradox]], where for 1 person the probability is obviously 100%, for 2 it is 364/365, etc.). The Answer is 23.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; By convention, constants in Common Lisp are enclosed with + characters.<br /> (defconstant +year-size+ 365)<br /> <br /> (defun birthday-paradox (probability number-of-people)<br /> (let ((new-probability (* (/ (- +year-size+ number-of-people)<br /> +year-size+)<br /> probability)))<br /> (if (&lt; new-probability 0.5)<br /> (1+ number-of-people)<br /> (birthday-paradox new-probability (1+ number-of-people)))))<br /> &lt;/source&gt;<br /> <br /> Calling the example function using the [[REPL]] (Read Eval Print Loop):<br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (birthday-paradox 1.0 1)<br /> 23<br /> &lt;/source&gt;<br /> <br /> ===Sorting a list of person objects===<br /> <br /> We define a class &lt;code&gt;person&lt;/person&gt; and a method for displaying the name and age of a person.<br /> Next we define a group of persons as a list of PERSON objects.<br /> Then we iterate over the sorted list.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defclass person ()<br /> ((name :initarg :name :reader person-name)<br /> (age :initarg :age :reader person-age))<br /> (:documentation &quot;The class PERSON with slots NAME and AGE.&quot;))<br /> <br /> (defmethod print-object ((object person) stream)<br /> &quot;Displaying a PERSON object to an output stream.&quot;<br /> (print-unreadable-object (object stream :type t)<br /> (format stream &quot;~a (~a)&quot; (person-name object) (person-age object))))<br /> <br /> (defparameter *group*<br /> (list (make-instance 'person :name &quot;Bob&quot; :age 33)<br /> (make-instance 'person :name &quot;Chris&quot; :age 16)<br /> (make-instance 'person :name &quot;Ash&quot; :age 23))<br /> &quot;A list of PERSON objects.&quot;)<br /> <br /> (dolist (person (sort (copy-list *group*)<br /> #'&gt;<br /> :key #'person-age))<br /> (print person))<br /> &lt;/source&gt;<br /> <br /> It prints the three names with descending age.<br /> &lt;source lang=&quot;text&quot;&gt;<br /> #&lt;PERSON Bob (33)&gt; <br /> #&lt;PERSON Ash (23)&gt; <br /> #&lt;PERSON Chris (16)&gt; <br /> &lt;/source&gt;<br /> <br /> ===Exponentiating by squaring===<br /> <br /> Use of the LOOP macro is demonstrated:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun power (x n)<br /> (loop with result = 1<br /> while (plusp n)<br /> when (oddp n) do (setf result (* result x))<br /> do (setf x (* x x)<br /> n (truncate n 2))<br /> finally (return result)))<br /> &lt;/source&gt;<br /> <br /> Example use:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (power 2 200)<br /> 1606938044258990275541962092341162602522202993782792835301376<br /> &lt;/source&gt;<br /> <br /> Compare with the built in exponentiation:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (= (expt 2 200) (power 2 200))<br /> T<br /> &lt;/source&gt;<br /> <br /> ===Find the list of available shells===<br /> <br /> WITH-OPEN-FILE is a macro that opens a file and provides a stream. When the form is returning, the file is automatically closed. FUNCALL calls a function object. The LOOP collects all lines that match the predicate.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun list-matching-lines (file predicate)<br /> &quot;Returns a list of lines in file, for which the predicate applied to<br /> the line returns T.&quot;<br /> (with-open-file (stream file)<br /> (loop for line = (read-line stream nil nil)<br /> while line<br /> when (funcall predicate line)<br /> collect it)))<br /> &lt;/source&gt;<br /> <br /> The function AVAILABLE-SHELLS calls above function LIST-MATCHING-LINES with a pathname and an anonymous function as the predicate. The predicate returns the pathname of a shell or NIL (if the string is not the filename of a shell).<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun available-shells (&amp;optional (file #p&quot;/etc/shells&quot;))<br /> (list-matching-lines<br /> file<br /> (lambda (line)<br /> (and (plusp (length line))<br /> (char= (char line 0) #\/)<br /> (pathname<br /> (string-right-trim '(#\space #\tab) line))))))<br /> &lt;/source&gt;<br /> <br /> Example results (on Mac OS X 10.6):<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> CL-USER &gt; (available-shells)<br /> (#P&quot;/bin/bash&quot; #P&quot;/bin/csh&quot; #P&quot;/bin/ksh&quot; #P&quot;/bin/sh&quot; #P&quot;/bin/tcsh&quot; #P&quot;/bin/zsh&quot;)<br /> &lt;/source&gt;<br /> <br /> ==Comparison with other Lisps==<br /> &lt;!-- needs lots --&gt;<br /> Common Lisp is most frequently compared with, and contrasted to, [[Scheme (programming language)|Scheme]]—if only because they are the two most popular Lisp dialects. Scheme predates CL, and comes not only from the same Lisp tradition but from some of the same engineers—[[Guy L. Steele, Jr.|Guy L. Steele]], with whom [[Gerald Jay Sussman]] designed Scheme, chaired the standards committee for Common Lisp.<br /> <br /> Common Lisp is a general-purpose programming language, in contrast to Lisp variants such as [[Emacs Lisp]] and [[AutoLISP]] which are [[extension languages]] embedded in particular products. Unlike many earlier Lisps, Common Lisp (like [[Scheme (programming language)|Scheme]]) uses lexical variable [[scope (programming)|scope]] by default for both interpreted and compiled code.<br /> <br /> Most of the Lisp systems whose designs contributed to Common Lisp—such as [[ZetaLisp]] and Franz Lisp—used dynamically [[scope (programming)|scoped]] variables in their interpreters and lexically scoped variables in their compilers. Scheme introduced the sole use of lexically scoped variables to Lisp; an inspiration from [[ALGOL 68]] which was widely recognized as a good idea. CL supports dynamically scoped variables as well, but they must be explicitly declared as &quot;special&quot;. There are no differences in scoping between ANSI CL interpreters and compilers.<br /> <br /> Common Lisp is sometimes termed a ''Lisp-2'' and Scheme a ''Lisp-1'', referring to CL's use of separate namespaces for functions and variables. (In fact, CL has ''many'' namespaces, such as those for go tags, block names, and &lt;code&gt;loop&lt;/code&gt; keywords). There is a long-standing controversy between CL and Scheme advocates over the tradeoffs involved in multiple namespaces. In Scheme, it is (broadly) necessary to avoid giving variables names which clash with functions; Scheme functions frequently have arguments named &lt;code&gt;lis&lt;/code&gt;, &lt;code&gt;lst&lt;/code&gt;, or &lt;code&gt;lyst&lt;/code&gt; so as not to conflict with the system function &lt;code&gt;list&lt;/code&gt;. However, in CL it is necessary to explicitly refer to the function namespace when passing a function as an argument—which is also a common occurrence, as in the &lt;code&gt;sort&lt;/code&gt; example above.<br /> <br /> CL also differs from Scheme in its handling of boolean values. Scheme uses the special values #t and #f to represent truth and falsity. CL follows the older Lisp convention of using the symbols T and NIL, with NIL standing also for the empty list. In CL, ''any'' non-NIL value is treated as true by conditionals, such as &lt;code&gt;if&lt;/code&gt;, whereas in Scheme all non-#f values are treated as true. These conventions allow some operators in both languages to serve both as predicates (answering a boolean-valued question) and as returning a useful value for further computation, but in Scheme the value '() which is equivalent to NIL in Common Lisp evaluates to true in a boolean expression.<br /> <br /> Lastly, the Scheme standards documents require [[tail recursion|tail-call optimization]], which the CL standard does not. Most CL implementations do offer tail-call optimization, although often only when the programmer uses an optimization directive. Nonetheless, common CL coding style does not favor the ubiquitous use of recursion that Scheme style prefers—what a Scheme programmer would express with tail recursion, a CL user would usually express with an iterative expression in &lt;code&gt;do&lt;/code&gt;, &lt;code&gt;dolist&lt;/code&gt;, &lt;code&gt;loop&lt;/code&gt;, or (more recently) with the &lt;code&gt;iterate&lt;/code&gt; package.<br /> <br /> ==Implementations==<br /> <br /> See the Category [[:Category:Common Lisp implementations|Common Lisp implementations]].<br /> <br /> Common Lisp is defined by a specification (like [[Ada (programming language)|Ada]] and [[C (programming language)|C]]) rather than by one implementation (like [[Perl]] before version 6). There are many implementations, and the standard details areas in which they may validly differ.<br /> <br /> In addition, implementations tend to come with library packages, which provide functionality not covered in the standard. [[Free and open source software]] libraries have been created to support such features in a portable way, and are most notably found in the repositories of the [http://common-lisp.net/ Common-Lisp.net] and [http://clocc.sourceforge.net/ Common Lisp Open Code Collection] projects.<br /> <br /> Common Lisp implementations may use any mix of native code compilation, byte code compilation or interpretation. Common Lisp has been designed to support [[incremental compiler]]s, file compilers and block compilers. Standard declarations to optimize compilation (such as function inlining or type specialization) are proposed in the language specification. Most Common Lisp implementations compile source code to native [[machine code]]. Some implementations can create (optimized) stand-alone applications. Others compile to interpreted [[bytecode]], which is less efficient than native code, but eases binary-code portability. There are also compilers that compile Common Lisp code to C code. The misconception that Lisp is a purely interpreted language is most likely because Lisp environments provide an interactive prompt and that code is compiled one-by-one, in an incremental way. With Common Lisp incremental compilation is widely used.<br /> <br /> Some [[Unix]]-based implementations ([[CLISP]], [[SBCL]]) can be used as a [[scripting language]]; that is, invoked by the system transparently in the way that a [[Perl]] or [[Unix shell]] interpreter is.&lt;ref&gt;[http://clisp.cons.org/impnotes/quickstart.html#quickstart-unix CLISP as a scripting language under Unix]&lt;/ref&gt;<br /> <br /> ===List of implementations===<br /> <br /> ====Commercial implementations====<br /> <br /> ; [[Allegro Common Lisp]]: for Microsoft Windows, FreeBSD, Linux, Apple Mac OS X and various UNIX variants. Allegro CL provides an [[integrated development environment|Integrated Development Environment (IDE)]] (for Windows and Linux) and extensive capabilities for application delivery.<br /> ; [[Liquid Common Lisp]]: formerly called [[Lucid Common Lisp]]. Only maintenance, no new releases.<br /> ; [[LispWorks]]: for Microsoft Windows, FreeBSD, Linux, Apple Mac OS X and various UNIX variants. LispWorks provides an [[integrated development environment|Integrated Development Environment (IDE)]] (available for all platforms) and extensive capabilities for application delivery.<br /> ; [[mocl]]: for iOS, Android and Mac OS X.<br /> ; [[Open Genera]]: for DEC Alpha.<br /> ; [[Scieneer Common Lisp]]: which is designed for high-performance scientific computing.<br /> <br /> ====Freely redistributable implementations====<br /> <br /> ; Armed Bear Common Lisp (ABCL) : A CL implementation that runs on the [[Java Virtual Machine]].&lt;ref&gt;{{cite web | url = http://common-lisp.net/project/armedbear/ | title = Armed Bear Common Lisp }}&lt;/ref&gt; It includes a compiler to [[Java byte code]], and allows access to Java libraries from CL. It was formerly just a component of the [[Armed Bear J Editor]].<br /> ; [[CLISP]]: A bytecode-compiling implementation, portable and runs on a number of Unix and Unix-like systems (including [[Mac OS X]]), as well as Microsoft Windows and several other systems.<br /> ; [[Clozure CL]] (CCL) : Originally a [[free and open source software|free and open source]] fork of Macintosh Common Lisp. As that history implies, CCL was written for the Macintosh, but Clozure CL now runs on [[Mac OS X]], [[FreeBSD]], [[Linux]], [[Solaris (operating system)|Solaris]] and [[Microsoft Windows|Windows]]. 32 and 64 bit [[x86]] ports are supported on each platform. Additionally there are Power PC ports for Mac OS and Linux. CCL was previously known as OpenMCL, but that name is no longer used, to avoid confusion with the open source version of Macintosh Common Lisp.<br /> ; [[CMUCL]]: Originally from [[Carnegie Mellon University]], now maintained as [[free and open source software]] by a group of volunteers. CMUCL uses a fast native-code compiler. It is available on [[Linux]] and [[Berkeley Software Distribution|BSD]] for Intel x86; [[Linux]] for Alpha; [[Mac OS X]] for Intel x86 and PowerPC; and Solaris, IRIX, and HP-UX on their native platforms.<br /> ; [[Corman Common Lisp]]: for Microsoft Windows. In January 2015 Corman Lisp has been published under MIT license.&lt;ref&gt;{{cite web|title=Corman Lisp sources are now available|url=http://lispblog.xach.com/post/107215169193/corman-lisp-sources-are-now-available}}&lt;/ref&gt;<br /> ; [[Embeddable Common Lisp]] (ECL) : ECL includes a bytecode interpreter and compiler. It can also compile Lisp code to machine code via a C compiler. ECL then compiles Lisp code to C, compiles the C code with a C compiler and can then load the resulting machine code. It is also possible to embed ECL in [[C (programming language)|C]] programs, and C code into Common Lisp programs.<br /> ; [[GNU Common Lisp]] (GCL) : The [[GNU]] Project's Lisp compiler. Not yet fully ANSI-compliant, GCL is however the implementation of choice for several large projects including the mathematical tools [[Maxima (software)|Maxima]], [[Axiom (computer algebra system)|AXIOM]] and (historically) [[ACL2]]. GCL runs on [[Linux]] under eleven different architectures, and also under Windows, Solaris, and [[FreeBSD]].<br /> ; [[Macintosh Common Lisp]] (MCL) : Version 5.2 for Apple Macintosh computers with a PowerPC processor running Mac OS X is open source. RMCL (based on MCL 5.2) runs on Intel-based Apple Macintosh computers using the Rosetta binary translator from Apple.<br /> ; [[ManKai Common Lisp]] (MKCL) : A branch of [[Embeddable Common Lisp|ECL]]. MKCL emphasises reliability, stability and overall code quality through a heavily reworked, natively multi-threaded, runtime system. On Linux, MKCL features a fully POSIX compliant runtime system.<br /> ; [[Movitz]]: Implements a Lisp environment for [[x86]] computers without relying on any underlying OS.<br /> ; [[Poplog]]: Poplog implements a version of CL, with [[POP-11]], and optionally [[Prolog]], and [[Standard ML]] (SML), allowing mixed language programming. For all, the implementation language is POP-11, which is compiled incrementally. It also has an integrated [[Emacs]]-like editor that communicates with the compiler.<br /> ; [[Steel Bank Common Lisp]] (SBCL) : A branch from [[CMUCL]]. &quot;Broadly speaking, SBCL is distinguished from CMU CL by a greater emphasis on maintainability.&quot;&lt;ref&gt;{{cite web<br /> | url = http://sbcl.sourceforge.net/history.html<br /> | title = History and Copyright | work = Steel Bank Common Lisp<br /> }}&lt;/ref&gt; SBCL runs on the platforms CMUCL does, except HP/UX; in addition, it runs on Linux for AMD64, PowerPC, SPARC, MIPS, Windows x86&lt;ref&gt;{{cite web<br /> | url = http://www.sbcl.org/platform-table.html<br /> | title = Platform Table | work = Steel Bank Common Lisp<br /> }}&lt;/ref&gt; and has experimental support for running on Windows AMD64. SBCL does not use an interpreter by default; all expressions are compiled to native code unless the user switches the interpreter on. The SBCL compiler generates fast native code.&lt;ref&gt;[http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?test=all&amp;lang=all SBCL ranks above other dynamic language implementations in the 'Computer Language Benchmark Game']&lt;/ref&gt;<br /> ; [[Ufasoft Common Lisp]]: port of CLISP for windows platform with core written in C++.<br /> <br /> ====Other implementations====<br /> {{unreferenced section|date=July 2013}}<br /> ; Austin Kyoto Common Lisp : an evolution of [[Kyoto Common Lisp]]<br /> ; Butterfly Common Lisp : an implementation written in Scheme for the [[BBN Butterfly]] multi-processor computer<br /> ; CLICC : a Common Lisp to C compiler<br /> ; CLOE : Common Lisp for PCs by [[Symbolics]]<br /> ; Codemist Common Lisp : used for the commercial version of the computer algebra system Axiom<br /> ; ExperCommon Lisp : an early implementation for the Apple Macintosh by ExperTelligence<br /> ; [[Golden Common Lisp]]: an implementation for the PC by GoldHill Inc.<br /> ; Ibuki Common Lisp : a commercialized version of Kyoto Common Lisp<br /> ; [[Kyoto Common Lisp]]: the first Common Lisp compiler that used C as a target language. GCL, ECL and MKCL originate from this Common Lisp implementation.<br /> ; L : a small version of Common Lisp for embedded systems developed by IS Robotics, now iRobot<br /> ; [[Lisp Machine]]s (from [[Symbolics]], TI and Xerox): provided implementations of Common Lisp in addition to their native Lisp dialect (Lisp Machine Lisp or Interlisp). CLOS was also available. Symbolics provides a version of Common Lisp that is based on ANSI Common Lisp.<br /> ; Procyon Common Lisp : an implementation for Windows and Mac OS, used by Franz for their Windows port of Allegro CL<br /> ; Star Sapphire Common LISP : an implementation for the PC<br /> ; [[SubL]]: a variant of Common Lisp used for the implementation of the [[Cyc]] knowledge-based system<br /> ; Top Level Common Lisp : an early implementation for concurrent execution<br /> ; WCL : a shared library implementation<br /> ; [[Vax Common Lisp]]: [[Digital Equipment Corporation]]'s implementation that ran on [[VAX]] systems running [[OpenVMS|VMS]] or [[ULTRIX]]<br /> ; [[XLISP]] by David Betz<br /> <br /> ==Applications==<br /> See the Category [[:Category:Common Lisp software|Common Lisp software]].<br /> <br /> Common Lisp is used to develop research applications (often in Artificial Intelligence), for rapid development of prototypes or for deployed applications.<br /> <br /> Common Lisp is used in many commercial applications, including the [[Yahoo!]] Store web-commerce site, which originally involved [[Paul Graham (computer programmer)|Paul Graham]] and was later rewritten in C++ and Perl.&lt;ref name=&quot;doubt-not-corporate-foolishness&quot;&gt;&quot;In January 2003, Yahoo released a new version of the editor written in C++ and Perl. It's hard to say whether the program is no longer written in Lisp, though, because to translate this program into C++ they literally had to write a Lisp interpreter: the source files of all the page-generating templates are still, as far as I know, Lisp code.&quot; [[Paul Graham (computer programmer)|Paul Graham]], [http://www.paulgraham.com/avg.html Beating the Averages]&lt;/ref&gt; Other notable examples include:<br /> <br /> * [[ACT-R]], a cognitive architecture used in a large number of research projects.<br /> * Authorizer's Assistant,&lt;ref&gt;[http://www.aaai.org/Papers/IAAI/1989/IAAI89-031.pdf Authorizer's Assistant]&lt;/ref&gt;&lt;ref&gt;[http://www.prenhall.com/divisions/bp/app/alter/student/useful/ch9amex.html American Express Authorizer's Assistant]&lt;/ref&gt; a large rule-based system used by American Express, analyzing credit requests.<br /> * [[Cyc]], a long running project with the aim to create a knowledge-based system that provides a huge amount of common sense knowledge<br /> * The [[Dynamic Analysis and Replanning Tool]] (DART), which is said to alone have paid back during the years from 1991 to 1995 for all thirty years of [[DARPA]] investments in AI research.<br /> * G2 from Gensym, a real-time business rules engine (BRE)&lt;ref&gt;[http://www.gensym.com/index.php?option=com_content&amp;view=article&amp;id=47&amp;Itemid=54 Real-time Application Development]. Gensym. Retrieved on 2013-07-17.&lt;/ref&gt;<br /> * [http://www.genworks.com Genworks GDL], based on the open-source [http://github.com/genworks/gendl Gendl] kernel.<br /> * The development environment for the [[Jak and Daxter]] video game series, developed by [[Naughty Dog]].<br /> * [[ITA Software]]'s low fare search engine, used by travel websites such as [[Orbitz]] and [[Kayak.com]] and airlines such as [[American Airlines]], [[Continental Airlines]] and [[US Airways]].<br /> * [[Mirai (software)|Mirai]], a 3d graphics suite. It was used to animate the face of Gollum in the movie Lord of the Rings: The Two Towers.<br /> * [[Prototype Verification System]] (PVS), a mechanized environment for formal specification and verification.<br /> * PWGL is a sophisticated visual programming environment based on Common Lisp, used in [[Computer assisted composition]] and sound synthesis.&lt;ref&gt;[http://www2.siba.fi/PWGL/ PWGL - Home]. . Retrieved on 2013-07-17.&lt;/ref&gt; <br /> * SPIKE, a scheduling system for earth or space based observatories and satellites, notably the Hubble Space Telescope.&lt;ref&gt;[http://www.stsci.edu/resources/software_hardware/spike/ Spike Planning and Scheduling System]. Stsci.edu. Retrieved on 2013-07-17.&lt;/ref&gt;<br /> <br /> There also exist open-source applications written in Common Lisp, such as:<br /> <br /> * [[ACL2]], a full-featured [[automated theorem prover]] for an [[applicative programming language|applicative]] variant of Common Lisp.<br /> * [[Axiom (computer algebra system)|Axiom]], a sophisticated [[computer algebra system]].<br /> * [[Maxima (software)|Maxima]], a sophisticated [[computer algebra system]].<br /> * [[OpenMusic]] is an object-oriented visual programming environment based on Common Lisp, used in [[Computer assisted composition]].<br /> * [[Stumpwm]], a tiling, keyboard driven X11 Window Manager written entirely in Common Lisp.<br /> <br /> ==Libraries==<br /> <br /> Since 2011 Zach Beane, with support of the Common Lisp Foundation, maintains the [[Quicklisp]] library manager. It allows easy access to several hundred libraries written in Common Lisp.<br /> <br /> ==See also==<br /> {{Portal|Computer Science|Computer programming}}<br /> *''[[Common Lisp the Language]]''<br /> *''[[On Lisp]]''<br /> *''[[Practical Common Lisp]]''<br /> {{Clear}}<br /> <br /> ==References==<br /> {{Reflist|2}}<br /> <br /> ==Bibliography==<br /> A chronological list of books published (or about to be published) about Common Lisp (the language) or about programming with Common Lisp (especially AI programming).<br /> {{Refbegin|2}}<br /> * [[Guy L. Steele]]: ''Common Lisp the Language, 1st Edition'', Digital Press, 1984, ISBN 0-932376-41-X<br /> * [[Rodney Allen Brooks]]: ''Programming in Common Lisp'', John Wiley and Sons Inc, 1985, ISBN 0-471-81888-7<br /> * [[Richard P. Gabriel]]: ''Performance and Evaluation of Lisp Systems'', The MIT Press, 1985, ISBN 0-262-57193-5, [http://www.dreamsongs.com/Files/Timrep.pdf PDF]<br /> * [[Robert Wilensky]]: ''Common LISPcraft'', W.W. Norton &amp; Co., 1986, ISBN 0-393-95544-3<br /> * [[Eugene Charniak]], [[Christopher K. Riesbeck]], [[Drew V. McDermott]], [[James R. Meehan]]: ''Artificial Intelligence Programming, 2nd Edition'', Lawrence Erlbaum, 1987, ISBN 0-89859-609-2<br /> * [[Wendy L. Milner]]: ''Common Lisp: A Tutorial'', Prentice Hall, 1987, ISBN 0-13-152844-0<br /> * [[Deborah G. Tatar]]: ''A Programmer's Guide to Common Lisp'', Longman Higher Education, 1987, ISBN 0-13-728940-5<br /> * [[Taiichi Yuasa]], [[Masami Hagiya]]: ''Introduction to Common Lisp'', Elsevier Ltd, 1987, ISBN 0-12-774860-1<br /> * [[Christian Queinnec]], [[Jerome Chailloux]]: ''Lisp Evolution and Standardization'', Ios Pr Inc., 1988, ISBN 90-5199-008-1<br /> * [[Taiichi Yuasa]], [[Richard Weyhrauch]], [[Yasuko Kitajima]]: ''Common Lisp Drill'', Academic Press Inc, 1988, ISBN 0-12-774861-X<br /> * [[Wade L. Hennessey]]: ''Common Lisp'', McGraw-Hill Inc., 1989, ISBN 0-07-028177-7<br /> * [[Tony Hasemer]], [[John Dominque]]: ''Common Lisp Programming for Artificial Intelligence'', Addison-Wesley Educational Publishers Inc, 1989, ISBN 0-201-17579-7<br /> * [[Sonya E. Keene]]: ''Object-Oriented Programming in Common Lisp: A Programmer's Guide to CLOS'', Addison-Wesley, 1989, ISBN 0-201-17589-4<br /> * [[David Jay Steele]]: ''Golden Common Lisp: A Hands-On Approach'', Addison Wesley, 1989, ISBN 0-201-41653-0<br /> * [[David S. Touretzky]]: ''Common Lisp: A Gentle Introduction to Symbolic Computation'', Benjamin-Cummings, 1989, ISBN 0-8053-0492-4. [http://www.cs.cmu.edu/~dst/LispBook/ Web/PDF] Dover reprint (2013) ISBN 978-0486498201<br /> * [[Christopher K. Riesbeck]], [[Roger C. Schank]]: ''Inside Case-Based Reasoning'', Lawrence Erlbaum, 1989, ISBN 0-89859-767-6<br /> * [[Patrick Winston]], [[Berthold Horn]]: ''Lisp, 3rd Edition'', Addison-Wesley, 1989, ISBN 0-201-08319-1, [http://people.csail.mit.edu/phw/Books/LISPBACK.HTML Web]<br /> * [[Gerard Gazdar]], [[Chris Mellish]]: ''Natural Language Processing in LISP: An Introduction to Computational Linguistics'', Addison-Wesley Longman Publishing Co., 1990, ISBN 0-201-17825-7<br /> * [[Patrick R. Harrison]]: ''Common Lisp and Artificial Intelligence'', Prentice Hall PTR, 1990, ISBN 0-13-155243-0<br /> * [[Timothy Koschmann]]: ''The Common Lisp Companion'', John Wiley &amp; Sons, 1990, ISBN 0-471-50308-8<br /> * [[Molly M. Miller]], [[Eric Benson]]: ''Lisp Style &amp; Design'', Digital Press, 1990, ISBN 1-55558-044-0<br /> * [[Guy L. Steele]]: ''[[Common Lisp the Language]], 2nd Edition'', Digital Press, 1990, ISBN 1-55558-041-6, [http://www.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html Web]<br /> * [[Steven L. Tanimoto]]: ''The Elements of Artificial Intelligence Using Common Lisp'', Computer Science Press, 1990, ISBN 0-7167-8230-8<br /> * [[Peter Lee (computer scientist)|Peter Lee]]: ''Topics in Advanced Language Implementation'', The MIT Press, 1991, ISBN 0-262-12151-4<br /> * [[John H. Riley]]: ''A Common Lisp Workbook'', Prentice Hall, 1991, ISBN 0-13-155797-1<br /> * [[Peter Norvig]]: ''Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp'', Morgan Kaufmann, 1991, ISBN 1-55860-191-0, [http://norvig.com/paip.html Web]<br /> * [[Gregor Kiczales]], [[Jim des Rivieres]], [[Daniel G. Bobrow]]: ''The Art of the Metaobject Protocol'', The MIT Press, 1991, ISBN 0-262-61074-4<br /> * [[Jo A. Lawless]], [[Molly M. Miller]]: ''Understanding CLOS: The Common Lisp Object System'', Digital Press, 1991, ISBN 0-13-717232-X<br /> * Mark Watson: ''Common Lisp Modules: Artificial Intelligence in the Era of Neural Networks and Chaos Theory'', Springer Verlag New York Inc., 1991, ISBN 0-387-97614-0<br /> * [[James L. Noyes]]: ''Artificial Intelligence with Common Lisp: Fundamentals of Symbolic and Numeric Processing'', Jones &amp; Bartlett Pub, 1992, ISBN 0-669-19473-5<br /> * [[Stuart C. Shapiro]]: ''COMMON LISP: An Interactive Approach'', Computer Science Press, 1992, ISBN 0-7167-8218-9, [http://www.cse.buffalo.edu/pub/WWW/faculty/shapiro/Commonlisp/ Web/PDF]<br /> * [[Kenneth D. Forbus]], [[Johan de Kleer]]: ''Building Problem Solvers'', The MIT Press, 1993, ISBN 0-262-06157-0<br /> * [[Andreas Paepcke]]: ''Object-Oriented Programming: The CLOS Perspective'', The MIT Press, 1993, ISBN 0-262-16136-2<br /> * [[Paul Graham (computer programmer)|Paul Graham]]: ''[[On Lisp]]'', Prentice Hall, 1993, ISBN 0-13-030552-9, [http://www.paulgraham.com/onlisp.html Web/PDF]<br /> * [[Paul Graham (computer programmer)|Paul Graham]]: ''ANSI Common Lisp'', Prentice Hall, 1995, ISBN 0-13-370875-6<br /> * [[Otto Mayer]]: ''Programmieren in Common Lisp'', German, Spektrum Akademischer Verlag, 1995, ISBN 3-86025-710-2<br /> * [[Stephen Slade]]: ''Object-Oriented Common Lisp'', Prentice Hall, 1997, ISBN 0-13-605940-6<br /> * [[Richard P. Gabriel]]: ''Patterns of Software: Tales from the Software Community'', Oxford University Press, 1998, ISBN 0-19-512123-6, [http://www.dreamsongs.org/Files/PatternsOfSoftware.pdf PDF]<br /> * [[Taiichi Yuasa]], [[Hiroshi G. Okuno]]: ''Advanced Lisp Technology'', CRC, 2002, ISBN 0-415-29819-9<br /> * [[David B. Lamkins]]: ''Successful Lisp: How to Understand and Use Common Lisp'', bookfix.com, 2004. ISBN 3-937526-00-5, [http://www.psg.com/~dlamkins/sl/contents.html Web]<br /> * [[Peter Seibel]]: ''[[Practical Common Lisp]]'', Apress, 2005. ISBN 1-59059-239-5, [http://www.gigamonkeys.com/book/ Web]<br /> * [[Doug Hoyte]]: ''Let Over Lambda'', Lulu.com, 2008, ISBN 1-4357-1275-7, [http://letoverlambda.com/ Web]<br /> * [[George F. Luger]], [[William A. Stubblefield]]: ''AI Algorithms, Data Structures, and Idioms in Prolog, Lisp and Java'', Addison Wesley, 2008, ISBN 0-13-607047-7, [http://wps.aw.com/wps/media/objects/5771/5909832/PDF/Luger_0136070477_1.pdf PDF]<br /> * [[Conrad Barski]]: ''Land of Lisp: Learn to program in Lisp, one game at a time!'', No Starch Press, 2010, ISBN 1-59327-200-6, [http://www.lisperati.com/landoflisp/ Web]<br /> * [[Pavel Penev]]: ''Lisp Web Tales'', Leanpub, 2013, [https://leanpub.com/lispwebtales Web]<br /> {{Refend}}<br /> <br /> ==External links==<br /> {{Wikibooks}}<br /> * The [http://www.cliki.net/ CLiki], a Wiki for [[free and open source software|free and open source]] Common Lisp systems running on Unix-like systems.<br /> * [http://www.common-lisp.net/ Common Lisp software repository].<br /> * {{cite web | url = http://www.lispworks.com/documentation/HyperSpec/Body/01_ab.htm | title = History | work = [[Common Lisp HyperSpec]] }}<br /> * [http://www.flownet.com/gat/jpl-lisp.html Lisping at JPL]<br /> * [http://www.defmacro.org/ramblings/lisp.html The Nature of Lisp] Essay that examines Lisp by comparison with XML.<br /> * [http://common-lisp.net/~dlw/LispSurvey.html Common Lisp Implementations: A Survey] Survey of maintained Common Lisp implementations.<br /> * [http://clqr.boundp.org Common Lisp Quick Reference]<br /> * [http://planet.lisp.org Planet Lisp] Articles about Common Lisp.<br /> <br /> {{Common Lisp}}<br /> <br /> [[Category:Common Lisp]]<br /> [[Category:Multi-paradigm programming languages]]<br /> [[Category:Functional languages]]<br /> [[Category:Dynamically typed programming languages]]<br /> [[Category:Dynamic programming languages]]<br /> [[Category:Object-oriented programming languages]]<br /> [[Category:Class-based programming languages]]<br /> [[Category:Procedural programming languages]]<br /> [[Category:Extensible syntax programming languages]]<br /> [[Category:Lisp programming language family]]<br /> [[Category:Lisp (programming language)]]<br /> [[Category:Articles with example Lisp code]]<br /> [[Category:Cross-platform software]]<br /> [[Category:Cross-platform free software]]<br /> [[Category:Programming languages created in 1984]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Common_Lisp&diff=689833267 Common Lisp 2015-11-09T18:03:15Z <p>PuercoPop: /* Birthday paradox */ Wording</p> <hr /> <div>{{Infobox programming language<br /> | name = Common Lisp<br /> | family = [[Lisp (programming language)|Lisp]]<br /> | paradigm = [[Multi-paradigm programming language|Multi-paradigm]]: [[procedural programming|procedural]], [[functional programming|functional]], [[object-oriented programming|object-oriented]], [[metaprogramming|meta]], [[reflective programming|reflective]], [[generic programming|generic]]<br /> | generation = [[3GL]]<br /> | released = 1984, 1994 for ANSI Common Lisp<br /> | designer = [[Scott Fahlman]], [[Richard P. Gabriel]], [[Dave Moon]], [[Guy Steele]], [[Dan Weinreb]]<br /> | developer = ANSI [[X3J13]] committee<br /> | standard reference = [[Common Lisp HyperSpec]]<br /> | latest release version =<br /> | latest release date =<br /> | typing = [[Dynamic typing|dynamic]], [[Strongly-typed programming language|strong]]<br /> | scope = lexical, optionally dynamic<br /> | namespace style = Lisp-2<br /> | implementations = [[Allegro Common Lisp|Allegro CL]], [[Armed Bear Common Lisp|ABCL]], [[CLISP]], [[Clozure CL]], [[CMUCL]], [[Embeddable Common Lisp|ECL]], [[GNU Common Lisp|GCL]], [[LispWorks]], [[Scieneer Common Lisp|Scieneer CL]], [[SBCL]], [[Genera (operating system)|Symbolics Common Lisp]]<br /> | dialects = CLtL1, CLtL2, ANSI Common Lisp<br /> | influenced_by = [[Lisp (programming language)|Lisp]], [[Lisp Machine Lisp]], [[Maclisp]], [[Scheme (programming language)|Scheme]], [[Interlisp]]<br /> | influenced = [[Clojure]], [[Dylan (programming language)|Dylan]], [[Emacs Lisp]], [[EuLisp]], [[ISLISP]], [[Julia (programming language)|Julia]], [[Moose (Perl)|Moose]], [[R (programming language)|R]], [[Cadence SKILL|SKILL]], [[SubL]]<br /> | operating_system = [[Cross-platform]]<br /> | license =<br /> | website = {{URL|http://common-lisp.net/}}<br /> | file_ext = .lisp, .lsp, .l, .cl, .fasl<br /> }}<br /> <br /> '''Common Lisp''' ('''CL''') is a dialect of the [[Lisp (programming language)|Lisp]] [[programming language]], published in [[American National Standards Institute|ANSI]] standard document ''ANSI INCITS 226-1994 (R2004)'' (formerly ''X3.226-1994 (R1999)'').&lt;ref&gt;Quoted from cover of cited standard. ANSI INCITS 226-1994 (R2004), for sale on standard's [http://webstore.ansi.org/RecordDetail.aspx?sku=ANSI+INCITS+226-1994+(R2004) document page].&lt;/ref&gt; From the ANSI Common Lisp standard the [[Common Lisp HyperSpec]], a hyperlinked HTML version, has been derived.&lt;ref&gt;[http://www.lispworks.com/documentation/HyperSpec/Front/Help.htm#Authorship Authorship of the Common Lisp HyperSpec]&lt;/ref&gt;<br /> <br /> The Common Lisp language was developed as a standardized and improved successor of [[Maclisp]]. Thus it is not an implementation, but rather a language [[specification]].&lt;ref&gt;[http://www.lispworks.com/documentation/HyperSpec/Body/01_ab.htm Common Lisp HyperSpec 1.1.2 History]&lt;/ref&gt; Several [[#Implementations|implementations]] of the Common Lisp standard are available, including [[free and open source software]] and proprietary products.&lt;ref&gt;[http://common-lisp.net/~dlw/LispSurvey.html Common Lisp Implementations: A Survey]&lt;/ref&gt;<br /> <br /> The first language documentation was published 1984 as [[Common Lisp the Language]], first edition. A second edition, published in 1990, incorporated many changes to the language, made during the ANSI Common Lisp standardization process. The final ANSI Common Lisp standard then was published in 1994. Since then no update to the standard has been published. Various extensions and improvements to Common Lisp (examples are Unicode, Concurrency, CLOS-based IO) have been provided by implementations.<br /> <br /> Common Lisp is a general-purpose, [[multi-paradigm programming language]]. It supports a combination of [[procedural programming|procedural]], [[functional programming|functional]], and [[object-oriented programming]] paradigms. As a [[dynamic programming language]], it facilitates evolutionary and [[Iterative and incremental development|incremental software development]], with iterative [[Compiler|compilation]] into efficient run-time programs. This incremental development is often done interactively without interrupting the running application.<br /> <br /> It also supports optional type annotation and casting, which can be added as necessary at the later profiling and optimization stages, to permit the compiler to generate more efficient code. For instance, &lt;code&gt;fixnum&lt;/code&gt; can hold an [[Boxing (computer science)|unboxed]] integer in a range supported by the hardware and implementation, permitting more efficient arithmetic than on big integers or arbitrary precision types. Similarly, the compiler can be told on a per-module or per-function basis which type safety level is wanted, using ''optimize'' declarations.<br /> <br /> Common Lisp includes [[Common Lisp Object System|CLOS]], an [[object system]] that supports [[multimethods]] and method combinations. It is often implemented with a [[Metaobject]] Protocol.<br /> <br /> Common Lisp is extensible through standard features such as Lisp [[Macro (computer science)|macros]] (code transformations) and reader macros (input parsers for characters).<br /> <br /> Common Lisp provides some backwards compatibility to [[Maclisp]] and to John McCarthy's original [[Lisp (programming language)|Lisp]]. This allows older Lisp software to be ported to Common Lisp.&lt;ref&gt;{{cite web<br /> | url = http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html<br /> | title = Old LISP programs still run in Common Lisp | accessdate = 2015-05-13<br /> }}&lt;/ref&gt;<br /> <br /> ==Syntax==<br /> <br /> Common Lisp is a dialect of Lisp; it uses [[S-expression]]s to denote both code and data structure. Function calls, macro forms and special forms are written as lists, with the name of the function first, as in these examples:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (+ 2 2) ; adds 2 and 2, yielding 4. The function's name is '+'. Lisp has no operators as such.<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defvar *x*) ; Ensures that a variable *x* exists,<br /> ; without giving it a value. The asterisks are part of<br /> ; the name, by convention denoting a special (global) variable. <br /> ; The symbol *x* is also hereby endowed with the property that<br /> ; subsequent bindings of it are dynamic, rather than lexical.<br /> (setf *x* 42.1) ; sets the variable *x* to the floating-point value 42.1<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Define a function that squares a number:<br /> (defun square (x)<br /> (* x x))<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Execute the function:<br /> (square 3) ; Returns 9<br /> &lt;/source&gt;<br /> &lt;!-- I truncated this a bit; in smaller browsers, it runs off the side--&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; the 'let' construct creates a scope for local variables. Here<br /> ;; the variable 'a' is bound to 6 and the variable 'b' is bound<br /> ;; to 4. Inside the 'let' is a 'body', where the last computed value is returned.<br /> ;; Here the result of adding a and b is returned from the 'let' expression.<br /> ;; The variables a and b have lexical scope, unless the symbols have been<br /> ;; marked as special variables (for instance by a prior DEFVAR).<br /> (let ((a 6)<br /> (b 4))<br /> (+ a b)) ; returns 10<br /> &lt;/source&gt;<br /> <br /> ==Data types==<br /> Common Lisp has many data types.<br /> <br /> ===Scalar types===<br /> ''Number'' types include [[integer]]s, [[ratio]]s, [[Floating point|floating-point number]]s, and [[complex number]]s.&lt;ref name=&quot;reddy&quot;&gt;{{cite web<br /> | url = http://random-state.net/features-of-common-lisp.html<br /> | title = Features of Common Lisp<br /> | first = Abhishek | last = Reddy<br /> | date = 2008-08-22<br /> }}&lt;/ref&gt; Common Lisp uses [[Arbitrary-precision arithmetic|bignum]]s to represent numerical values of arbitrary size and precision. The ratio type represents fractions exactly, a facility not available in many languages. Common Lisp automatically coerces numeric values among these types as appropriate.<br /> <br /> The Common Lisp ''[[character (computing)|character]]'' type is not limited to [[ASCII]] characters. Most modern implementations allow [[Unicode]] characters.&lt;ref&gt;{{cite web<br /> | url = http://www.cliki.net/Unicode%20Support<br /> | title = Unicode support | work = The Common Lisp Wiki | accessdate = 2008-08-21<br /> }}&lt;/ref&gt;<br /> <br /> The ''[[Symbol (programming)|symbol]]'' type is common to Lisp languages, but largely unknown outside them. A symbol is a unique, named data object with several parts: name, value, function, property list and package. Of these, ''value cell'' and ''function cell'' are the most important. Symbols in Lisp are often used similarly to identifiers in other languages: to hold the value of a variable; however there are many other uses. Normally, when a symbol is evaluated, its value is returned. Some symbols evaluate to themselves, for example all symbols in the keyword package are self-evaluating. Boolean values in Common Lisp are represented by the self-evaluating symbols T and NIL. Common Lisp has namespaces for symbols, called 'packages'.<br /> <br /> A number of functions are available for [[rounding]] scalar numeric values in various ways. The function &lt;code&gt;round&lt;/code&gt; rounds the argument to the nearest integer, with halfway cases rounded to the even integer. The functions &lt;code&gt;truncate&lt;/code&gt;, &lt;code&gt;floor&lt;/code&gt;, and &lt;code&gt;ceiling&lt;/code&gt; round towards zero, down, or up respectively. All these functions return the discarded fractional part as a secondary value. For example, &lt;code&gt;(floor -2.5)&lt;/code&gt; yields -3, 0.5; &lt;code&gt;(ceiling -2.5)&lt;/code&gt; yields -2, -0.5; &lt;code&gt;(round 2.5)&lt;/code&gt; yields 2, 0.5; and &lt;code&gt;(round 3.5)&lt;/code&gt; yields 4, -0.5.<br /> <br /> ===Data structures===<br /> ''Sequence'' types in Common Lisp include lists, vectors, bit-vectors, and strings. There are many operations which can work on any sequence type.<br /> <br /> As in almost all other Lisp dialects, ''lists'' in Common Lisp are composed of ''conses'', sometimes called ''cons cells'' or ''pairs''. A cons is a data structure with two slots, called its ''car'' and ''cdr''. A list is a linked chain of conses or the empty list. Each cons's car refers to a member of the list (possibly another list). Each cons's cdr refers to the next cons—except for the last cons in a list, whose cdr refers to the &lt;code&gt;nil&lt;/code&gt; value. Conses can also easily be used to implement trees and other complex data structures; though it is usually advised to use structure or class instances instead. It is also possible to create circular data structures with conses.<br /> <br /> Common Lisp supports multidimensional ''arrays'', and can dynamically resize ''adjustable'' arrays if required. Multidimensional arrays can be used for matrix mathematics. A ''vector'' is a one-dimensional array. Arrays can carry any type as members (even mixed types in the same array) or can be specialized to contain a specific type of members, as in a vector of bits. Usually only a few types are supported. Many implementations can optimize array functions when the array used is type-specialized. Two type-specialized array types are standard: a ''string'' is a vector of characters, while a ''bit-vector'' is a vector of [[bit]]s.<br /> <br /> ''[[Hash table]]s'' store associations between data objects. Any object may be used as key or value. Hash tables are automatically resized as needed.<br /> <br /> ''Packages'' are collections of symbols, used chiefly to separate the parts of a program into [[namespaces]]. A package may ''export'' some symbols, marking them as part of a public interface. Packages can use other packages.<br /> <br /> ''Structures'', similar in use to [[C (programming language)|C]] structs and [[Pascal (programming language)|Pascal]] records, represent arbitrary complex data structures with any number and type of fields (called ''slots''). Structures allow single-inheritance.<br /> <br /> ''Classes'' are similar to structures, but offer more dynamic features and multiple-inheritance. (See [[Common Lisp Object System|CLOS]]). Classes have been added late to Common Lisp and there is some conceptual overlap with structures. Objects created of classes are called ''Instances''. A special case are Generic Functions. Generic Functions are both functions and instances.<br /> <br /> ===Functions===<br /> Common Lisp supports [[first-class function]]s. For instance, it is possible to write functions that take other functions as arguments or return functions as well. This makes it possible to describe very general operations.<br /> <br /> The Common Lisp library relies heavily on such higher-order functions. For example, the &lt;code&gt;sort&lt;/code&gt; function takes a [[relational operator]] as an argument and key function as an optional keyword argument. This can be used not only to sort any type of data, but also to sort data structures according to a key.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Sorts the list using the &gt; and &lt; function as the relational operator.<br /> (sort (list 5 2 6 3 1 4) #'&gt;) ; Returns (6 5 4 3 2 1)<br /> (sort (list 5 2 6 3 1 4) #'&lt;) ; Returns (1 2 3 4 5 6)<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Sorts the list according to the first element of each sub-list.<br /> (sort (list '(9 A) '(3 B) '(4 C)) #'&lt; :key #'first) ; Returns ((3 B) (4 C) (9 A))<br /> &lt;/source&gt;<br /> <br /> The evaluation model for functions is very simple. When the evaluator encounters a form &lt;code&gt;(f a1 a2...)&lt;/code&gt; then it presumes that the symbol named f is one of the following:<br /> <br /> # A special operator (easily checked against a fixed list)<br /> # A macro operator (must have been defined previously)<br /> # The name of a function (default), which may either be a symbol, or a sub-form beginning with the symbol &lt;code&gt;lambda&lt;/code&gt;.<br /> <br /> If f is the name of a function, then the arguments a1, a2, ..., an are evaluated in left-to-right order, and the function is found and invoked with those values supplied as parameters.<br /> <br /> ====Defining functions====<br /> The [[Defun|macro &lt;code&gt;defun&lt;/code&gt;]] defines functions where a function definition gives the name of the function, the names of any arguments, and a function body:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun square (x)<br /> (* x x))<br /> &lt;/source&gt;<br /> <br /> Function definitions may include compiler [[Directive (programming)|directives]], known as ''declarations'', which provide hints to the compiler about optimization settings or the data types of arguments. They may also include ''documentation strings'' (docstrings), which the Lisp system may use to provide interactive documentation:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun square (x)<br /> &quot;Calculates the square of the single-float x.&quot;<br /> (declare (single-float x) (optimize (speed 3) (debug 0) (safety 1)))<br /> (the single-float (* x x)))<br /> &lt;/source&gt;<br /> <br /> Anonymous functions ([[function literal]]s) are defined using &lt;code&gt;lambda&lt;/code&gt; expressions, e.g. &lt;code&gt;(lambda&amp;nbsp;(x)&amp;nbsp;(*&amp;nbsp;x&amp;nbsp;x))&lt;/code&gt; for a function that squares its argument. Lisp programming style frequently uses higher-order functions for which it is useful to provide anonymous functions as arguments.<br /> <br /> Local functions can be defined with &lt;code&gt;flet&lt;/code&gt; and &lt;code&gt;labels&lt;/code&gt;.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (flet ((square (x)<br /> (* x x)))<br /> (square 3))<br /> &lt;/source&gt;<br /> <br /> There are a number of other operators related to the definition and manipulation of functions. For instance, a function may be compiled with the &lt;code&gt;compile&lt;/code&gt; operator. (Some Lisp systems run functions using an interpreter by default unless instructed to compile; others compile every function).<br /> <br /> ====Defining generic functions and methods====<br /> The macro &lt;code&gt;defgeneric&lt;/code&gt; defines generic functions.<br /> The macro &lt;code&gt;defmethod&lt;/code&gt; defines methods. Generic functions are a collection of methods.<br /> <br /> Methods can specialize their parameters over CLOS ''standard classes'', ''system classes'', ''structure classes'' or objects. For many types there are corresponding ''system classes''.<br /> <br /> When a generic function is called, multiple-dispatch will determine the effective method to use.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defgeneric add (a b))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a number) (b number))<br /> (+ a b))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a vector) (b number))<br /> (map 'vector (lambda (n) (+ n b)) a))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a vector) (b vector))<br /> (map 'vector #'+ a b))<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a string)(b string))<br /> (concatenate 'string a b) )<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (add 2 3) ; returns 5<br /> (add #(1 2 3 4) 7) ; returns #(8 9 10 11)<br /> (add #(1 2 3 4) #(4 3 2 1)) ; returns #(5 5 5 5)<br /> (add &quot;COMMON &quot; &quot;LISP&quot;) ; returns &quot;COMMON LISP&quot;<br /> &lt;/source&gt;<br /> <br /> Generic Functions are also a first class data type. There are many more features to Generic Functions and Methods than described above.<br /> <br /> ====The function namespace====<br /> &lt;!-- This section name is linked from several places; if you change it, update the links. --&gt;<br /> <br /> The namespace for function names is separate from the namespace for data variables. This is a key difference between Common Lisp and [[Scheme (programming language)|Scheme]]. For Common Lisp, operators that define names in the function namespace include &lt;code&gt;defun&lt;/code&gt;, &lt;code&gt;flet&lt;/code&gt;, &lt;code&gt;labels&lt;/code&gt;, &lt;code&gt;defmethod&lt;/code&gt; and &lt;code&gt;defgeneric&lt;/code&gt;.<br /> <br /> To pass a function by name as an argument to another function, one must use the &lt;code&gt;function&lt;/code&gt; special operator, commonly abbreviated as &lt;code&gt;#'&lt;/code&gt;. The first &lt;code&gt;sort&lt;/code&gt; example above refers to the function named by the symbol &lt;code&gt;&amp;gt;&lt;/code&gt; in the function namespace, with the code &lt;code&gt;#'&amp;gt;&lt;/code&gt;. Conversely, to call a function passed in such a way, one would use the &lt;code&gt;funcall&lt;/code&gt; operator on the argument.<br /> <br /> [[Scheme (programming language)|Scheme's]] evaluation model is simpler: there is only one namespace, and all positions in the form are evaluated (in any order) -- not just the arguments. Code written in one dialect is therefore sometimes confusing to programmers more experienced in the other. For instance, many Common Lisp programmers like to use descriptive variable names such as ''list'' or ''string'' which could cause problems in Scheme, as they would locally shadow function names.<br /> <br /> Whether a separate namespace for functions is an advantage is a source of contention in the Lisp community. It is usually referred to as the ''Lisp-1 vs. Lisp-2 debate''. Lisp-1 refers to Scheme's model and Lisp-2 refers to Common Lisp's model. These names were coined in a 1988 paper by [[Richard P. Gabriel]] and [[Kent Pitman]], which extensively compares the two approaches.&lt;ref&gt;{{cite journal |title=Technical Issues of Separation in Function Cells and Value Cells |url=http://www.nhplace.com/kent/Papers/Technical-Issues.html |authors=Richard P. Gabriel, Kent M. Pitman |journal=Lisp and Symbolic Computation |date = June 1988|volume=1 |issue=1 |pages=81–101 |doi=10.1007/bf01806178}}&lt;/ref&gt;<br /> <br /> ===Other types===<br /> Other data types in Common Lisp include:<br /> <br /> *''Pathnames'' represent files and directories in the [[filesystem]]. The Common Lisp pathname facility is more general than most operating systems' file naming conventions, making Lisp programs' access to files broadly portable across diverse systems.<br /> *Input and output ''streams'' represent sources and sinks of binary or textual data, such as the terminal or open files.<br /> *Common Lisp has a built-in [[pseudo-random number generator]] (PRNG). ''Random state'' objects represent reusable sources of pseudo-random numbers, allowing the user to seed the PRNG or cause it to replay a sequence.<br /> *''Conditions'' are a type used to represent errors, exceptions, and other &quot;interesting&quot; events to which a program may respond.<br /> *''Classes'' are [[first-class object]]s, and are themselves instances of classes called [[metaclasses|metaobject classes]] ([[metaclasses]] for short).<br /> *''Readtables'' are a type of object which control how Common Lisp's reader parses the text of source code. By controlling which readtable is in use when code is read in, the programmer can change or extend the language's syntax.<br /> <br /> ==Scope==<br /> <br /> Like programs in many other programming languages, Common Lisp programs make use of names to refer to variables, functions, and many other kinds of entities. Named references are subject to scope.<br /> <br /> The association between a name and the entity which the name refers to is called a binding.<br /> <br /> Scope refers to the set of circumstances in which a name is determined to have a particular binding.<br /> <br /> ===Determiners of scope===<br /> <br /> The circumstances which determine scope in Common Lisp include:<br /> <br /> * the location of a reference within an expression. If it's the leftmost position of a compound, it refers to a special operator or a macro or function binding, otherwise to a variable binding or something else.<br /> * the kind of expression in which the reference takes place. For instance, &lt;code&gt;(go x)&lt;/code&gt; means transfer control to label &lt;code&gt;x&lt;/code&gt;, whereas &lt;code&gt;(print x)&lt;/code&gt; refers to the variable &lt;code&gt;x&lt;/code&gt;. Both scopes of &lt;code&gt;x&lt;/code&gt; can be active in the same region of program text, since tagbody labels are in a separate namespace from variable names. A special form or macro form has complete control over the meanings of all symbols in its syntax. For instance in &lt;code&gt;(defclass x (a b) ())&lt;/code&gt;, a class definition, the &lt;code&gt;(a b)&lt;/code&gt; is a list of base classes, so these names are looked up in the space of class names, and &lt;code&gt;x&lt;/code&gt; isn't a reference to an existing binding, but the name of a new class being derived from &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;. These facts emerge purely from the semantics of &lt;code&gt;defclass&lt;/code&gt;. The only generic fact about this expression is that &lt;code&gt;defclass&lt;/code&gt; refers to a macro binding; everything else is up to &lt;code&gt;defclass&lt;/code&gt;.<br /> * the location of the reference within the program text. For instance, if a reference to variable &lt;code&gt;x&lt;/code&gt; is enclosed in a binding construct such as a &lt;code&gt;let&lt;/code&gt; which defines a binding for &lt;code&gt;x&lt;/code&gt;, then the reference is in the scope created by that binding.<br /> * for a variable reference, whether or not a variable symbol has been, locally or globally, declared special. This determines whether the reference is resolved within a lexical environment, or within a dynamic environment.<br /> * the specific instance of the environment in which the reference is resolved. An environment is a run-time dictionary which maps symbols to bindings. Each kind of reference uses its own kind of environment. References to lexical variables are resolved in a lexical environment, et cetera. More than one environment can be associated with the same reference. For instance, thanks to recursion or the use of multiple threads, multiple activations of the same function can exist at the same time. These activations share the same program text, but each has its own lexical environment instance.<br /> <br /> To understand what a symbol refers to, the Common Lisp programmer must know what kind of reference is being expressed, what kind of scope it uses if it is a variable reference (dynamic versus lexical scope), and also the run-time situation: in what environment is the reference resolved, where was the binding introduced into the environment, et cetera.<br /> <br /> ===Kinds of environment===<br /> <br /> ====Global====<br /> <br /> Some environments in Lisp are globally pervasive. For instance, if a new type is defined, it is known everywhere thereafter. References to that type look it up in this global environment.<br /> <br /> ====Dynamic====<br /> <br /> One type of environment in Common Lisp is the dynamic environment. Bindings established in this environment have dynamic extent, which means that a binding is established at the start of the execution of some construct, such as a &lt;code&gt;let&lt;/code&gt; block, and disappears when that construct finishes executing: its lifetime is tied to the dynamic activation and deactivation of a block. However, a dynamic binding is not just visible within that block; it is also visible to all functions invoked from that block. This type of visibility is known as indefinite scope. Bindings which exhibit dynamic extent (lifetime tied to the activation and deactivation of a block) and indefinite scope (visible to all functions which are called from that block) are said to have dynamic scope.<br /> <br /> Common Lisp has support for dynamically scoped variables, which are also called special variables. Certain other kinds of bindings are necessarily dynamically scoped also, such as restarts and catch tags. Function bindings cannot be dynamically scoped using &lt;code&gt;flet&lt;/code&gt; (which only provides lexically scoped function bindings), but function objects (a first-level object in Common Lisp) can be assigned to dynamically scoped variables, bound using &lt;code&gt;let&lt;/code&gt; in dynamic scope, then called using &lt;code&gt;funcall&lt;/code&gt; or &lt;code&gt;APPLY&lt;/code&gt;.<br /> <br /> Dynamic scope is extremely useful because it adds referential clarity and discipline to [[global variable]]s. Global variables are frowned upon in computer science as potential sources of error, because they can give rise to ad-hoc, covert channels of communication among modules that lead to unwanted, surprising interactions.<br /> <br /> In Common Lisp, a special variable which has only a top-level binding behaves just like a global variable in other programming languages. A new value can be stored into it, and that value simply replaces what is in the top-level binding. Careless replacement of the value of a global variable is at the heart of bugs caused by use of global variables. However, another way to work with a special variable is to give it a new, local binding within an expression. This is sometimes referred to as &quot;rebinding&quot; the variable. Binding a dynamically scoped variable temporarily creates a new memory location for that variable, and associates the name with that location. While that binding is in effect, all references to that variable refer to the new binding; the previous binding is hidden. When execution of the binding expression terminates, the temporary memory location is gone, and the old binding is revealed, with the original value intact. Of course, multiple dynamic bindings for the same variable can be nested.<br /> <br /> In Common Lisp implementations which support multithreading, dynamic scopes are specific to each thread of execution. Thus special variables serve as an abstraction for thread local storage. If one thread rebinds a special variable, this rebinding has no effect on that variable in other threads. The value stored in a binding can only be retrieved by the thread which created that binding. If each thread binds some special variable &lt;code&gt;*x*&lt;/code&gt;, then &lt;code&gt;*x*&lt;/code&gt; behaves like thread-local storage. Among threads which do not rebind &lt;code&gt;*x*&lt;/code&gt;, it behaves like an ordinary global: all of these threads refer to the same top-level binding of &lt;code&gt;*x*&lt;/code&gt;.<br /> <br /> Dynamic variables can be used to extend the execution context with additional context information which is implicitly passed from function to function without having to appear as an extra function parameter. This is especially useful when the control transfer has to pass through layers of unrelated code, which simply cannot be extended with extra parameters to pass the additional data. A situation like this usually calls for a global variable. That global variable must be saved and restored, so that the scheme doesn't break under recursion: dynamic variable rebinding takes care of this. And that variable must be made thread-local (or else a big mutex must be used) so the scheme doesn't break under threads: dynamic scope implementations can take care of this also.<br /> <br /> In the Common Lisp library, there are many standard special variables. For instance, all standard I/O streams are stored in the top-level bindings of well-known special variables. The standard output stream is stored in *standard-output*.<br /> <br /> Suppose a function foo writes to standard output:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun foo ()<br /> (format t &quot;Hello, world&quot;))<br /> &lt;/source&gt;<br /> <br /> To capture its output in a character string, *standard-output* can be bound to a string stream and called:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (with-output-to-string (*standard-output*)<br /> (foo))<br /> &lt;/source&gt;<br /> <br /> -&gt; &quot;Hello, world&quot; ; gathered output returned as a string<br /> <br /> ====Lexical====<br /> <br /> Common Lisp supports lexical environments. Formally, the bindings in a lexical environment have [[lexical scope]] and may have either indefinite extent or dynamic extent, depending on the type of namespace. [[Lexical scope]] means that visibility is physically restricted to the block in which the binding is established. References which are not textually (i.e. lexically) embedded in that block simply do not see that binding.<br /> <br /> The tags in a TAGBODY have lexical scope. The expression (GO X) is erroneous if it is not actually embedded in a TAGBODY which contains a label X. However, the label bindings disappear when the TAGBODY terminates its execution, because they have dynamic extent. If that block of code is re-entered by the invocation of a lexical closure, it is invalid for the body of that closure to try to transfer control to a tag via GO:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defvar *stashed*) ;; will hold a function<br /> <br /> (tagbody<br /> (setf *stashed* (lambda () (go some-label)))<br /> (go end-label) ;; skip the (print &quot;Hello&quot;)<br /> some-label<br /> (print &quot;Hello&quot;)<br /> end-label)<br /> -&gt; NIL<br /> &lt;/source&gt;<br /> <br /> When the TAGBODY is executed, it first evaluates the setf form which stores a function in the special variable *stashed*. Then the (go end-label) transfers control to end-label, skipping the code (print &quot;Hello&quot;). Since end-label is at the end of the tagbody, the tagbody terminates, yielding NIL. Suppose that the previously remembered function is now called:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (funcall *stashed*) ;; Error!<br /> &lt;/source&gt;<br /> <br /> This situation is erroneous. One implementation's response is an error condition containing the message, &quot;GO: tagbody for tag SOME-LABEL has already been left&quot;. The function tried to evaluate (go some-label), which is lexically embedded in the tagbody, and resolves to the label. However, the tagbody isn't executing (its extent has ended), and so the control transfer cannot take place.<br /> <br /> Local function bindings in Lisp have [[lexical scope]], and variable bindings also have lexical scope by default. By contrast with GO labels, both of these have indefinite extent. When a lexical function or variable binding is established, that binding continues to exist for as long as references to it are possible, even after the construct which established that binding has terminated. References to lexical variables and functions after the termination of their establishing construct are possible thanks to [[lexical closure]]s.<br /> <br /> Lexical binding is the default binding mode for Common Lisp variables. For an individual symbol, it can be switched to dynamic scope, either by a local declaration, by a global declaration. The latter may occur implicitly through the use of a construct like DEFVAR or DEFPARAMETER. It is an important convention in Common Lisp programming that special (i.e. dynamically scoped) variables have names which begin and end with an asterisk [[Sigil (computer programming)|sigil]] &lt;code&gt;*&lt;/code&gt; in what is called the “[[earmuff]] convention”.&lt;ref&gt;[http://letoverlambda.com/index.cl/guest/chap2.html Chapter 2] of [[Let Over Lambda]]&lt;/ref&gt; If adhered to, this convention effectively creates a separate namespace for special variables, so that variables intended to be lexical are not accidentally made special.<br /> <br /> [[Lexical scope]] is useful for several reasons.<br /> <br /> Firstly, references to variables and functions can be compiled to efficient machine code, because the run-time environment structure is relatively simple. In many cases it can be optimized to stack storage, so opening and closing lexical scopes has minimal overhead. Even in cases where full closures must be generated, access to the closure's environment is still efficient; typically each variable becomes an offset into a vector of bindings, and so a variable reference becomes a simple load or store instruction with a base-plus-offset [[addressing mode]].<br /> <br /> Secondly, lexical scope (combined with indefinite extent) gives rise to the [[lexical closure]], which in turn creates a whole paradigm of programming centered around the use of functions being first-class objects, which is at the root of functional programming.<br /> <br /> Thirdly, perhaps most importantly, even if lexical closures are not exploited, the use of lexical scope isolates program modules from unwanted interactions. Due to their restricted visibility, lexical variables are private. If one module A binds a lexical variable X, and calls another module B, references to X in B will not accidentally resolve to the X bound in A. B simply has no access to X. For situations in which disciplined interactions through a variable are desirable, Common Lisp provides special variables. Special variables allow for a module A to set up a binding for a variable X which is visible to another module B, called from A. Being able to do this is an advantage, and being able to prevent it from happening is also an advantage; consequently, Common Lisp supports both lexical and [[dynamic scope]].<br /> <br /> ==Macros==<br /> A ''[[Macro (computer science)|macro]]'' in Lisp superficially resembles a function in usage. However, rather than representing an expression which is evaluated, it represents a transformation of the program source code. The macro gets the source it surrounds as arguments, binds them to its parameters and computes a new source form. This new form can also use a macro. The macro expansion is repeated until the new source form does not use a macro. The final computed form is the source code executed at runtime.<br /> <br /> Typical uses of macros in Lisp:<br /> <br /> * new control structures (example: looping constructs, branching constructs)<br /> * scoping and binding constructs<br /> * simplified syntax for complex and repeated source code<br /> * top-level defining forms with compile-time side-effects<br /> * data-driven programming<br /> * embedded domain specific languages (examples: SQL, HTML, Prolog)<br /> * implicit finalization forms<br /> <br /> Various standard Common Lisp features also need to be implemented as macros, such as:<br /> <br /> * the standard &lt;code&gt;setf&lt;/code&gt; abstraction, to allow custom compile-time expansions of assignment/access operators<br /> * &lt;code&gt;with-accessors&lt;/code&gt;, &lt;code&gt;with-slots&lt;/code&gt;, &lt;code&gt;with-open-file&lt;/code&gt; and other similar &lt;code&gt;WITH&lt;/code&gt; macros<br /> * Depending on implementation, &lt;code&gt;if&lt;/code&gt; or &lt;code&gt;cond&lt;/code&gt; is a macro built on the other, the special operator; &lt;code&gt;when&lt;/code&gt; and &lt;code&gt;unless&lt;/code&gt; consist of macros<br /> * The powerful &lt;code&gt;loop&lt;/code&gt; domain-specific language<br /> <br /> Macros are defined by the ''defmacro'' macro. The special operator ''macrolet'' allows the definition of local (lexically scoped) macros. It is also possible to define macros for symbols using ''define-symbol-macro'' and ''symbol-macrolet''.<br /> <br /> [[Paul Graham (computer programmer)|Paul Graham]]'s book [[On Lisp]] describes the use of macros in Common Lisp in detail. [[Doug Hoyte]]'s book [[Let Over Lambda]] extends the discussion on macros, claiming &quot;Macros are the single greatest advantage that lisp has as a programming language and the single greatest advantage of any programming language.&quot; Hoyte provides several examples of iterative development of macros.<br /> <br /> ===Example using a macro to define a new control structure===<br /> Macros allow Lisp programmers to create new syntactic forms in the language. One typical use is to create new control structures. The example macro provides an &lt;code&gt;until&lt;/code&gt; looping construct. The syntax is:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> (until test form*)<br /> &lt;/source&gt;<br /> <br /> The macro definition for ''until'':<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmacro until (test &amp;body body)<br /> (let ((start-tag (gensym &quot;START&quot;))<br /> (end-tag (gensym &quot;END&quot;)))<br /> `(tagbody ,start-tag<br /> (when ,test (go ,end-tag))<br /> (progn ,@body)<br /> (go ,start-tag)<br /> ,end-tag)))<br /> &lt;/source&gt;<br /> <br /> ''tagbody'' is a primitive Common Lisp special operator which provides the ability to name tags and use the ''go'' form to jump to those tags. The backquote ''`'' provides a notation that provides code templates, where the value of forms preceded with a comma are filled in. Forms preceded with comma and at-sign are ''spliced'' in. The tagbody form tests the end condition. If the condition is true, it jumps to the end tag. Otherwise the provided body code is executed and then it jumps to the start tag.<br /> <br /> An example form using above ''until'' macro:<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (until (= (random 10) 0)<br /> (write-line &quot;Hello&quot;))<br /> &lt;/source&gt;<br /> <br /> The code can be expanded using the function ''macroexpand-1''. The expansion for above example looks like this:<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (TAGBODY<br /> #:START1136<br /> (WHEN (ZEROP (RANDOM 10))<br /> (GO #:END1137))<br /> (PROGN (WRITE-LINE &quot;hello&quot;))<br /> (GO #:START1136)<br /> #:END1137)<br /> &lt;/source&gt;<br /> <br /> During macro expansion the value of the variable ''test'' is ''(= (random 10) 0)'' and the value of the variable ''body'' is ''((write-line &quot;Hello&quot;))''. The body is a list of forms.<br /> <br /> Symbols are usually automatically upcased. The expansion uses the TAGBODY with two labels. The symbols for these labels are computed by GENSYM and are not interned in any package. Two ''go'' forms use these tags to jump to. Since ''tagbody'' is a primitive operator in Common Lisp (and not a macro), it will not be expanded into something else. The expanded form uses the ''when'' macro, which also will be expanded. Fully expanding a source form is called ''code walking''.<br /> <br /> In the fully expanded (''walked'') form, the ''when'' form is replaced by the primitive ''if'':<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (TAGBODY<br /> #:START1136<br /> (IF (ZEROP (RANDOM 10))<br /> (PROGN (GO #:END1137))<br /> NIL)<br /> (PROGN (WRITE-LINE &quot;hello&quot;))<br /> (GO #:START1136))<br /> #:END1137)<br /> &lt;/source&gt;<br /> <br /> All macros must be expanded before the source code containing them can be evaluated or compiled normally. Macros can be considered functions that accept and return [[abstract syntax tree]]s (Lisp S-expressions). These functions<br /> are invoked before the evaluator or compiler to produce the final source code.<br /> Macros are written in normal Common Lisp, and may use any Common Lisp (or third-party) operator available.<br /> <br /> ===Variable capture and shadowing===<br /> Common Lisp macros are capable of what is commonly called ''variable capture'', where symbols in the macro-expansion body coincide with those in the calling context, allowing the programmer to create macros wherein various symbols have special meaning. The term ''variable capture'' is somewhat misleading, because all namespaces are vulnerable to unwanted capture, including the operator and function namespace, the tagbody label namespace, catch tag, condition handler and restart namespaces.<br /> <br /> ''Variable capture'' can introduce software defects. This happens in one of the following two ways:<br /> <br /> * In the first way, a macro expansion can inadvertently make a symbolic reference which the macro writer assumed will resolve in a global namespace, but the code where the macro is expanded happens to provide a local, shadowing definition which steals that reference. Let this be referred to as type 1 capture.<br /> <br /> * The second way, type 2 capture, is just the opposite: some of the arguments of the macro are pieces of code supplied by the macro caller, and those pieces of code are written such that they make references to surrounding bindings. However, the macro inserts these pieces of code into an expansion which defines its own bindings that accidentally captures some of these references.<br /> <br /> The Scheme dialect of Lisp provides a macro-writing system which provides the referential transparency that eliminates both types of capture problem. This type of macro system is sometimes called &quot;hygienic&quot;, in particular by its proponents (who regard macro systems which do not automatically solve this problem as unhygienic). {{Citation needed|date=May 2011}}<br /> <br /> In Common Lisp, macro hygiene is ensured one of two different ways.<br /> <br /> One approach is to use [[gensym]]s: guaranteed-unique symbols which can be used in a macro-expansion without threat of capture. The use of gensyms in a macro definition is a manual chore, but macros can be written which simplify the instantiation and use of gensyms. Gensyms solve type 2 capture easily, but they are not applicable to type 1 capture in the same way, because the macro expansion cannot rename the interfering symbols in the surrounding code which capture its references. Gensyms could be used to provide stable aliases for the global symbols which the macro expansion needs. The macro expansion would use these secret aliases rather than the well-known names, so redefinition of the well-known names would have no ill effect on the macro.<br /> <br /> Another approach is to use packages. A macro defined in its own package can simply use internal symbols in that package in its expansion. The use of packages deals with type 1 and type 2 capture.<br /> <br /> However, packages don't solve the type 1 capture of references to standard Common Lisp functions and operators. The reason is that the use of packages to solve capture problems revolves around the use of private symbols (symbols in one package, which are not imported into, or otherwise made visible in other packages). Whereas the Common Lisp library symbols are external, and frequently imported into or made visible in user-defined packages.<br /> <br /> The following is an example of unwanted capture in the operator namespace, occurring in the expansion of a macro:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; expansion of UNTIL makes liberal use of DO<br /> (defmacro until (expression &amp;body body)<br /> `(do () (,expression) ,@body))<br /> <br /> ;; macrolet establishes lexical operator binding for DO<br /> (macrolet ((do (...) ... something else ...))<br /> (until (= (random 10) 0) (write-line &quot;Hello&quot;)))<br /> &lt;/source&gt;<br /> <br /> The &lt;code&gt;until&lt;/code&gt; macro will expand into a form which calls &lt;code&gt;do&lt;/code&gt; which is intended to refer to the standard Common Lisp macro &lt;code&gt;do&lt;/code&gt;. However, in this context, &lt;code&gt;do&lt;/code&gt; may have a completely different meaning, so &lt;code&gt;until&lt;/code&gt; may not work properly.<br /> <br /> Common Lisp solves the problem of the shadowing of standard operators and functions by forbidding their redefinition. Because it redefines the standard operator &lt;code&gt;do&lt;/code&gt;, the preceding is actually a fragment of non-conforming Common Lisp, which allows implementations to diagnose and reject it.<br /> <br /> ==Condition system==<br /> The ''condition system'' is responsible for [[exception handling]] in Common Lisp.&lt;ref name=&quot;Seibel2005&quot;&gt;{{cite book|author=Peter Seibel|title=Practical Common Lisp|url=http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html|date=7 April 2005|publisher=Apress|isbn=978-1-59059-239-7}}&lt;/ref&gt; It provides ''conditions'', ''handler''s and ''restart''s. ''Condition''s are objects describing an exceptional situation (for example an error). If a ''condition'' is signaled, the Common Lisp system searches for a ''handler'' for this condition type and calls the handler. The ''handler'' can now search for restarts and use one of these restarts to repair the current problem. As part of a user interface (for example of a debugger), these restarts can also be presented to the user, so that the user can select and invoke one of the available restarts. Since the condition handler is called in the context of the error (without unwinding the stack), full error recovery is possible in many cases, where other exception handling systems would have already terminated the current routine. The debugger itself can also be customized or replaced using the &lt;code&gt;*debugger-hook*&lt;/code&gt; dynamic variable.<br /> <br /> In the following example (using [[Symbolics Genera]]) the user tries to open a file in a Lisp function ''test'' called from the Read-Eval-Print-LOOP ([[REPL]]), when the file does not exist. The Lisp system presents four restarts. The user selects the ''Retry OPEN using a different pathname'' restart and enters a different pathname (lispm-init.lisp instead of lispm-int.lisp). The user code does not contain any error handling code. The whole error handling and restart code is provided by the Lisp system, which can handle and repair the error without terminating the user code.<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> Command: (test &quot;&gt;zippy&gt;lispm-int.lisp&quot;)<br /> <br /> Error: The file was not found.<br /> For lispm:&gt;zippy&gt;lispm-int.lisp.newest<br /> <br /> LMFS:OPEN-LOCAL-LMFS-1<br /> Arg 0: #P&quot;lispm:&gt;zippy&gt;lispm-int.lisp.newest&quot;<br /> <br /> s-A, &lt;Resume&gt;: Retry OPEN of lispm:&gt;zippy&gt;lispm-int.lisp.newest<br /> s-B: Retry OPEN using a different pathname<br /> s-C, &lt;Abort&gt;: Return to Lisp Top Level in a TELNET server<br /> s-D: Restart process TELNET terminal<br /> <br /> -&gt; Retry OPEN using a different pathname<br /> Use what pathname instead [default lispm:&gt;zippy&gt;lispm-int.lisp.newest]:<br /> lispm:&gt;zippy&gt;lispm-init.lisp.newest<br /> <br /> ...the program continues<br /> &lt;/source&gt;<br /> <br /> ==Common Lisp Object System (CLOS)==<br /> <br /> {{Main|Common Lisp Object System}}<br /> <br /> Common Lisp includes a toolkit for [[object-oriented programming]], the Common Lisp Object System or [[Common Lisp Object System|CLOS]], which is one of the most powerful object systems available in any language. For example, [[Peter Norvig]] explains how many [[Design pattern (computer science)|Design Patterns]] are simpler to implement in a dynamic language with the features of CLOS (Multiple Inheritance, Mixins, Multimethods, Metaclasses, Method combinations, etc.).&lt;ref&gt;[http://norvig.com/design-patterns/ppframe.htm Peter Norvig, Design Patterns in Dynamic Programming]&lt;/ref&gt;<br /> Several extensions to Common Lisp for object-oriented programming have been proposed to be included into the ANSI Common Lisp standard, but eventually CLOS was adopted as the standard object-system for Common Lisp. CLOS is a [[dynamic programming language|dynamic]] object system with [[multiple dispatch]] and [[multiple inheritance]], and differs radically from the OOP facilities found in static languages such as [[C++]] or [[Java (programming language)|Java]]. As a dynamic object system, CLOS allows changes at runtime to generic functions and classes. Methods can be added and removed, classes can be added and redefined, objects can be updated for class changes and the class of objects can be changed.<br /> <br /> CLOS has been integrated into ANSI Common Lisp. Generic Functions can be used like normal functions and are a first-class data type. Every CLOS class is integrated into the Common Lisp type system. Many Common Lisp types have a corresponding class. There is more potential use of CLOS for Common Lisp. The specification does not say whether conditions are implemented with CLOS. Pathnames and streams could be implemented with CLOS. These further usage possibilities of CLOS for ANSI Common Lisp are not part of the standard. Actual Common Lisp implementations are using CLOS for pathnames, streams, input/output, conditions, the implementation of CLOS itself and more.<br /> <br /> ==Compiler and interpreter==<br /> Several implementations of earlier Lisp dialects provided both an interpreter and a compiler. Unfortunately often the semantics were different. These earlier Lisps implemented lexical scoping in the compiler and dynamic scoping in the interpreter. Common Lisp requires that both the interpreter and compiler use lexical scoping by default. The Common Lisp standard describes both the semantics of the interpreter and a compiler. The compiler can be called using the function ''compile'' for individual functions and using the function ''compile-file'' for files. Common Lisp allows type declarations and provides ways to influence the compiler code generation policy. For the latter various optimization qualities can be given values between 0 (not important) and 3 (most important): ''speed'', ''space'', ''safety'', ''debug'' and ''compilation-speed''.<br /> <br /> There is also a function to evaluate Lisp code: ''eval''. ''eval'' takes code as pre-parsed s-expressions and not, like in some other languages, as text strings. This way code can be constructed with the usual Lisp functions for constructing lists and symbols and then this code can be evaluated with ''eval''. Several Common Lisp implementations (like Clozure CL and SBCL) are implementing ''eval'' using their compiler. This way code is compiled, even though it is evaluated using the function ''eval''.<br /> <br /> The file compiler is invoked using the function ''compile-file''. The generated file with compiled code is called a ''fasl'' (from ''fast load'') file. These ''fasl'' files and also source code files can be loaded with the function ''load'' into a running Common Lisp system. Depending on the implementation, the file compiler generates byte-code (for example for the [[Java Virtual Machine]]), [[C (programming language)|C language]] code (which then is compiled with a C compiler) or, directly, native code.<br /> <br /> Common Lisp implementations can be used interactively, even though the code gets fully compiled. The idea of an [[Interpreted language]] thus does not apply for interactive Common Lisp.<br /> <br /> The language makes distinction between read-time, compile-time, load-time and run-time, and allows user code to also make this distinction to perform the wanted type of processing at the wanted step.<br /> <br /> Some special operators are provided to especially suit interactive development; for instance, &lt;code&gt;defvar&lt;/code&gt; will only assign a value to its provided variable if it wasn't already bound, while &lt;code&gt;defparameter&lt;/code&gt; will always perform the assignment. This distinction is useful when interactively evaluating, compiling and loading code in a live image.<br /> <br /> Some features are also provided to help writing compilers and interpreters. Symbols consist of first-level objects and are directly manipulable by user code. The &lt;code&gt;progv&lt;/code&gt; special operator allows to create lexical bindings programmatically, while packages are also manipulable. The Lisp compiler itself is available at runtime to compile files or individual functions. These make it easy to use Lisp as an intermediate compiler or interpreter for another language.<br /> <br /> ==Code examples==<br /> <br /> ===Birthday paradox===<br /> The following program calculates the smallest number of people in a room for whom the probability of completely unique birthdays is less than 50% (the [[birthday paradox]], where for 1 person the probability is obviously 100%, for 2 it is 364/365, etc.). The Answer is 23.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; By convention, constants in Common Lisp are enclosed with + characters.<br /> (defconstant +year-size+ 365)<br /> <br /> (defun birthday-paradox (probability number-of-people)<br /> (let ((new-probability (* (/ (- +year-size+ number-of-people)<br /> +year-size+)<br /> probability)))<br /> (if (&lt; new-probability 0.5)<br /> (1+ number-of-people)<br /> (birthday-paradox new-probability (1+ number-of-people)))))<br /> &lt;/source&gt;<br /> <br /> Calling the example function using the [[REPL]] (Read Eval Print Loop):<br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (birthday-paradox 1.0 1)<br /> 23<br /> &lt;/source&gt;<br /> <br /> ===Sorting a list of person objects===<br /> <br /> We define a class PERSON and a method for displaying the name and age of a person.<br /> Next we define a group of persons as a list of PERSON objects.<br /> Then we iterate over the sorted list.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defclass person ()<br /> ((name :initarg :name :accessor person-name)<br /> (age :initarg :age :accessor person-age))<br /> (:documentation &quot;The class PERSON with slots NAME and AGE.&quot;))<br /> <br /> (defmethod display ((object person) stream)<br /> &quot;Displaying a PERSON object to an output stream.&quot;<br /> (with-slots (name age) object<br /> (format stream &quot;~a (~a)&quot; name age)))<br /> <br /> (defparameter *group*<br /> (list (make-instance 'person :name &quot;Bob&quot; :age 33)<br /> (make-instance 'person :name &quot;Chris&quot; :age 16)<br /> (make-instance 'person :name &quot;Ash&quot; :age 23))<br /> &quot;A list of PERSON objects.&quot;)<br /> <br /> (dolist (person (sort (copy-list *group*)<br /> #'&gt;<br /> :key #'person-age))<br /> (display person *standard-output*)<br /> (terpri))<br /> &lt;/source&gt;<br /> <br /> It prints the three names with descending age.<br /> &lt;source lang=&quot;text&quot;&gt;<br /> Bob (33)<br /> Ash (23)<br /> Chris (16)<br /> &lt;/source&gt;<br /> <br /> ===Exponentiating by squaring===<br /> <br /> Use of the LOOP macro is demonstrated:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun power (x n)<br /> (loop with result = 1<br /> while (plusp n)<br /> when (oddp n) do (setf result (* result x))<br /> do (setf x (* x x)<br /> n (truncate n 2))<br /> finally (return result)))<br /> &lt;/source&gt;<br /> <br /> Example use:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (power 2 200)<br /> 1606938044258990275541962092341162602522202993782792835301376<br /> &lt;/source&gt;<br /> <br /> Compare with the built in exponentiation:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (= (expt 2 200) (power 2 200))<br /> T<br /> &lt;/source&gt;<br /> <br /> ===Find the list of available shells===<br /> <br /> WITH-OPEN-FILE is a macro that opens a file and provides a stream. When the form is returning, the file is automatically closed. FUNCALL calls a function object. The LOOP collects all lines that match the predicate.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun list-matching-lines (file predicate)<br /> &quot;Returns a list of lines in file, for which the predicate applied to<br /> the line returns T.&quot;<br /> (with-open-file (stream file)<br /> (loop for line = (read-line stream nil nil)<br /> while line<br /> when (funcall predicate line)<br /> collect it)))<br /> &lt;/source&gt;<br /> <br /> The function AVAILABLE-SHELLS calls above function LIST-MATCHING-LINES with a pathname and an anonymous function as the predicate. The predicate returns the pathname of a shell or NIL (if the string is not the filename of a shell).<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun available-shells (&amp;optional (file #p&quot;/etc/shells&quot;))<br /> (list-matching-lines<br /> file<br /> (lambda (line)<br /> (and (plusp (length line))<br /> (char= (char line 0) #\/)<br /> (pathname<br /> (string-right-trim '(#\space #\tab) line))))))<br /> &lt;/source&gt;<br /> <br /> Example results (on Mac OS X 10.6):<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> CL-USER &gt; (available-shells)<br /> (#P&quot;/bin/bash&quot; #P&quot;/bin/csh&quot; #P&quot;/bin/ksh&quot; #P&quot;/bin/sh&quot; #P&quot;/bin/tcsh&quot; #P&quot;/bin/zsh&quot;)<br /> &lt;/source&gt;<br /> <br /> ==Comparison with other Lisps==<br /> &lt;!-- needs lots --&gt;<br /> Common Lisp is most frequently compared with, and contrasted to, [[Scheme (programming language)|Scheme]]—if only because they are the two most popular Lisp dialects. Scheme predates CL, and comes not only from the same Lisp tradition but from some of the same engineers—[[Guy L. Steele, Jr.|Guy L. Steele]], with whom [[Gerald Jay Sussman]] designed Scheme, chaired the standards committee for Common Lisp.<br /> <br /> Common Lisp is a general-purpose programming language, in contrast to Lisp variants such as [[Emacs Lisp]] and [[AutoLISP]] which are [[extension languages]] embedded in particular products. Unlike many earlier Lisps, Common Lisp (like [[Scheme (programming language)|Scheme]]) uses lexical variable [[scope (programming)|scope]] by default for both interpreted and compiled code.<br /> <br /> Most of the Lisp systems whose designs contributed to Common Lisp—such as [[ZetaLisp]] and Franz Lisp—used dynamically [[scope (programming)|scoped]] variables in their interpreters and lexically scoped variables in their compilers. Scheme introduced the sole use of lexically scoped variables to Lisp; an inspiration from [[ALGOL 68]] which was widely recognized as a good idea. CL supports dynamically scoped variables as well, but they must be explicitly declared as &quot;special&quot;. There are no differences in scoping between ANSI CL interpreters and compilers.<br /> <br /> Common Lisp is sometimes termed a ''Lisp-2'' and Scheme a ''Lisp-1'', referring to CL's use of separate namespaces for functions and variables. (In fact, CL has ''many'' namespaces, such as those for go tags, block names, and &lt;code&gt;loop&lt;/code&gt; keywords). There is a long-standing controversy between CL and Scheme advocates over the tradeoffs involved in multiple namespaces. In Scheme, it is (broadly) necessary to avoid giving variables names which clash with functions; Scheme functions frequently have arguments named &lt;code&gt;lis&lt;/code&gt;, &lt;code&gt;lst&lt;/code&gt;, or &lt;code&gt;lyst&lt;/code&gt; so as not to conflict with the system function &lt;code&gt;list&lt;/code&gt;. However, in CL it is necessary to explicitly refer to the function namespace when passing a function as an argument—which is also a common occurrence, as in the &lt;code&gt;sort&lt;/code&gt; example above.<br /> <br /> CL also differs from Scheme in its handling of boolean values. Scheme uses the special values #t and #f to represent truth and falsity. CL follows the older Lisp convention of using the symbols T and NIL, with NIL standing also for the empty list. In CL, ''any'' non-NIL value is treated as true by conditionals, such as &lt;code&gt;if&lt;/code&gt;, whereas in Scheme all non-#f values are treated as true. These conventions allow some operators in both languages to serve both as predicates (answering a boolean-valued question) and as returning a useful value for further computation, but in Scheme the value '() which is equivalent to NIL in Common Lisp evaluates to true in a boolean expression.<br /> <br /> Lastly, the Scheme standards documents require [[tail recursion|tail-call optimization]], which the CL standard does not. Most CL implementations do offer tail-call optimization, although often only when the programmer uses an optimization directive. Nonetheless, common CL coding style does not favor the ubiquitous use of recursion that Scheme style prefers—what a Scheme programmer would express with tail recursion, a CL user would usually express with an iterative expression in &lt;code&gt;do&lt;/code&gt;, &lt;code&gt;dolist&lt;/code&gt;, &lt;code&gt;loop&lt;/code&gt;, or (more recently) with the &lt;code&gt;iterate&lt;/code&gt; package.<br /> <br /> ==Implementations==<br /> <br /> See the Category [[:Category:Common Lisp implementations|Common Lisp implementations]].<br /> <br /> Common Lisp is defined by a specification (like [[Ada (programming language)|Ada]] and [[C (programming language)|C]]) rather than by one implementation (like [[Perl]] before version 6). There are many implementations, and the standard details areas in which they may validly differ.<br /> <br /> In addition, implementations tend to come with library packages, which provide functionality not covered in the standard. [[Free and open source software]] libraries have been created to support such features in a portable way, and are most notably found in the repositories of the [http://common-lisp.net/ Common-Lisp.net] and [http://clocc.sourceforge.net/ Common Lisp Open Code Collection] projects.<br /> <br /> Common Lisp implementations may use any mix of native code compilation, byte code compilation or interpretation. Common Lisp has been designed to support [[incremental compiler]]s, file compilers and block compilers. Standard declarations to optimize compilation (such as function inlining or type specialization) are proposed in the language specification. Most Common Lisp implementations compile source code to native [[machine code]]. Some implementations can create (optimized) stand-alone applications. Others compile to interpreted [[bytecode]], which is less efficient than native code, but eases binary-code portability. There are also compilers that compile Common Lisp code to C code. The misconception that Lisp is a purely interpreted language is most likely because Lisp environments provide an interactive prompt and that code is compiled one-by-one, in an incremental way. With Common Lisp incremental compilation is widely used.<br /> <br /> Some [[Unix]]-based implementations ([[CLISP]], [[SBCL]]) can be used as a [[scripting language]]; that is, invoked by the system transparently in the way that a [[Perl]] or [[Unix shell]] interpreter is.&lt;ref&gt;[http://clisp.cons.org/impnotes/quickstart.html#quickstart-unix CLISP as a scripting language under Unix]&lt;/ref&gt;<br /> <br /> ===List of implementations===<br /> <br /> ====Commercial implementations====<br /> <br /> ; [[Allegro Common Lisp]]: for Microsoft Windows, FreeBSD, Linux, Apple Mac OS X and various UNIX variants. Allegro CL provides an [[integrated development environment|Integrated Development Environment (IDE)]] (for Windows and Linux) and extensive capabilities for application delivery.<br /> ; [[Liquid Common Lisp]]: formerly called [[Lucid Common Lisp]]. Only maintenance, no new releases.<br /> ; [[LispWorks]]: for Microsoft Windows, FreeBSD, Linux, Apple Mac OS X and various UNIX variants. LispWorks provides an [[integrated development environment|Integrated Development Environment (IDE)]] (available for all platforms) and extensive capabilities for application delivery.<br /> ; [[mocl]]: for iOS, Android and Mac OS X.<br /> ; [[Open Genera]]: for DEC Alpha.<br /> ; [[Scieneer Common Lisp]]: which is designed for high-performance scientific computing.<br /> <br /> ====Freely redistributable implementations====<br /> <br /> ; Armed Bear Common Lisp (ABCL) : A CL implementation that runs on the [[Java Virtual Machine]].&lt;ref&gt;{{cite web | url = http://common-lisp.net/project/armedbear/ | title = Armed Bear Common Lisp }}&lt;/ref&gt; It includes a compiler to [[Java byte code]], and allows access to Java libraries from CL. It was formerly just a component of the [[Armed Bear J Editor]].<br /> ; [[CLISP]]: A bytecode-compiling implementation, portable and runs on a number of Unix and Unix-like systems (including [[Mac OS X]]), as well as Microsoft Windows and several other systems.<br /> ; [[Clozure CL]] (CCL) : Originally a [[free and open source software|free and open source]] fork of Macintosh Common Lisp. As that history implies, CCL was written for the Macintosh, but Clozure CL now runs on [[Mac OS X]], [[FreeBSD]], [[Linux]], [[Solaris (operating system)|Solaris]] and [[Microsoft Windows|Windows]]. 32 and 64 bit [[x86]] ports are supported on each platform. Additionally there are Power PC ports for Mac OS and Linux. CCL was previously known as OpenMCL, but that name is no longer used, to avoid confusion with the open source version of Macintosh Common Lisp.<br /> ; [[CMUCL]]: Originally from [[Carnegie Mellon University]], now maintained as [[free and open source software]] by a group of volunteers. CMUCL uses a fast native-code compiler. It is available on [[Linux]] and [[Berkeley Software Distribution|BSD]] for Intel x86; [[Linux]] for Alpha; [[Mac OS X]] for Intel x86 and PowerPC; and Solaris, IRIX, and HP-UX on their native platforms.<br /> ; [[Corman Common Lisp]]: for Microsoft Windows. In January 2015 Corman Lisp has been published under MIT license.&lt;ref&gt;{{cite web|title=Corman Lisp sources are now available|url=http://lispblog.xach.com/post/107215169193/corman-lisp-sources-are-now-available}}&lt;/ref&gt;<br /> ; [[Embeddable Common Lisp]] (ECL) : ECL includes a bytecode interpreter and compiler. It can also compile Lisp code to machine code via a C compiler. ECL then compiles Lisp code to C, compiles the C code with a C compiler and can then load the resulting machine code. It is also possible to embed ECL in [[C (programming language)|C]] programs, and C code into Common Lisp programs.<br /> ; [[GNU Common Lisp]] (GCL) : The [[GNU]] Project's Lisp compiler. Not yet fully ANSI-compliant, GCL is however the implementation of choice for several large projects including the mathematical tools [[Maxima (software)|Maxima]], [[Axiom (computer algebra system)|AXIOM]] and (historically) [[ACL2]]. GCL runs on [[Linux]] under eleven different architectures, and also under Windows, Solaris, and [[FreeBSD]].<br /> ; [[Macintosh Common Lisp]] (MCL) : Version 5.2 for Apple Macintosh computers with a PowerPC processor running Mac OS X is open source. RMCL (based on MCL 5.2) runs on Intel-based Apple Macintosh computers using the Rosetta binary translator from Apple.<br /> ; [[ManKai Common Lisp]] (MKCL) : A branch of [[Embeddable Common Lisp|ECL]]. MKCL emphasises reliability, stability and overall code quality through a heavily reworked, natively multi-threaded, runtime system. On Linux, MKCL features a fully POSIX compliant runtime system.<br /> ; [[Movitz]]: Implements a Lisp environment for [[x86]] computers without relying on any underlying OS.<br /> ; [[Poplog]]: Poplog implements a version of CL, with [[POP-11]], and optionally [[Prolog]], and [[Standard ML]] (SML), allowing mixed language programming. For all, the implementation language is POP-11, which is compiled incrementally. It also has an integrated [[Emacs]]-like editor that communicates with the compiler.<br /> ; [[Steel Bank Common Lisp]] (SBCL) : A branch from [[CMUCL]]. &quot;Broadly speaking, SBCL is distinguished from CMU CL by a greater emphasis on maintainability.&quot;&lt;ref&gt;{{cite web<br /> | url = http://sbcl.sourceforge.net/history.html<br /> | title = History and Copyright | work = Steel Bank Common Lisp<br /> }}&lt;/ref&gt; SBCL runs on the platforms CMUCL does, except HP/UX; in addition, it runs on Linux for AMD64, PowerPC, SPARC, MIPS, Windows x86&lt;ref&gt;{{cite web<br /> | url = http://www.sbcl.org/platform-table.html<br /> | title = Platform Table | work = Steel Bank Common Lisp<br /> }}&lt;/ref&gt; and has experimental support for running on Windows AMD64. SBCL does not use an interpreter by default; all expressions are compiled to native code unless the user switches the interpreter on. The SBCL compiler generates fast native code.&lt;ref&gt;[http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?test=all&amp;lang=all SBCL ranks above other dynamic language implementations in the 'Computer Language Benchmark Game']&lt;/ref&gt;<br /> ; [[Ufasoft Common Lisp]]: port of CLISP for windows platform with core written in C++.<br /> <br /> ====Other implementations====<br /> {{unreferenced section|date=July 2013}}<br /> ; Austin Kyoto Common Lisp : an evolution of [[Kyoto Common Lisp]]<br /> ; Butterfly Common Lisp : an implementation written in Scheme for the [[BBN Butterfly]] multi-processor computer<br /> ; CLICC : a Common Lisp to C compiler<br /> ; CLOE : Common Lisp for PCs by [[Symbolics]]<br /> ; Codemist Common Lisp : used for the commercial version of the computer algebra system Axiom<br /> ; ExperCommon Lisp : an early implementation for the Apple Macintosh by ExperTelligence<br /> ; [[Golden Common Lisp]]: an implementation for the PC by GoldHill Inc.<br /> ; Ibuki Common Lisp : a commercialized version of Kyoto Common Lisp<br /> ; [[Kyoto Common Lisp]]: the first Common Lisp compiler that used C as a target language. GCL, ECL and MKCL originate from this Common Lisp implementation.<br /> ; L : a small version of Common Lisp for embedded systems developed by IS Robotics, now iRobot<br /> ; [[Lisp Machine]]s (from [[Symbolics]], TI and Xerox): provided implementations of Common Lisp in addition to their native Lisp dialect (Lisp Machine Lisp or Interlisp). CLOS was also available. Symbolics provides a version of Common Lisp that is based on ANSI Common Lisp.<br /> ; Procyon Common Lisp : an implementation for Windows and Mac OS, used by Franz for their Windows port of Allegro CL<br /> ; Star Sapphire Common LISP : an implementation for the PC<br /> ; [[SubL]]: a variant of Common Lisp used for the implementation of the [[Cyc]] knowledge-based system<br /> ; Top Level Common Lisp : an early implementation for concurrent execution<br /> ; WCL : a shared library implementation<br /> ; [[Vax Common Lisp]]: [[Digital Equipment Corporation]]'s implementation that ran on [[VAX]] systems running [[OpenVMS|VMS]] or [[ULTRIX]]<br /> ; [[XLISP]] by David Betz<br /> <br /> ==Applications==<br /> See the Category [[:Category:Common Lisp software|Common Lisp software]].<br /> <br /> Common Lisp is used to develop research applications (often in Artificial Intelligence), for rapid development of prototypes or for deployed applications.<br /> <br /> Common Lisp is used in many commercial applications, including the [[Yahoo!]] Store web-commerce site, which originally involved [[Paul Graham (computer programmer)|Paul Graham]] and was later rewritten in C++ and Perl.&lt;ref name=&quot;doubt-not-corporate-foolishness&quot;&gt;&quot;In January 2003, Yahoo released a new version of the editor written in C++ and Perl. It's hard to say whether the program is no longer written in Lisp, though, because to translate this program into C++ they literally had to write a Lisp interpreter: the source files of all the page-generating templates are still, as far as I know, Lisp code.&quot; [[Paul Graham (computer programmer)|Paul Graham]], [http://www.paulgraham.com/avg.html Beating the Averages]&lt;/ref&gt; Other notable examples include:<br /> <br /> * [[ACT-R]], a cognitive architecture used in a large number of research projects.<br /> * Authorizer's Assistant,&lt;ref&gt;[http://www.aaai.org/Papers/IAAI/1989/IAAI89-031.pdf Authorizer's Assistant]&lt;/ref&gt;&lt;ref&gt;[http://www.prenhall.com/divisions/bp/app/alter/student/useful/ch9amex.html American Express Authorizer's Assistant]&lt;/ref&gt; a large rule-based system used by American Express, analyzing credit requests.<br /> * [[Cyc]], a long running project with the aim to create a knowledge-based system that provides a huge amount of common sense knowledge<br /> * The [[Dynamic Analysis and Replanning Tool]] (DART), which is said to alone have paid back during the years from 1991 to 1995 for all thirty years of [[DARPA]] investments in AI research.<br /> * G2 from Gensym, a real-time business rules engine (BRE)&lt;ref&gt;[http://www.gensym.com/index.php?option=com_content&amp;view=article&amp;id=47&amp;Itemid=54 Real-time Application Development]. Gensym. Retrieved on 2013-07-17.&lt;/ref&gt;<br /> * [http://www.genworks.com Genworks GDL], based on the open-source [http://github.com/genworks/gendl Gendl] kernel.<br /> * The development environment for the [[Jak and Daxter]] video game series, developed by [[Naughty Dog]].<br /> * [[ITA Software]]'s low fare search engine, used by travel websites such as [[Orbitz]] and [[Kayak.com]] and airlines such as [[American Airlines]], [[Continental Airlines]] and [[US Airways]].<br /> * [[Mirai (software)|Mirai]], a 3d graphics suite. It was used to animate the face of Gollum in the movie Lord of the Rings: The Two Towers.<br /> * [[Prototype Verification System]] (PVS), a mechanized environment for formal specification and verification.<br /> * PWGL is a sophisticated visual programming environment based on Common Lisp, used in [[Computer assisted composition]] and sound synthesis.&lt;ref&gt;[http://www2.siba.fi/PWGL/ PWGL - Home]. . Retrieved on 2013-07-17.&lt;/ref&gt; <br /> * SPIKE, a scheduling system for earth or space based observatories and satellites, notably the Hubble Space Telescope.&lt;ref&gt;[http://www.stsci.edu/resources/software_hardware/spike/ Spike Planning and Scheduling System]. Stsci.edu. Retrieved on 2013-07-17.&lt;/ref&gt;<br /> <br /> There also exist open-source applications written in Common Lisp, such as:<br /> <br /> * [[ACL2]], a full-featured [[automated theorem prover]] for an [[applicative programming language|applicative]] variant of Common Lisp.<br /> * [[Axiom (computer algebra system)|Axiom]], a sophisticated [[computer algebra system]].<br /> * [[Maxima (software)|Maxima]], a sophisticated [[computer algebra system]].<br /> * [[OpenMusic]] is an object-oriented visual programming environment based on Common Lisp, used in [[Computer assisted composition]].<br /> * [[Stumpwm]], a tiling, keyboard driven X11 Window Manager written entirely in Common Lisp.<br /> <br /> ==Libraries==<br /> <br /> Since 2011 Zach Beane, with support of the Common Lisp Foundation, maintains the [[Quicklisp]] library manager. It allows easy access to several hundred libraries written in Common Lisp.<br /> <br /> ==See also==<br /> {{Portal|Computer Science|Computer programming}}<br /> *''[[Common Lisp the Language]]''<br /> *''[[On Lisp]]''<br /> *''[[Practical Common Lisp]]''<br /> {{Clear}}<br /> <br /> ==References==<br /> {{Reflist|2}}<br /> <br /> ==Bibliography==<br /> A chronological list of books published (or about to be published) about Common Lisp (the language) or about programming with Common Lisp (especially AI programming).<br /> {{Refbegin|2}}<br /> * [[Guy L. Steele]]: ''Common Lisp the Language, 1st Edition'', Digital Press, 1984, ISBN 0-932376-41-X<br /> * [[Rodney Allen Brooks]]: ''Programming in Common Lisp'', John Wiley and Sons Inc, 1985, ISBN 0-471-81888-7<br /> * [[Richard P. Gabriel]]: ''Performance and Evaluation of Lisp Systems'', The MIT Press, 1985, ISBN 0-262-57193-5, [http://www.dreamsongs.com/Files/Timrep.pdf PDF]<br /> * [[Robert Wilensky]]: ''Common LISPcraft'', W.W. Norton &amp; Co., 1986, ISBN 0-393-95544-3<br /> * [[Eugene Charniak]], [[Christopher K. Riesbeck]], [[Drew V. McDermott]], [[James R. Meehan]]: ''Artificial Intelligence Programming, 2nd Edition'', Lawrence Erlbaum, 1987, ISBN 0-89859-609-2<br /> * [[Wendy L. Milner]]: ''Common Lisp: A Tutorial'', Prentice Hall, 1987, ISBN 0-13-152844-0<br /> * [[Deborah G. Tatar]]: ''A Programmer's Guide to Common Lisp'', Longman Higher Education, 1987, ISBN 0-13-728940-5<br /> * [[Taiichi Yuasa]], [[Masami Hagiya]]: ''Introduction to Common Lisp'', Elsevier Ltd, 1987, ISBN 0-12-774860-1<br /> * [[Christian Queinnec]], [[Jerome Chailloux]]: ''Lisp Evolution and Standardization'', Ios Pr Inc., 1988, ISBN 90-5199-008-1<br /> * [[Taiichi Yuasa]], [[Richard Weyhrauch]], [[Yasuko Kitajima]]: ''Common Lisp Drill'', Academic Press Inc, 1988, ISBN 0-12-774861-X<br /> * [[Wade L. Hennessey]]: ''Common Lisp'', McGraw-Hill Inc., 1989, ISBN 0-07-028177-7<br /> * [[Tony Hasemer]], [[John Dominque]]: ''Common Lisp Programming for Artificial Intelligence'', Addison-Wesley Educational Publishers Inc, 1989, ISBN 0-201-17579-7<br /> * [[Sonya E. Keene]]: ''Object-Oriented Programming in Common Lisp: A Programmer's Guide to CLOS'', Addison-Wesley, 1989, ISBN 0-201-17589-4<br /> * [[David Jay Steele]]: ''Golden Common Lisp: A Hands-On Approach'', Addison Wesley, 1989, ISBN 0-201-41653-0<br /> * [[David S. Touretzky]]: ''Common Lisp: A Gentle Introduction to Symbolic Computation'', Benjamin-Cummings, 1989, ISBN 0-8053-0492-4. [http://www.cs.cmu.edu/~dst/LispBook/ Web/PDF] Dover reprint (2013) ISBN 978-0486498201<br /> * [[Christopher K. Riesbeck]], [[Roger C. Schank]]: ''Inside Case-Based Reasoning'', Lawrence Erlbaum, 1989, ISBN 0-89859-767-6<br /> * [[Patrick Winston]], [[Berthold Horn]]: ''Lisp, 3rd Edition'', Addison-Wesley, 1989, ISBN 0-201-08319-1, [http://people.csail.mit.edu/phw/Books/LISPBACK.HTML Web]<br /> * [[Gerard Gazdar]], [[Chris Mellish]]: ''Natural Language Processing in LISP: An Introduction to Computational Linguistics'', Addison-Wesley Longman Publishing Co., 1990, ISBN 0-201-17825-7<br /> * [[Patrick R. Harrison]]: ''Common Lisp and Artificial Intelligence'', Prentice Hall PTR, 1990, ISBN 0-13-155243-0<br /> * [[Timothy Koschmann]]: ''The Common Lisp Companion'', John Wiley &amp; Sons, 1990, ISBN 0-471-50308-8<br /> * [[Molly M. Miller]], [[Eric Benson]]: ''Lisp Style &amp; Design'', Digital Press, 1990, ISBN 1-55558-044-0<br /> * [[Guy L. Steele]]: ''[[Common Lisp the Language]], 2nd Edition'', Digital Press, 1990, ISBN 1-55558-041-6, [http://www.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html Web]<br /> * [[Steven L. Tanimoto]]: ''The Elements of Artificial Intelligence Using Common Lisp'', Computer Science Press, 1990, ISBN 0-7167-8230-8<br /> * [[Peter Lee (computer scientist)|Peter Lee]]: ''Topics in Advanced Language Implementation'', The MIT Press, 1991, ISBN 0-262-12151-4<br /> * [[John H. Riley]]: ''A Common Lisp Workbook'', Prentice Hall, 1991, ISBN 0-13-155797-1<br /> * [[Peter Norvig]]: ''Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp'', Morgan Kaufmann, 1991, ISBN 1-55860-191-0, [http://norvig.com/paip.html Web]<br /> * [[Gregor Kiczales]], [[Jim des Rivieres]], [[Daniel G. Bobrow]]: ''The Art of the Metaobject Protocol'', The MIT Press, 1991, ISBN 0-262-61074-4<br /> * [[Jo A. Lawless]], [[Molly M. Miller]]: ''Understanding CLOS: The Common Lisp Object System'', Digital Press, 1991, ISBN 0-13-717232-X<br /> * Mark Watson: ''Common Lisp Modules: Artificial Intelligence in the Era of Neural Networks and Chaos Theory'', Springer Verlag New York Inc., 1991, ISBN 0-387-97614-0<br /> * [[James L. Noyes]]: ''Artificial Intelligence with Common Lisp: Fundamentals of Symbolic and Numeric Processing'', Jones &amp; Bartlett Pub, 1992, ISBN 0-669-19473-5<br /> * [[Stuart C. Shapiro]]: ''COMMON LISP: An Interactive Approach'', Computer Science Press, 1992, ISBN 0-7167-8218-9, [http://www.cse.buffalo.edu/pub/WWW/faculty/shapiro/Commonlisp/ Web/PDF]<br /> * [[Kenneth D. Forbus]], [[Johan de Kleer]]: ''Building Problem Solvers'', The MIT Press, 1993, ISBN 0-262-06157-0<br /> * [[Andreas Paepcke]]: ''Object-Oriented Programming: The CLOS Perspective'', The MIT Press, 1993, ISBN 0-262-16136-2<br /> * [[Paul Graham (computer programmer)|Paul Graham]]: ''[[On Lisp]]'', Prentice Hall, 1993, ISBN 0-13-030552-9, [http://www.paulgraham.com/onlisp.html Web/PDF]<br /> * [[Paul Graham (computer programmer)|Paul Graham]]: ''ANSI Common Lisp'', Prentice Hall, 1995, ISBN 0-13-370875-6<br /> * [[Otto Mayer]]: ''Programmieren in Common Lisp'', German, Spektrum Akademischer Verlag, 1995, ISBN 3-86025-710-2<br /> * [[Stephen Slade]]: ''Object-Oriented Common Lisp'', Prentice Hall, 1997, ISBN 0-13-605940-6<br /> * [[Richard P. Gabriel]]: ''Patterns of Software: Tales from the Software Community'', Oxford University Press, 1998, ISBN 0-19-512123-6, [http://www.dreamsongs.org/Files/PatternsOfSoftware.pdf PDF]<br /> * [[Taiichi Yuasa]], [[Hiroshi G. Okuno]]: ''Advanced Lisp Technology'', CRC, 2002, ISBN 0-415-29819-9<br /> * [[David B. Lamkins]]: ''Successful Lisp: How to Understand and Use Common Lisp'', bookfix.com, 2004. ISBN 3-937526-00-5, [http://www.psg.com/~dlamkins/sl/contents.html Web]<br /> * [[Peter Seibel]]: ''[[Practical Common Lisp]]'', Apress, 2005. ISBN 1-59059-239-5, [http://www.gigamonkeys.com/book/ Web]<br /> * [[Doug Hoyte]]: ''Let Over Lambda'', Lulu.com, 2008, ISBN 1-4357-1275-7, [http://letoverlambda.com/ Web]<br /> * [[George F. Luger]], [[William A. Stubblefield]]: ''AI Algorithms, Data Structures, and Idioms in Prolog, Lisp and Java'', Addison Wesley, 2008, ISBN 0-13-607047-7, [http://wps.aw.com/wps/media/objects/5771/5909832/PDF/Luger_0136070477_1.pdf PDF]<br /> * [[Conrad Barski]]: ''Land of Lisp: Learn to program in Lisp, one game at a time!'', No Starch Press, 2010, ISBN 1-59327-200-6, [http://www.lisperati.com/landoflisp/ Web]<br /> * [[Pavel Penev]]: ''Lisp Web Tales'', Leanpub, 2013, [https://leanpub.com/lispwebtales Web]<br /> {{Refend}}<br /> <br /> ==External links==<br /> {{Wikibooks}}<br /> * The [http://www.cliki.net/ CLiki], a Wiki for [[free and open source software|free and open source]] Common Lisp systems running on Unix-like systems.<br /> * [http://www.common-lisp.net/ Common Lisp software repository].<br /> * {{cite web | url = http://www.lispworks.com/documentation/HyperSpec/Body/01_ab.htm | title = History | work = [[Common Lisp HyperSpec]] }}<br /> * [http://www.flownet.com/gat/jpl-lisp.html Lisping at JPL]<br /> * [http://www.defmacro.org/ramblings/lisp.html The Nature of Lisp] Essay that examines Lisp by comparison with XML.<br /> * [http://common-lisp.net/~dlw/LispSurvey.html Common Lisp Implementations: A Survey] Survey of maintained Common Lisp implementations.<br /> * [http://clqr.boundp.org Common Lisp Quick Reference]<br /> * [http://planet.lisp.org Planet Lisp] Articles about Common Lisp.<br /> <br /> {{Common Lisp}}<br /> <br /> [[Category:Common Lisp]]<br /> [[Category:Multi-paradigm programming languages]]<br /> [[Category:Functional languages]]<br /> [[Category:Dynamically typed programming languages]]<br /> [[Category:Dynamic programming languages]]<br /> [[Category:Object-oriented programming languages]]<br /> [[Category:Class-based programming languages]]<br /> [[Category:Procedural programming languages]]<br /> [[Category:Extensible syntax programming languages]]<br /> [[Category:Lisp programming language family]]<br /> [[Category:Lisp (programming language)]]<br /> [[Category:Articles with example Lisp code]]<br /> [[Category:Cross-platform software]]<br /> [[Category:Cross-platform free software]]<br /> [[Category:Programming languages created in 1984]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Common_Lisp&diff=689832526 Common Lisp 2015-11-09T17:57:46Z <p>PuercoPop: downcase code throughout the article</p> <hr /> <div>{{Infobox programming language<br /> | name = Common Lisp<br /> | family = [[Lisp (programming language)|Lisp]]<br /> | paradigm = [[Multi-paradigm programming language|Multi-paradigm]]: [[procedural programming|procedural]], [[functional programming|functional]], [[object-oriented programming|object-oriented]], [[metaprogramming|meta]], [[reflective programming|reflective]], [[generic programming|generic]]<br /> | generation = [[3GL]]<br /> | released = 1984, 1994 for ANSI Common Lisp<br /> | designer = [[Scott Fahlman]], [[Richard P. Gabriel]], [[Dave Moon]], [[Guy Steele]], [[Dan Weinreb]]<br /> | developer = ANSI [[X3J13]] committee<br /> | standard reference = [[Common Lisp HyperSpec]]<br /> | latest release version =<br /> | latest release date =<br /> | typing = [[Dynamic typing|dynamic]], [[Strongly-typed programming language|strong]]<br /> | scope = lexical, optionally dynamic<br /> | namespace style = Lisp-2<br /> | implementations = [[Allegro Common Lisp|Allegro CL]], [[Armed Bear Common Lisp|ABCL]], [[CLISP]], [[Clozure CL]], [[CMUCL]], [[Embeddable Common Lisp|ECL]], [[GNU Common Lisp|GCL]], [[LispWorks]], [[Scieneer Common Lisp|Scieneer CL]], [[SBCL]], [[Genera (operating system)|Symbolics Common Lisp]]<br /> | dialects = CLtL1, CLtL2, ANSI Common Lisp<br /> | influenced_by = [[Lisp (programming language)|Lisp]], [[Lisp Machine Lisp]], [[Maclisp]], [[Scheme (programming language)|Scheme]], [[Interlisp]]<br /> | influenced = [[Clojure]], [[Dylan (programming language)|Dylan]], [[Emacs Lisp]], [[EuLisp]], [[ISLISP]], [[Julia (programming language)|Julia]], [[Moose (Perl)|Moose]], [[R (programming language)|R]], [[Cadence SKILL|SKILL]], [[SubL]]<br /> | operating_system = [[Cross-platform]]<br /> | license =<br /> | website = {{URL|http://common-lisp.net/}}<br /> | file_ext = .lisp, .lsp, .l, .cl, .fasl<br /> }}<br /> <br /> '''Common Lisp''' ('''CL''') is a dialect of the [[Lisp (programming language)|Lisp]] [[programming language]], published in [[American National Standards Institute|ANSI]] standard document ''ANSI INCITS 226-1994 (R2004)'' (formerly ''X3.226-1994 (R1999)'').&lt;ref&gt;Quoted from cover of cited standard. ANSI INCITS 226-1994 (R2004), for sale on standard's [http://webstore.ansi.org/RecordDetail.aspx?sku=ANSI+INCITS+226-1994+(R2004) document page].&lt;/ref&gt; From the ANSI Common Lisp standard the [[Common Lisp HyperSpec]], a hyperlinked HTML version, has been derived.&lt;ref&gt;[http://www.lispworks.com/documentation/HyperSpec/Front/Help.htm#Authorship Authorship of the Common Lisp HyperSpec]&lt;/ref&gt;<br /> <br /> The Common Lisp language was developed as a standardized and improved successor of [[Maclisp]]. Thus it is not an implementation, but rather a language [[specification]].&lt;ref&gt;[http://www.lispworks.com/documentation/HyperSpec/Body/01_ab.htm Common Lisp HyperSpec 1.1.2 History]&lt;/ref&gt; Several [[#Implementations|implementations]] of the Common Lisp standard are available, including [[free and open source software]] and proprietary products.&lt;ref&gt;[http://common-lisp.net/~dlw/LispSurvey.html Common Lisp Implementations: A Survey]&lt;/ref&gt;<br /> <br /> The first language documentation was published 1984 as [[Common Lisp the Language]], first edition. A second edition, published in 1990, incorporated many changes to the language, made during the ANSI Common Lisp standardization process. The final ANSI Common Lisp standard then was published in 1994. Since then no update to the standard has been published. Various extensions and improvements to Common Lisp (examples are Unicode, Concurrency, CLOS-based IO) have been provided by implementations.<br /> <br /> Common Lisp is a general-purpose, [[multi-paradigm programming language]]. It supports a combination of [[procedural programming|procedural]], [[functional programming|functional]], and [[object-oriented programming]] paradigms. As a [[dynamic programming language]], it facilitates evolutionary and [[Iterative and incremental development|incremental software development]], with iterative [[Compiler|compilation]] into efficient run-time programs. This incremental development is often done interactively without interrupting the running application.<br /> <br /> It also supports optional type annotation and casting, which can be added as necessary at the later profiling and optimization stages, to permit the compiler to generate more efficient code. For instance, &lt;code&gt;fixnum&lt;/code&gt; can hold an [[Boxing (computer science)|unboxed]] integer in a range supported by the hardware and implementation, permitting more efficient arithmetic than on big integers or arbitrary precision types. Similarly, the compiler can be told on a per-module or per-function basis which type safety level is wanted, using ''optimize'' declarations.<br /> <br /> Common Lisp includes [[Common Lisp Object System|CLOS]], an [[object system]] that supports [[multimethods]] and method combinations. It is often implemented with a [[Metaobject]] Protocol.<br /> <br /> Common Lisp is extensible through standard features such as Lisp [[Macro (computer science)|macros]] (code transformations) and reader macros (input parsers for characters).<br /> <br /> Common Lisp provides some backwards compatibility to [[Maclisp]] and to John McCarthy's original [[Lisp (programming language)|Lisp]]. This allows older Lisp software to be ported to Common Lisp.&lt;ref&gt;{{cite web<br /> | url = http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html<br /> | title = Old LISP programs still run in Common Lisp | accessdate = 2015-05-13<br /> }}&lt;/ref&gt;<br /> <br /> ==Syntax==<br /> <br /> Common Lisp is a dialect of Lisp; it uses [[S-expression]]s to denote both code and data structure. Function calls, macro forms and special forms are written as lists, with the name of the function first, as in these examples:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (+ 2 2) ; adds 2 and 2, yielding 4. The function's name is '+'. Lisp has no operators as such.<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defvar *x*) ; Ensures that a variable *x* exists,<br /> ; without giving it a value. The asterisks are part of<br /> ; the name, by convention denoting a special (global) variable. <br /> ; The symbol *x* is also hereby endowed with the property that<br /> ; subsequent bindings of it are dynamic, rather than lexical.<br /> (setf *x* 42.1) ; sets the variable *x* to the floating-point value 42.1<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Define a function that squares a number:<br /> (defun square (x)<br /> (* x x))<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Execute the function:<br /> (square 3) ; Returns 9<br /> &lt;/source&gt;<br /> &lt;!-- I truncated this a bit; in smaller browsers, it runs off the side--&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; the 'let' construct creates a scope for local variables. Here<br /> ;; the variable 'a' is bound to 6 and the variable 'b' is bound<br /> ;; to 4. Inside the 'let' is a 'body', where the last computed value is returned.<br /> ;; Here the result of adding a and b is returned from the 'let' expression.<br /> ;; The variables a and b have lexical scope, unless the symbols have been<br /> ;; marked as special variables (for instance by a prior DEFVAR).<br /> (let ((a 6)<br /> (b 4))<br /> (+ a b)) ; returns 10<br /> &lt;/source&gt;<br /> <br /> ==Data types==<br /> Common Lisp has many data types.<br /> <br /> ===Scalar types===<br /> ''Number'' types include [[integer]]s, [[ratio]]s, [[Floating point|floating-point number]]s, and [[complex number]]s.&lt;ref name=&quot;reddy&quot;&gt;{{cite web<br /> | url = http://random-state.net/features-of-common-lisp.html<br /> | title = Features of Common Lisp<br /> | first = Abhishek | last = Reddy<br /> | date = 2008-08-22<br /> }}&lt;/ref&gt; Common Lisp uses [[Arbitrary-precision arithmetic|bignum]]s to represent numerical values of arbitrary size and precision. The ratio type represents fractions exactly, a facility not available in many languages. Common Lisp automatically coerces numeric values among these types as appropriate.<br /> <br /> The Common Lisp ''[[character (computing)|character]]'' type is not limited to [[ASCII]] characters. Most modern implementations allow [[Unicode]] characters.&lt;ref&gt;{{cite web<br /> | url = http://www.cliki.net/Unicode%20Support<br /> | title = Unicode support | work = The Common Lisp Wiki | accessdate = 2008-08-21<br /> }}&lt;/ref&gt;<br /> <br /> The ''[[Symbol (programming)|symbol]]'' type is common to Lisp languages, but largely unknown outside them. A symbol is a unique, named data object with several parts: name, value, function, property list and package. Of these, ''value cell'' and ''function cell'' are the most important. Symbols in Lisp are often used similarly to identifiers in other languages: to hold the value of a variable; however there are many other uses. Normally, when a symbol is evaluated, its value is returned. Some symbols evaluate to themselves, for example all symbols in the keyword package are self-evaluating. Boolean values in Common Lisp are represented by the self-evaluating symbols T and NIL. Common Lisp has namespaces for symbols, called 'packages'.<br /> <br /> A number of functions are available for [[rounding]] scalar numeric values in various ways. The function &lt;code&gt;round&lt;/code&gt; rounds the argument to the nearest integer, with halfway cases rounded to the even integer. The functions &lt;code&gt;truncate&lt;/code&gt;, &lt;code&gt;floor&lt;/code&gt;, and &lt;code&gt;ceiling&lt;/code&gt; round towards zero, down, or up respectively. All these functions return the discarded fractional part as a secondary value. For example, &lt;code&gt;(floor -2.5)&lt;/code&gt; yields -3, 0.5; &lt;code&gt;(ceiling -2.5)&lt;/code&gt; yields -2, -0.5; &lt;code&gt;(round 2.5)&lt;/code&gt; yields 2, 0.5; and &lt;code&gt;(round 3.5)&lt;/code&gt; yields 4, -0.5.<br /> <br /> ===Data structures===<br /> ''Sequence'' types in Common Lisp include lists, vectors, bit-vectors, and strings. There are many operations which can work on any sequence type.<br /> <br /> As in almost all other Lisp dialects, ''lists'' in Common Lisp are composed of ''conses'', sometimes called ''cons cells'' or ''pairs''. A cons is a data structure with two slots, called its ''car'' and ''cdr''. A list is a linked chain of conses or the empty list. Each cons's car refers to a member of the list (possibly another list). Each cons's cdr refers to the next cons—except for the last cons in a list, whose cdr refers to the &lt;code&gt;nil&lt;/code&gt; value. Conses can also easily be used to implement trees and other complex data structures; though it is usually advised to use structure or class instances instead. It is also possible to create circular data structures with conses.<br /> <br /> Common Lisp supports multidimensional ''arrays'', and can dynamically resize ''adjustable'' arrays if required. Multidimensional arrays can be used for matrix mathematics. A ''vector'' is a one-dimensional array. Arrays can carry any type as members (even mixed types in the same array) or can be specialized to contain a specific type of members, as in a vector of bits. Usually only a few types are supported. Many implementations can optimize array functions when the array used is type-specialized. Two type-specialized array types are standard: a ''string'' is a vector of characters, while a ''bit-vector'' is a vector of [[bit]]s.<br /> <br /> ''[[Hash table]]s'' store associations between data objects. Any object may be used as key or value. Hash tables are automatically resized as needed.<br /> <br /> ''Packages'' are collections of symbols, used chiefly to separate the parts of a program into [[namespaces]]. A package may ''export'' some symbols, marking them as part of a public interface. Packages can use other packages.<br /> <br /> ''Structures'', similar in use to [[C (programming language)|C]] structs and [[Pascal (programming language)|Pascal]] records, represent arbitrary complex data structures with any number and type of fields (called ''slots''). Structures allow single-inheritance.<br /> <br /> ''Classes'' are similar to structures, but offer more dynamic features and multiple-inheritance. (See [[Common Lisp Object System|CLOS]]). Classes have been added late to Common Lisp and there is some conceptual overlap with structures. Objects created of classes are called ''Instances''. A special case are Generic Functions. Generic Functions are both functions and instances.<br /> <br /> ===Functions===<br /> Common Lisp supports [[first-class function]]s. For instance, it is possible to write functions that take other functions as arguments or return functions as well. This makes it possible to describe very general operations.<br /> <br /> The Common Lisp library relies heavily on such higher-order functions. For example, the &lt;code&gt;sort&lt;/code&gt; function takes a [[relational operator]] as an argument and key function as an optional keyword argument. This can be used not only to sort any type of data, but also to sort data structures according to a key.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Sorts the list using the &gt; and &lt; function as the relational operator.<br /> (sort (list 5 2 6 3 1 4) #'&gt;) ; Returns (6 5 4 3 2 1)<br /> (sort (list 5 2 6 3 1 4) #'&lt;) ; Returns (1 2 3 4 5 6)<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; Sorts the list according to the first element of each sub-list.<br /> (sort (list '(9 A) '(3 B) '(4 C)) #'&lt; :key #'first) ; Returns ((3 B) (4 C) (9 A))<br /> &lt;/source&gt;<br /> <br /> The evaluation model for functions is very simple. When the evaluator encounters a form &lt;code&gt;(f a1 a2...)&lt;/code&gt; then it presumes that the symbol named f is one of the following:<br /> <br /> # A special operator (easily checked against a fixed list)<br /> # A macro operator (must have been defined previously)<br /> # The name of a function (default), which may either be a symbol, or a sub-form beginning with the symbol &lt;code&gt;lambda&lt;/code&gt;.<br /> <br /> If f is the name of a function, then the arguments a1, a2, ..., an are evaluated in left-to-right order, and the function is found and invoked with those values supplied as parameters.<br /> <br /> ====Defining functions====<br /> The [[Defun|macro &lt;code&gt;defun&lt;/code&gt;]] defines functions where a function definition gives the name of the function, the names of any arguments, and a function body:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun square (x)<br /> (* x x))<br /> &lt;/source&gt;<br /> <br /> Function definitions may include compiler [[Directive (programming)|directives]], known as ''declarations'', which provide hints to the compiler about optimization settings or the data types of arguments. They may also include ''documentation strings'' (docstrings), which the Lisp system may use to provide interactive documentation:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun square (x)<br /> &quot;Calculates the square of the single-float x.&quot;<br /> (declare (single-float x) (optimize (speed 3) (debug 0) (safety 1)))<br /> (the single-float (* x x)))<br /> &lt;/source&gt;<br /> <br /> Anonymous functions ([[function literal]]s) are defined using &lt;code&gt;lambda&lt;/code&gt; expressions, e.g. &lt;code&gt;(lambda&amp;nbsp;(x)&amp;nbsp;(*&amp;nbsp;x&amp;nbsp;x))&lt;/code&gt; for a function that squares its argument. Lisp programming style frequently uses higher-order functions for which it is useful to provide anonymous functions as arguments.<br /> <br /> Local functions can be defined with &lt;code&gt;flet&lt;/code&gt; and &lt;code&gt;labels&lt;/code&gt;.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (flet ((square (x)<br /> (* x x)))<br /> (square 3))<br /> &lt;/source&gt;<br /> <br /> There are a number of other operators related to the definition and manipulation of functions. For instance, a function may be compiled with the &lt;code&gt;compile&lt;/code&gt; operator. (Some Lisp systems run functions using an interpreter by default unless instructed to compile; others compile every function).<br /> <br /> ====Defining generic functions and methods====<br /> The macro &lt;code&gt;defgeneric&lt;/code&gt; defines generic functions.<br /> The macro &lt;code&gt;defmethod&lt;/code&gt; defines methods. Generic functions are a collection of methods.<br /> <br /> Methods can specialize their parameters over CLOS ''standard classes'', ''system classes'', ''structure classes'' or objects. For many types there are corresponding ''system classes''.<br /> <br /> When a generic function is called, multiple-dispatch will determine the effective method to use.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defgeneric add (a b))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a number) (b number))<br /> (+ a b))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a vector) (b number))<br /> (map 'vector (lambda (n) (+ n b)) a))<br /> &lt;/source&gt;<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a vector) (b vector))<br /> (map 'vector #'+ a b))<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmethod add ((a string)(b string))<br /> (concatenate 'string a b) )<br /> &lt;/source&gt;<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (add 2 3) ; returns 5<br /> (add #(1 2 3 4) 7) ; returns #(8 9 10 11)<br /> (add #(1 2 3 4) #(4 3 2 1)) ; returns #(5 5 5 5)<br /> (add &quot;COMMON &quot; &quot;LISP&quot;) ; returns &quot;COMMON LISP&quot;<br /> &lt;/source&gt;<br /> <br /> Generic Functions are also a first class data type. There are many more features to Generic Functions and Methods than described above.<br /> <br /> ====The function namespace====<br /> &lt;!-- This section name is linked from several places; if you change it, update the links. --&gt;<br /> <br /> The namespace for function names is separate from the namespace for data variables. This is a key difference between Common Lisp and [[Scheme (programming language)|Scheme]]. For Common Lisp, operators that define names in the function namespace include &lt;code&gt;defun&lt;/code&gt;, &lt;code&gt;flet&lt;/code&gt;, &lt;code&gt;labels&lt;/code&gt;, &lt;code&gt;defmethod&lt;/code&gt; and &lt;code&gt;defgeneric&lt;/code&gt;.<br /> <br /> To pass a function by name as an argument to another function, one must use the &lt;code&gt;function&lt;/code&gt; special operator, commonly abbreviated as &lt;code&gt;#'&lt;/code&gt;. The first &lt;code&gt;sort&lt;/code&gt; example above refers to the function named by the symbol &lt;code&gt;&amp;gt;&lt;/code&gt; in the function namespace, with the code &lt;code&gt;#'&amp;gt;&lt;/code&gt;. Conversely, to call a function passed in such a way, one would use the &lt;code&gt;funcall&lt;/code&gt; operator on the argument.<br /> <br /> [[Scheme (programming language)|Scheme's]] evaluation model is simpler: there is only one namespace, and all positions in the form are evaluated (in any order) -- not just the arguments. Code written in one dialect is therefore sometimes confusing to programmers more experienced in the other. For instance, many Common Lisp programmers like to use descriptive variable names such as ''list'' or ''string'' which could cause problems in Scheme, as they would locally shadow function names.<br /> <br /> Whether a separate namespace for functions is an advantage is a source of contention in the Lisp community. It is usually referred to as the ''Lisp-1 vs. Lisp-2 debate''. Lisp-1 refers to Scheme's model and Lisp-2 refers to Common Lisp's model. These names were coined in a 1988 paper by [[Richard P. Gabriel]] and [[Kent Pitman]], which extensively compares the two approaches.&lt;ref&gt;{{cite journal |title=Technical Issues of Separation in Function Cells and Value Cells |url=http://www.nhplace.com/kent/Papers/Technical-Issues.html |authors=Richard P. Gabriel, Kent M. Pitman |journal=Lisp and Symbolic Computation |date = June 1988|volume=1 |issue=1 |pages=81–101 |doi=10.1007/bf01806178}}&lt;/ref&gt;<br /> <br /> ===Other types===<br /> Other data types in Common Lisp include:<br /> <br /> *''Pathnames'' represent files and directories in the [[filesystem]]. The Common Lisp pathname facility is more general than most operating systems' file naming conventions, making Lisp programs' access to files broadly portable across diverse systems.<br /> *Input and output ''streams'' represent sources and sinks of binary or textual data, such as the terminal or open files.<br /> *Common Lisp has a built-in [[pseudo-random number generator]] (PRNG). ''Random state'' objects represent reusable sources of pseudo-random numbers, allowing the user to seed the PRNG or cause it to replay a sequence.<br /> *''Conditions'' are a type used to represent errors, exceptions, and other &quot;interesting&quot; events to which a program may respond.<br /> *''Classes'' are [[first-class object]]s, and are themselves instances of classes called [[metaclasses|metaobject classes]] ([[metaclasses]] for short).<br /> *''Readtables'' are a type of object which control how Common Lisp's reader parses the text of source code. By controlling which readtable is in use when code is read in, the programmer can change or extend the language's syntax.<br /> <br /> ==Scope==<br /> <br /> Like programs in many other programming languages, Common Lisp programs make use of names to refer to variables, functions, and many other kinds of entities. Named references are subject to scope.<br /> <br /> The association between a name and the entity which the name refers to is called a binding.<br /> <br /> Scope refers to the set of circumstances in which a name is determined to have a particular binding.<br /> <br /> ===Determiners of scope===<br /> <br /> The circumstances which determine scope in Common Lisp include:<br /> <br /> * the location of a reference within an expression. If it's the leftmost position of a compound, it refers to a special operator or a macro or function binding, otherwise to a variable binding or something else.<br /> * the kind of expression in which the reference takes place. For instance, &lt;code&gt;(go x)&lt;/code&gt; means transfer control to label &lt;code&gt;x&lt;/code&gt;, whereas &lt;code&gt;(print x)&lt;/code&gt; refers to the variable &lt;code&gt;x&lt;/code&gt;. Both scopes of &lt;code&gt;x&lt;/code&gt; can be active in the same region of program text, since tagbody labels are in a separate namespace from variable names. A special form or macro form has complete control over the meanings of all symbols in its syntax. For instance in &lt;code&gt;(defclass x (a b) ())&lt;/code&gt;, a class definition, the &lt;code&gt;(a b)&lt;/code&gt; is a list of base classes, so these names are looked up in the space of class names, and &lt;code&gt;x&lt;/code&gt; isn't a reference to an existing binding, but the name of a new class being derived from &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;. These facts emerge purely from the semantics of &lt;code&gt;defclass&lt;/code&gt;. The only generic fact about this expression is that &lt;code&gt;defclass&lt;/code&gt; refers to a macro binding; everything else is up to &lt;code&gt;defclass&lt;/code&gt;.<br /> * the location of the reference within the program text. For instance, if a reference to variable &lt;code&gt;x&lt;/code&gt; is enclosed in a binding construct such as a &lt;code&gt;let&lt;/code&gt; which defines a binding for &lt;code&gt;x&lt;/code&gt;, then the reference is in the scope created by that binding.<br /> * for a variable reference, whether or not a variable symbol has been, locally or globally, declared special. This determines whether the reference is resolved within a lexical environment, or within a dynamic environment.<br /> * the specific instance of the environment in which the reference is resolved. An environment is a run-time dictionary which maps symbols to bindings. Each kind of reference uses its own kind of environment. References to lexical variables are resolved in a lexical environment, et cetera. More than one environment can be associated with the same reference. For instance, thanks to recursion or the use of multiple threads, multiple activations of the same function can exist at the same time. These activations share the same program text, but each has its own lexical environment instance.<br /> <br /> To understand what a symbol refers to, the Common Lisp programmer must know what kind of reference is being expressed, what kind of scope it uses if it is a variable reference (dynamic versus lexical scope), and also the run-time situation: in what environment is the reference resolved, where was the binding introduced into the environment, et cetera.<br /> <br /> ===Kinds of environment===<br /> <br /> ====Global====<br /> <br /> Some environments in Lisp are globally pervasive. For instance, if a new type is defined, it is known everywhere thereafter. References to that type look it up in this global environment.<br /> <br /> ====Dynamic====<br /> <br /> One type of environment in Common Lisp is the dynamic environment. Bindings established in this environment have dynamic extent, which means that a binding is established at the start of the execution of some construct, such as a &lt;code&gt;let&lt;/code&gt; block, and disappears when that construct finishes executing: its lifetime is tied to the dynamic activation and deactivation of a block. However, a dynamic binding is not just visible within that block; it is also visible to all functions invoked from that block. This type of visibility is known as indefinite scope. Bindings which exhibit dynamic extent (lifetime tied to the activation and deactivation of a block) and indefinite scope (visible to all functions which are called from that block) are said to have dynamic scope.<br /> <br /> Common Lisp has support for dynamically scoped variables, which are also called special variables. Certain other kinds of bindings are necessarily dynamically scoped also, such as restarts and catch tags. Function bindings cannot be dynamically scoped using &lt;code&gt;flet&lt;/code&gt; (which only provides lexically scoped function bindings), but function objects (a first-level object in Common Lisp) can be assigned to dynamically scoped variables, bound using &lt;code&gt;let&lt;/code&gt; in dynamic scope, then called using &lt;code&gt;funcall&lt;/code&gt; or &lt;code&gt;APPLY&lt;/code&gt;.<br /> <br /> Dynamic scope is extremely useful because it adds referential clarity and discipline to [[global variable]]s. Global variables are frowned upon in computer science as potential sources of error, because they can give rise to ad-hoc, covert channels of communication among modules that lead to unwanted, surprising interactions.<br /> <br /> In Common Lisp, a special variable which has only a top-level binding behaves just like a global variable in other programming languages. A new value can be stored into it, and that value simply replaces what is in the top-level binding. Careless replacement of the value of a global variable is at the heart of bugs caused by use of global variables. However, another way to work with a special variable is to give it a new, local binding within an expression. This is sometimes referred to as &quot;rebinding&quot; the variable. Binding a dynamically scoped variable temporarily creates a new memory location for that variable, and associates the name with that location. While that binding is in effect, all references to that variable refer to the new binding; the previous binding is hidden. When execution of the binding expression terminates, the temporary memory location is gone, and the old binding is revealed, with the original value intact. Of course, multiple dynamic bindings for the same variable can be nested.<br /> <br /> In Common Lisp implementations which support multithreading, dynamic scopes are specific to each thread of execution. Thus special variables serve as an abstraction for thread local storage. If one thread rebinds a special variable, this rebinding has no effect on that variable in other threads. The value stored in a binding can only be retrieved by the thread which created that binding. If each thread binds some special variable &lt;code&gt;*x*&lt;/code&gt;, then &lt;code&gt;*x*&lt;/code&gt; behaves like thread-local storage. Among threads which do not rebind &lt;code&gt;*x*&lt;/code&gt;, it behaves like an ordinary global: all of these threads refer to the same top-level binding of &lt;code&gt;*x*&lt;/code&gt;.<br /> <br /> Dynamic variables can be used to extend the execution context with additional context information which is implicitly passed from function to function without having to appear as an extra function parameter. This is especially useful when the control transfer has to pass through layers of unrelated code, which simply cannot be extended with extra parameters to pass the additional data. A situation like this usually calls for a global variable. That global variable must be saved and restored, so that the scheme doesn't break under recursion: dynamic variable rebinding takes care of this. And that variable must be made thread-local (or else a big mutex must be used) so the scheme doesn't break under threads: dynamic scope implementations can take care of this also.<br /> <br /> In the Common Lisp library, there are many standard special variables. For instance, all standard I/O streams are stored in the top-level bindings of well-known special variables. The standard output stream is stored in *standard-output*.<br /> <br /> Suppose a function foo writes to standard output:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun foo ()<br /> (format t &quot;Hello, world&quot;))<br /> &lt;/source&gt;<br /> <br /> To capture its output in a character string, *standard-output* can be bound to a string stream and called:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (with-output-to-string (*standard-output*)<br /> (foo))<br /> &lt;/source&gt;<br /> <br /> -&gt; &quot;Hello, world&quot; ; gathered output returned as a string<br /> <br /> ====Lexical====<br /> <br /> Common Lisp supports lexical environments. Formally, the bindings in a lexical environment have [[lexical scope]] and may have either indefinite extent or dynamic extent, depending on the type of namespace. [[Lexical scope]] means that visibility is physically restricted to the block in which the binding is established. References which are not textually (i.e. lexically) embedded in that block simply do not see that binding.<br /> <br /> The tags in a TAGBODY have lexical scope. The expression (GO X) is erroneous if it is not actually embedded in a TAGBODY which contains a label X. However, the label bindings disappear when the TAGBODY terminates its execution, because they have dynamic extent. If that block of code is re-entered by the invocation of a lexical closure, it is invalid for the body of that closure to try to transfer control to a tag via GO:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defvar *stashed*) ;; will hold a function<br /> <br /> (tagbody<br /> (setf *stashed* (lambda () (go some-label)))<br /> (go end-label) ;; skip the (print &quot;Hello&quot;)<br /> some-label<br /> (print &quot;Hello&quot;)<br /> end-label)<br /> -&gt; NIL<br /> &lt;/source&gt;<br /> <br /> When the TAGBODY is executed, it first evaluates the setf form which stores a function in the special variable *stashed*. Then the (go end-label) transfers control to end-label, skipping the code (print &quot;Hello&quot;). Since end-label is at the end of the tagbody, the tagbody terminates, yielding NIL. Suppose that the previously remembered function is now called:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (funcall *stashed*) ;; Error!<br /> &lt;/source&gt;<br /> <br /> This situation is erroneous. One implementation's response is an error condition containing the message, &quot;GO: tagbody for tag SOME-LABEL has already been left&quot;. The function tried to evaluate (go some-label), which is lexically embedded in the tagbody, and resolves to the label. However, the tagbody isn't executing (its extent has ended), and so the control transfer cannot take place.<br /> <br /> Local function bindings in Lisp have [[lexical scope]], and variable bindings also have lexical scope by default. By contrast with GO labels, both of these have indefinite extent. When a lexical function or variable binding is established, that binding continues to exist for as long as references to it are possible, even after the construct which established that binding has terminated. References to lexical variables and functions after the termination of their establishing construct are possible thanks to [[lexical closure]]s.<br /> <br /> Lexical binding is the default binding mode for Common Lisp variables. For an individual symbol, it can be switched to dynamic scope, either by a local declaration, by a global declaration. The latter may occur implicitly through the use of a construct like DEFVAR or DEFPARAMETER. It is an important convention in Common Lisp programming that special (i.e. dynamically scoped) variables have names which begin and end with an asterisk [[Sigil (computer programming)|sigil]] &lt;code&gt;*&lt;/code&gt; in what is called the “[[earmuff]] convention”.&lt;ref&gt;[http://letoverlambda.com/index.cl/guest/chap2.html Chapter 2] of [[Let Over Lambda]]&lt;/ref&gt; If adhered to, this convention effectively creates a separate namespace for special variables, so that variables intended to be lexical are not accidentally made special.<br /> <br /> [[Lexical scope]] is useful for several reasons.<br /> <br /> Firstly, references to variables and functions can be compiled to efficient machine code, because the run-time environment structure is relatively simple. In many cases it can be optimized to stack storage, so opening and closing lexical scopes has minimal overhead. Even in cases where full closures must be generated, access to the closure's environment is still efficient; typically each variable becomes an offset into a vector of bindings, and so a variable reference becomes a simple load or store instruction with a base-plus-offset [[addressing mode]].<br /> <br /> Secondly, lexical scope (combined with indefinite extent) gives rise to the [[lexical closure]], which in turn creates a whole paradigm of programming centered around the use of functions being first-class objects, which is at the root of functional programming.<br /> <br /> Thirdly, perhaps most importantly, even if lexical closures are not exploited, the use of lexical scope isolates program modules from unwanted interactions. Due to their restricted visibility, lexical variables are private. If one module A binds a lexical variable X, and calls another module B, references to X in B will not accidentally resolve to the X bound in A. B simply has no access to X. For situations in which disciplined interactions through a variable are desirable, Common Lisp provides special variables. Special variables allow for a module A to set up a binding for a variable X which is visible to another module B, called from A. Being able to do this is an advantage, and being able to prevent it from happening is also an advantage; consequently, Common Lisp supports both lexical and [[dynamic scope]].<br /> <br /> ==Macros==<br /> A ''[[Macro (computer science)|macro]]'' in Lisp superficially resembles a function in usage. However, rather than representing an expression which is evaluated, it represents a transformation of the program source code. The macro gets the source it surrounds as arguments, binds them to its parameters and computes a new source form. This new form can also use a macro. The macro expansion is repeated until the new source form does not use a macro. The final computed form is the source code executed at runtime.<br /> <br /> Typical uses of macros in Lisp:<br /> <br /> * new control structures (example: looping constructs, branching constructs)<br /> * scoping and binding constructs<br /> * simplified syntax for complex and repeated source code<br /> * top-level defining forms with compile-time side-effects<br /> * data-driven programming<br /> * embedded domain specific languages (examples: SQL, HTML, Prolog)<br /> * implicit finalization forms<br /> <br /> Various standard Common Lisp features also need to be implemented as macros, such as:<br /> <br /> * the standard &lt;code&gt;setf&lt;/code&gt; abstraction, to allow custom compile-time expansions of assignment/access operators<br /> * &lt;code&gt;with-accessors&lt;/code&gt;, &lt;code&gt;with-slots&lt;/code&gt;, &lt;code&gt;with-open-file&lt;/code&gt; and other similar &lt;code&gt;WITH&lt;/code&gt; macros<br /> * Depending on implementation, &lt;code&gt;if&lt;/code&gt; or &lt;code&gt;cond&lt;/code&gt; is a macro built on the other, the special operator; &lt;code&gt;when&lt;/code&gt; and &lt;code&gt;unless&lt;/code&gt; consist of macros<br /> * The powerful &lt;code&gt;loop&lt;/code&gt; domain-specific language<br /> <br /> Macros are defined by the ''defmacro'' macro. The special operator ''macrolet'' allows the definition of local (lexically scoped) macros. It is also possible to define macros for symbols using ''define-symbol-macro'' and ''symbol-macrolet''.<br /> <br /> [[Paul Graham (computer programmer)|Paul Graham]]'s book [[On Lisp]] describes the use of macros in Common Lisp in detail. [[Doug Hoyte]]'s book [[Let Over Lambda]] extends the discussion on macros, claiming &quot;Macros are the single greatest advantage that lisp has as a programming language and the single greatest advantage of any programming language.&quot; Hoyte provides several examples of iterative development of macros.<br /> <br /> ===Example using a macro to define a new control structure===<br /> Macros allow Lisp programmers to create new syntactic forms in the language. One typical use is to create new control structures. The example macro provides an &lt;code&gt;until&lt;/code&gt; looping construct. The syntax is:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> (until test form*)<br /> &lt;/source&gt;<br /> <br /> The macro definition for ''until'':<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defmacro until (test &amp;body body)<br /> (let ((start-tag (gensym &quot;START&quot;))<br /> (end-tag (gensym &quot;END&quot;)))<br /> `(tagbody ,start-tag<br /> (when ,test (go ,end-tag))<br /> (progn ,@body)<br /> (go ,start-tag)<br /> ,end-tag)))<br /> &lt;/source&gt;<br /> <br /> ''tagbody'' is a primitive Common Lisp special operator which provides the ability to name tags and use the ''go'' form to jump to those tags. The backquote ''`'' provides a notation that provides code templates, where the value of forms preceded with a comma are filled in. Forms preceded with comma and at-sign are ''spliced'' in. The tagbody form tests the end condition. If the condition is true, it jumps to the end tag. Otherwise the provided body code is executed and then it jumps to the start tag.<br /> <br /> An example form using above ''until'' macro:<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (until (= (random 10) 0)<br /> (write-line &quot;Hello&quot;))<br /> &lt;/source&gt;<br /> <br /> The code can be expanded using the function ''macroexpand-1''. The expansion for above example looks like this:<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (TAGBODY<br /> #:START1136<br /> (WHEN (ZEROP (RANDOM 10))<br /> (GO #:END1137))<br /> (PROGN (WRITE-LINE &quot;hello&quot;))<br /> (GO #:START1136)<br /> #:END1137)<br /> &lt;/source&gt;<br /> <br /> During macro expansion the value of the variable ''test'' is ''(= (random 10) 0)'' and the value of the variable ''body'' is ''((write-line &quot;Hello&quot;))''. The body is a list of forms.<br /> <br /> Symbols are usually automatically upcased. The expansion uses the TAGBODY with two labels. The symbols for these labels are computed by GENSYM and are not interned in any package. Two ''go'' forms use these tags to jump to. Since ''tagbody'' is a primitive operator in Common Lisp (and not a macro), it will not be expanded into something else. The expanded form uses the ''when'' macro, which also will be expanded. Fully expanding a source form is called ''code walking''.<br /> <br /> In the fully expanded (''walked'') form, the ''when'' form is replaced by the primitive ''if'':<br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (TAGBODY<br /> #:START1136<br /> (IF (ZEROP (RANDOM 10))<br /> (PROGN (GO #:END1137))<br /> NIL)<br /> (PROGN (WRITE-LINE &quot;hello&quot;))<br /> (GO #:START1136))<br /> #:END1137)<br /> &lt;/source&gt;<br /> <br /> All macros must be expanded before the source code containing them can be evaluated or compiled normally. Macros can be considered functions that accept and return [[abstract syntax tree]]s (Lisp S-expressions). These functions<br /> are invoked before the evaluator or compiler to produce the final source code.<br /> Macros are written in normal Common Lisp, and may use any Common Lisp (or third-party) operator available.<br /> <br /> ===Variable capture and shadowing===<br /> Common Lisp macros are capable of what is commonly called ''variable capture'', where symbols in the macro-expansion body coincide with those in the calling context, allowing the programmer to create macros wherein various symbols have special meaning. The term ''variable capture'' is somewhat misleading, because all namespaces are vulnerable to unwanted capture, including the operator and function namespace, the tagbody label namespace, catch tag, condition handler and restart namespaces.<br /> <br /> ''Variable capture'' can introduce software defects. This happens in one of the following two ways:<br /> <br /> * In the first way, a macro expansion can inadvertently make a symbolic reference which the macro writer assumed will resolve in a global namespace, but the code where the macro is expanded happens to provide a local, shadowing definition which steals that reference. Let this be referred to as type 1 capture.<br /> <br /> * The second way, type 2 capture, is just the opposite: some of the arguments of the macro are pieces of code supplied by the macro caller, and those pieces of code are written such that they make references to surrounding bindings. However, the macro inserts these pieces of code into an expansion which defines its own bindings that accidentally captures some of these references.<br /> <br /> The Scheme dialect of Lisp provides a macro-writing system which provides the referential transparency that eliminates both types of capture problem. This type of macro system is sometimes called &quot;hygienic&quot;, in particular by its proponents (who regard macro systems which do not automatically solve this problem as unhygienic). {{Citation needed|date=May 2011}}<br /> <br /> In Common Lisp, macro hygiene is ensured one of two different ways.<br /> <br /> One approach is to use [[gensym]]s: guaranteed-unique symbols which can be used in a macro-expansion without threat of capture. The use of gensyms in a macro definition is a manual chore, but macros can be written which simplify the instantiation and use of gensyms. Gensyms solve type 2 capture easily, but they are not applicable to type 1 capture in the same way, because the macro expansion cannot rename the interfering symbols in the surrounding code which capture its references. Gensyms could be used to provide stable aliases for the global symbols which the macro expansion needs. The macro expansion would use these secret aliases rather than the well-known names, so redefinition of the well-known names would have no ill effect on the macro.<br /> <br /> Another approach is to use packages. A macro defined in its own package can simply use internal symbols in that package in its expansion. The use of packages deals with type 1 and type 2 capture.<br /> <br /> However, packages don't solve the type 1 capture of references to standard Common Lisp functions and operators. The reason is that the use of packages to solve capture problems revolves around the use of private symbols (symbols in one package, which are not imported into, or otherwise made visible in other packages). Whereas the Common Lisp library symbols are external, and frequently imported into or made visible in user-defined packages.<br /> <br /> The following is an example of unwanted capture in the operator namespace, occurring in the expansion of a macro:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> ;; expansion of UNTIL makes liberal use of DO<br /> (defmacro until (expression &amp;body body)<br /> `(do () (,expression) ,@body))<br /> <br /> ;; macrolet establishes lexical operator binding for DO<br /> (macrolet ((do (...) ... something else ...))<br /> (until (= (random 10) 0) (write-line &quot;Hello&quot;)))<br /> &lt;/source&gt;<br /> <br /> The &lt;code&gt;until&lt;/code&gt; macro will expand into a form which calls &lt;code&gt;do&lt;/code&gt; which is intended to refer to the standard Common Lisp macro &lt;code&gt;do&lt;/code&gt;. However, in this context, &lt;code&gt;do&lt;/code&gt; may have a completely different meaning, so &lt;code&gt;until&lt;/code&gt; may not work properly.<br /> <br /> Common Lisp solves the problem of the shadowing of standard operators and functions by forbidding their redefinition. Because it redefines the standard operator &lt;code&gt;do&lt;/code&gt;, the preceding is actually a fragment of non-conforming Common Lisp, which allows implementations to diagnose and reject it.<br /> <br /> ==Condition system==<br /> The ''condition system'' is responsible for [[exception handling]] in Common Lisp.&lt;ref name=&quot;Seibel2005&quot;&gt;{{cite book|author=Peter Seibel|title=Practical Common Lisp|url=http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html|date=7 April 2005|publisher=Apress|isbn=978-1-59059-239-7}}&lt;/ref&gt; It provides ''conditions'', ''handler''s and ''restart''s. ''Condition''s are objects describing an exceptional situation (for example an error). If a ''condition'' is signaled, the Common Lisp system searches for a ''handler'' for this condition type and calls the handler. The ''handler'' can now search for restarts and use one of these restarts to repair the current problem. As part of a user interface (for example of a debugger), these restarts can also be presented to the user, so that the user can select and invoke one of the available restarts. Since the condition handler is called in the context of the error (without unwinding the stack), full error recovery is possible in many cases, where other exception handling systems would have already terminated the current routine. The debugger itself can also be customized or replaced using the &lt;code&gt;*debugger-hook*&lt;/code&gt; dynamic variable.<br /> <br /> In the following example (using [[Symbolics Genera]]) the user tries to open a file in a Lisp function ''test'' called from the Read-Eval-Print-LOOP ([[REPL]]), when the file does not exist. The Lisp system presents four restarts. The user selects the ''Retry OPEN using a different pathname'' restart and enters a different pathname (lispm-init.lisp instead of lispm-int.lisp). The user code does not contain any error handling code. The whole error handling and restart code is provided by the Lisp system, which can handle and repair the error without terminating the user code.<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> Command: (test &quot;&gt;zippy&gt;lispm-int.lisp&quot;)<br /> <br /> Error: The file was not found.<br /> For lispm:&gt;zippy&gt;lispm-int.lisp.newest<br /> <br /> LMFS:OPEN-LOCAL-LMFS-1<br /> Arg 0: #P&quot;lispm:&gt;zippy&gt;lispm-int.lisp.newest&quot;<br /> <br /> s-A, &lt;Resume&gt;: Retry OPEN of lispm:&gt;zippy&gt;lispm-int.lisp.newest<br /> s-B: Retry OPEN using a different pathname<br /> s-C, &lt;Abort&gt;: Return to Lisp Top Level in a TELNET server<br /> s-D: Restart process TELNET terminal<br /> <br /> -&gt; Retry OPEN using a different pathname<br /> Use what pathname instead [default lispm:&gt;zippy&gt;lispm-int.lisp.newest]:<br /> lispm:&gt;zippy&gt;lispm-init.lisp.newest<br /> <br /> ...the program continues<br /> &lt;/source&gt;<br /> <br /> ==Common Lisp Object System (CLOS)==<br /> <br /> {{Main|Common Lisp Object System}}<br /> <br /> Common Lisp includes a toolkit for [[object-oriented programming]], the Common Lisp Object System or [[Common Lisp Object System|CLOS]], which is one of the most powerful object systems available in any language. For example, [[Peter Norvig]] explains how many [[Design pattern (computer science)|Design Patterns]] are simpler to implement in a dynamic language with the features of CLOS (Multiple Inheritance, Mixins, Multimethods, Metaclasses, Method combinations, etc.).&lt;ref&gt;[http://norvig.com/design-patterns/ppframe.htm Peter Norvig, Design Patterns in Dynamic Programming]&lt;/ref&gt;<br /> Several extensions to Common Lisp for object-oriented programming have been proposed to be included into the ANSI Common Lisp standard, but eventually CLOS was adopted as the standard object-system for Common Lisp. CLOS is a [[dynamic programming language|dynamic]] object system with [[multiple dispatch]] and [[multiple inheritance]], and differs radically from the OOP facilities found in static languages such as [[C++]] or [[Java (programming language)|Java]]. As a dynamic object system, CLOS allows changes at runtime to generic functions and classes. Methods can be added and removed, classes can be added and redefined, objects can be updated for class changes and the class of objects can be changed.<br /> <br /> CLOS has been integrated into ANSI Common Lisp. Generic Functions can be used like normal functions and are a first-class data type. Every CLOS class is integrated into the Common Lisp type system. Many Common Lisp types have a corresponding class. There is more potential use of CLOS for Common Lisp. The specification does not say whether conditions are implemented with CLOS. Pathnames and streams could be implemented with CLOS. These further usage possibilities of CLOS for ANSI Common Lisp are not part of the standard. Actual Common Lisp implementations are using CLOS for pathnames, streams, input/output, conditions, the implementation of CLOS itself and more.<br /> <br /> ==Compiler and interpreter==<br /> Several implementations of earlier Lisp dialects provided both an interpreter and a compiler. Unfortunately often the semantics were different. These earlier Lisps implemented lexical scoping in the compiler and dynamic scoping in the interpreter. Common Lisp requires that both the interpreter and compiler use lexical scoping by default. The Common Lisp standard describes both the semantics of the interpreter and a compiler. The compiler can be called using the function ''compile'' for individual functions and using the function ''compile-file'' for files. Common Lisp allows type declarations and provides ways to influence the compiler code generation policy. For the latter various optimization qualities can be given values between 0 (not important) and 3 (most important): ''speed'', ''space'', ''safety'', ''debug'' and ''compilation-speed''.<br /> <br /> There is also a function to evaluate Lisp code: ''eval''. ''eval'' takes code as pre-parsed s-expressions and not, like in some other languages, as text strings. This way code can be constructed with the usual Lisp functions for constructing lists and symbols and then this code can be evaluated with ''eval''. Several Common Lisp implementations (like Clozure CL and SBCL) are implementing ''eval'' using their compiler. This way code is compiled, even though it is evaluated using the function ''eval''.<br /> <br /> The file compiler is invoked using the function ''compile-file''. The generated file with compiled code is called a ''fasl'' (from ''fast load'') file. These ''fasl'' files and also source code files can be loaded with the function ''load'' into a running Common Lisp system. Depending on the implementation, the file compiler generates byte-code (for example for the [[Java Virtual Machine]]), [[C (programming language)|C language]] code (which then is compiled with a C compiler) or, directly, native code.<br /> <br /> Common Lisp implementations can be used interactively, even though the code gets fully compiled. The idea of an [[Interpreted language]] thus does not apply for interactive Common Lisp.<br /> <br /> The language makes distinction between read-time, compile-time, load-time and run-time, and allows user code to also make this distinction to perform the wanted type of processing at the wanted step.<br /> <br /> Some special operators are provided to especially suit interactive development; for instance, &lt;code&gt;defvar&lt;/code&gt; will only assign a value to its provided variable if it wasn't already bound, while &lt;code&gt;defparameter&lt;/code&gt; will always perform the assignment. This distinction is useful when interactively evaluating, compiling and loading code in a live image.<br /> <br /> Some features are also provided to help writing compilers and interpreters. Symbols consist of first-level objects and are directly manipulable by user code. The &lt;code&gt;progv&lt;/code&gt; special operator allows to create lexical bindings programmatically, while packages are also manipulable. The Lisp compiler itself is available at runtime to compile files or individual functions. These make it easy to use Lisp as an intermediate compiler or interpreter for another language.<br /> <br /> ==Code examples==<br /> <br /> ===Birthday paradox===<br /> The following program calculates the smallest number of people in a room for whom the probability of completely unique birthdays is less than 50% (the so-called [[birthday paradox]], where for 1 person the probability is obviously 100%, for 2 it is 364/365, etc.). (Answer = 23.) By convention, constants in Common Lisp are bracketed with &lt;tt&gt;+&lt;/tt&gt; characters.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defconstant +year-size+ 365)<br /> <br /> (defun birthday-paradox (probability number-of-people)<br /> (let ((new-probability (* (/ (- +year-size+ number-of-people)<br /> +year-size+)<br /> probability)))<br /> (if (&lt; new-probability 0.5)<br /> (1+ number-of-people)<br /> (birthday-paradox new-probability (1+ number-of-people)))))<br /> &lt;/source&gt;<br /> <br /> Calling the example function using the [[REPL]] (Read Eval Print Loop):<br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (birthday-paradox 1.0 1)<br /> 23<br /> &lt;/source&gt;<br /> <br /> ===Sorting a list of person objects===<br /> <br /> We define a class PERSON and a method for displaying the name and age of a person.<br /> Next we define a group of persons as a list of PERSON objects.<br /> Then we iterate over the sorted list.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defclass person ()<br /> ((name :initarg :name :accessor person-name)<br /> (age :initarg :age :accessor person-age))<br /> (:documentation &quot;The class PERSON with slots NAME and AGE.&quot;))<br /> <br /> (defmethod display ((object person) stream)<br /> &quot;Displaying a PERSON object to an output stream.&quot;<br /> (with-slots (name age) object<br /> (format stream &quot;~a (~a)&quot; name age)))<br /> <br /> (defparameter *group*<br /> (list (make-instance 'person :name &quot;Bob&quot; :age 33)<br /> (make-instance 'person :name &quot;Chris&quot; :age 16)<br /> (make-instance 'person :name &quot;Ash&quot; :age 23))<br /> &quot;A list of PERSON objects.&quot;)<br /> <br /> (dolist (person (sort (copy-list *group*)<br /> #'&gt;<br /> :key #'person-age))<br /> (display person *standard-output*)<br /> (terpri))<br /> &lt;/source&gt;<br /> <br /> It prints the three names with descending age.<br /> &lt;source lang=&quot;text&quot;&gt;<br /> Bob (33)<br /> Ash (23)<br /> Chris (16)<br /> &lt;/source&gt;<br /> <br /> ===Exponentiating by squaring===<br /> <br /> Use of the LOOP macro is demonstrated:<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun power (x n)<br /> (loop with result = 1<br /> while (plusp n)<br /> when (oddp n) do (setf result (* result x))<br /> do (setf x (* x x)<br /> n (truncate n 2))<br /> finally (return result)))<br /> &lt;/source&gt;<br /> <br /> Example use:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (power 2 200)<br /> 1606938044258990275541962092341162602522202993782792835301376<br /> &lt;/source&gt;<br /> <br /> Compare with the built in exponentiation:<br /> <br /> &lt;source lang=&quot;text&quot;&gt;<br /> CL-USER &gt; (= (expt 2 200) (power 2 200))<br /> T<br /> &lt;/source&gt;<br /> <br /> ===Find the list of available shells===<br /> <br /> WITH-OPEN-FILE is a macro that opens a file and provides a stream. When the form is returning, the file is automatically closed. FUNCALL calls a function object. The LOOP collects all lines that match the predicate.<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun list-matching-lines (file predicate)<br /> &quot;Returns a list of lines in file, for which the predicate applied to<br /> the line returns T.&quot;<br /> (with-open-file (stream file)<br /> (loop for line = (read-line stream nil nil)<br /> while line<br /> when (funcall predicate line)<br /> collect it)))<br /> &lt;/source&gt;<br /> <br /> The function AVAILABLE-SHELLS calls above function LIST-MATCHING-LINES with a pathname and an anonymous function as the predicate. The predicate returns the pathname of a shell or NIL (if the string is not the filename of a shell).<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> (defun available-shells (&amp;optional (file #p&quot;/etc/shells&quot;))<br /> (list-matching-lines<br /> file<br /> (lambda (line)<br /> (and (plusp (length line))<br /> (char= (char line 0) #\/)<br /> (pathname<br /> (string-right-trim '(#\space #\tab) line))))))<br /> &lt;/source&gt;<br /> <br /> Example results (on Mac OS X 10.6):<br /> <br /> &lt;source lang=&quot;lisp&quot;&gt;<br /> CL-USER &gt; (available-shells)<br /> (#P&quot;/bin/bash&quot; #P&quot;/bin/csh&quot; #P&quot;/bin/ksh&quot; #P&quot;/bin/sh&quot; #P&quot;/bin/tcsh&quot; #P&quot;/bin/zsh&quot;)<br /> &lt;/source&gt;<br /> <br /> ==Comparison with other Lisps==<br /> &lt;!-- needs lots --&gt;<br /> Common Lisp is most frequently compared with, and contrasted to, [[Scheme (programming language)|Scheme]]—if only because they are the two most popular Lisp dialects. Scheme predates CL, and comes not only from the same Lisp tradition but from some of the same engineers—[[Guy L. Steele, Jr.|Guy L. Steele]], with whom [[Gerald Jay Sussman]] designed Scheme, chaired the standards committee for Common Lisp.<br /> <br /> Common Lisp is a general-purpose programming language, in contrast to Lisp variants such as [[Emacs Lisp]] and [[AutoLISP]] which are [[extension languages]] embedded in particular products. Unlike many earlier Lisps, Common Lisp (like [[Scheme (programming language)|Scheme]]) uses lexical variable [[scope (programming)|scope]] by default for both interpreted and compiled code.<br /> <br /> Most of the Lisp systems whose designs contributed to Common Lisp—such as [[ZetaLisp]] and Franz Lisp—used dynamically [[scope (programming)|scoped]] variables in their interpreters and lexically scoped variables in their compilers. Scheme introduced the sole use of lexically scoped variables to Lisp; an inspiration from [[ALGOL 68]] which was widely recognized as a good idea. CL supports dynamically scoped variables as well, but they must be explicitly declared as &quot;special&quot;. There are no differences in scoping between ANSI CL interpreters and compilers.<br /> <br /> Common Lisp is sometimes termed a ''Lisp-2'' and Scheme a ''Lisp-1'', referring to CL's use of separate namespaces for functions and variables. (In fact, CL has ''many'' namespaces, such as those for go tags, block names, and &lt;code&gt;loop&lt;/code&gt; keywords). There is a long-standing controversy between CL and Scheme advocates over the tradeoffs involved in multiple namespaces. In Scheme, it is (broadly) necessary to avoid giving variables names which clash with functions; Scheme functions frequently have arguments named &lt;code&gt;lis&lt;/code&gt;, &lt;code&gt;lst&lt;/code&gt;, or &lt;code&gt;lyst&lt;/code&gt; so as not to conflict with the system function &lt;code&gt;list&lt;/code&gt;. However, in CL it is necessary to explicitly refer to the function namespace when passing a function as an argument—which is also a common occurrence, as in the &lt;code&gt;sort&lt;/code&gt; example above.<br /> <br /> CL also differs from Scheme in its handling of boolean values. Scheme uses the special values #t and #f to represent truth and falsity. CL follows the older Lisp convention of using the symbols T and NIL, with NIL standing also for the empty list. In CL, ''any'' non-NIL value is treated as true by conditionals, such as &lt;code&gt;if&lt;/code&gt;, whereas in Scheme all non-#f values are treated as true. These conventions allow some operators in both languages to serve both as predicates (answering a boolean-valued question) and as returning a useful value for further computation, but in Scheme the value '() which is equivalent to NIL in Common Lisp evaluates to true in a boolean expression.<br /> <br /> Lastly, the Scheme standards documents require [[tail recursion|tail-call optimization]], which the CL standard does not. Most CL implementations do offer tail-call optimization, although often only when the programmer uses an optimization directive. Nonetheless, common CL coding style does not favor the ubiquitous use of recursion that Scheme style prefers—what a Scheme programmer would express with tail recursion, a CL user would usually express with an iterative expression in &lt;code&gt;do&lt;/code&gt;, &lt;code&gt;dolist&lt;/code&gt;, &lt;code&gt;loop&lt;/code&gt;, or (more recently) with the &lt;code&gt;iterate&lt;/code&gt; package.<br /> <br /> ==Implementations==<br /> <br /> See the Category [[:Category:Common Lisp implementations|Common Lisp implementations]].<br /> <br /> Common Lisp is defined by a specification (like [[Ada (programming language)|Ada]] and [[C (programming language)|C]]) rather than by one implementation (like [[Perl]] before version 6). There are many implementations, and the standard details areas in which they may validly differ.<br /> <br /> In addition, implementations tend to come with library packages, which provide functionality not covered in the standard. [[Free and open source software]] libraries have been created to support such features in a portable way, and are most notably found in the repositories of the [http://common-lisp.net/ Common-Lisp.net] and [http://clocc.sourceforge.net/ Common Lisp Open Code Collection] projects.<br /> <br /> Common Lisp implementations may use any mix of native code compilation, byte code compilation or interpretation. Common Lisp has been designed to support [[incremental compiler]]s, file compilers and block compilers. Standard declarations to optimize compilation (such as function inlining or type specialization) are proposed in the language specification. Most Common Lisp implementations compile source code to native [[machine code]]. Some implementations can create (optimized) stand-alone applications. Others compile to interpreted [[bytecode]], which is less efficient than native code, but eases binary-code portability. There are also compilers that compile Common Lisp code to C code. The misconception that Lisp is a purely interpreted language is most likely because Lisp environments provide an interactive prompt and that code is compiled one-by-one, in an incremental way. With Common Lisp incremental compilation is widely used.<br /> <br /> Some [[Unix]]-based implementations ([[CLISP]], [[SBCL]]) can be used as a [[scripting language]]; that is, invoked by the system transparently in the way that a [[Perl]] or [[Unix shell]] interpreter is.&lt;ref&gt;[http://clisp.cons.org/impnotes/quickstart.html#quickstart-unix CLISP as a scripting language under Unix]&lt;/ref&gt;<br /> <br /> ===List of implementations===<br /> <br /> ====Commercial implementations====<br /> <br /> ; [[Allegro Common Lisp]]: for Microsoft Windows, FreeBSD, Linux, Apple Mac OS X and various UNIX variants. Allegro CL provides an [[integrated development environment|Integrated Development Environment (IDE)]] (for Windows and Linux) and extensive capabilities for application delivery.<br /> ; [[Liquid Common Lisp]]: formerly called [[Lucid Common Lisp]]. Only maintenance, no new releases.<br /> ; [[LispWorks]]: for Microsoft Windows, FreeBSD, Linux, Apple Mac OS X and various UNIX variants. LispWorks provides an [[integrated development environment|Integrated Development Environment (IDE)]] (available for all platforms) and extensive capabilities for application delivery.<br /> ; [[mocl]]: for iOS, Android and Mac OS X.<br /> ; [[Open Genera]]: for DEC Alpha.<br /> ; [[Scieneer Common Lisp]]: which is designed for high-performance scientific computing.<br /> <br /> ====Freely redistributable implementations====<br /> <br /> ; Armed Bear Common Lisp (ABCL) : A CL implementation that runs on the [[Java Virtual Machine]].&lt;ref&gt;{{cite web | url = http://common-lisp.net/project/armedbear/ | title = Armed Bear Common Lisp }}&lt;/ref&gt; It includes a compiler to [[Java byte code]], and allows access to Java libraries from CL. It was formerly just a component of the [[Armed Bear J Editor]].<br /> ; [[CLISP]]: A bytecode-compiling implementation, portable and runs on a number of Unix and Unix-like systems (including [[Mac OS X]]), as well as Microsoft Windows and several other systems.<br /> ; [[Clozure CL]] (CCL) : Originally a [[free and open source software|free and open source]] fork of Macintosh Common Lisp. As that history implies, CCL was written for the Macintosh, but Clozure CL now runs on [[Mac OS X]], [[FreeBSD]], [[Linux]], [[Solaris (operating system)|Solaris]] and [[Microsoft Windows|Windows]]. 32 and 64 bit [[x86]] ports are supported on each platform. Additionally there are Power PC ports for Mac OS and Linux. CCL was previously known as OpenMCL, but that name is no longer used, to avoid confusion with the open source version of Macintosh Common Lisp.<br /> ; [[CMUCL]]: Originally from [[Carnegie Mellon University]], now maintained as [[free and open source software]] by a group of volunteers. CMUCL uses a fast native-code compiler. It is available on [[Linux]] and [[Berkeley Software Distribution|BSD]] for Intel x86; [[Linux]] for Alpha; [[Mac OS X]] for Intel x86 and PowerPC; and Solaris, IRIX, and HP-UX on their native platforms.<br /> ; [[Corman Common Lisp]]: for Microsoft Windows. In January 2015 Corman Lisp has been published under MIT license.&lt;ref&gt;{{cite web|title=Corman Lisp sources are now available|url=http://lispblog.xach.com/post/107215169193/corman-lisp-sources-are-now-available}}&lt;/ref&gt;<br /> ; [[Embeddable Common Lisp]] (ECL) : ECL includes a bytecode interpreter and compiler. It can also compile Lisp code to machine code via a C compiler. ECL then compiles Lisp code to C, compiles the C code with a C compiler and can then load the resulting machine code. It is also possible to embed ECL in [[C (programming language)|C]] programs, and C code into Common Lisp programs.<br /> ; [[GNU Common Lisp]] (GCL) : The [[GNU]] Project's Lisp compiler. Not yet fully ANSI-compliant, GCL is however the implementation of choice for several large projects including the mathematical tools [[Maxima (software)|Maxima]], [[Axiom (computer algebra system)|AXIOM]] and (historically) [[ACL2]]. GCL runs on [[Linux]] under eleven different architectures, and also under Windows, Solaris, and [[FreeBSD]].<br /> ; [[Macintosh Common Lisp]] (MCL) : Version 5.2 for Apple Macintosh computers with a PowerPC processor running Mac OS X is open source. RMCL (based on MCL 5.2) runs on Intel-based Apple Macintosh computers using the Rosetta binary translator from Apple.<br /> ; [[ManKai Common Lisp]] (MKCL) : A branch of [[Embeddable Common Lisp|ECL]]. MKCL emphasises reliability, stability and overall code quality through a heavily reworked, natively multi-threaded, runtime system. On Linux, MKCL features a fully POSIX compliant runtime system.<br /> ; [[Movitz]]: Implements a Lisp environment for [[x86]] computers without relying on any underlying OS.<br /> ; [[Poplog]]: Poplog implements a version of CL, with [[POP-11]], and optionally [[Prolog]], and [[Standard ML]] (SML), allowing mixed language programming. For all, the implementation language is POP-11, which is compiled incrementally. It also has an integrated [[Emacs]]-like editor that communicates with the compiler.<br /> ; [[Steel Bank Common Lisp]] (SBCL) : A branch from [[CMUCL]]. &quot;Broadly speaking, SBCL is distinguished from CMU CL by a greater emphasis on maintainability.&quot;&lt;ref&gt;{{cite web<br /> | url = http://sbcl.sourceforge.net/history.html<br /> | title = History and Copyright | work = Steel Bank Common Lisp<br /> }}&lt;/ref&gt; SBCL runs on the platforms CMUCL does, except HP/UX; in addition, it runs on Linux for AMD64, PowerPC, SPARC, MIPS, Windows x86&lt;ref&gt;{{cite web<br /> | url = http://www.sbcl.org/platform-table.html<br /> | title = Platform Table | work = Steel Bank Common Lisp<br /> }}&lt;/ref&gt; and has experimental support for running on Windows AMD64. SBCL does not use an interpreter by default; all expressions are compiled to native code unless the user switches the interpreter on. The SBCL compiler generates fast native code.&lt;ref&gt;[http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?test=all&amp;lang=all SBCL ranks above other dynamic language implementations in the 'Computer Language Benchmark Game']&lt;/ref&gt;<br /> ; [[Ufasoft Common Lisp]]: port of CLISP for windows platform with core written in C++.<br /> <br /> ====Other implementations====<br /> {{unreferenced section|date=July 2013}}<br /> ; Austin Kyoto Common Lisp : an evolution of [[Kyoto Common Lisp]]<br /> ; Butterfly Common Lisp : an implementation written in Scheme for the [[BBN Butterfly]] multi-processor computer<br /> ; CLICC : a Common Lisp to C compiler<br /> ; CLOE : Common Lisp for PCs by [[Symbolics]]<br /> ; Codemist Common Lisp : used for the commercial version of the computer algebra system Axiom<br /> ; ExperCommon Lisp : an early implementation for the Apple Macintosh by ExperTelligence<br /> ; [[Golden Common Lisp]]: an implementation for the PC by GoldHill Inc.<br /> ; Ibuki Common Lisp : a commercialized version of Kyoto Common Lisp<br /> ; [[Kyoto Common Lisp]]: the first Common Lisp compiler that used C as a target language. GCL, ECL and MKCL originate from this Common Lisp implementation.<br /> ; L : a small version of Common Lisp for embedded systems developed by IS Robotics, now iRobot<br /> ; [[Lisp Machine]]s (from [[Symbolics]], TI and Xerox): provided implementations of Common Lisp in addition to their native Lisp dialect (Lisp Machine Lisp or Interlisp). CLOS was also available. Symbolics provides a version of Common Lisp that is based on ANSI Common Lisp.<br /> ; Procyon Common Lisp : an implementation for Windows and Mac OS, used by Franz for their Windows port of Allegro CL<br /> ; Star Sapphire Common LISP : an implementation for the PC<br /> ; [[SubL]]: a variant of Common Lisp used for the implementation of the [[Cyc]] knowledge-based system<br /> ; Top Level Common Lisp : an early implementation for concurrent execution<br /> ; WCL : a shared library implementation<br /> ; [[Vax Common Lisp]]: [[Digital Equipment Corporation]]'s implementation that ran on [[VAX]] systems running [[OpenVMS|VMS]] or [[ULTRIX]]<br /> ; [[XLISP]] by David Betz<br /> <br /> ==Applications==<br /> See the Category [[:Category:Common Lisp software|Common Lisp software]].<br /> <br /> Common Lisp is used to develop research applications (often in Artificial Intelligence), for rapid development of prototypes or for deployed applications.<br /> <br /> Common Lisp is used in many commercial applications, including the [[Yahoo!]] Store web-commerce site, which originally involved [[Paul Graham (computer programmer)|Paul Graham]] and was later rewritten in C++ and Perl.&lt;ref name=&quot;doubt-not-corporate-foolishness&quot;&gt;&quot;In January 2003, Yahoo released a new version of the editor written in C++ and Perl. It's hard to say whether the program is no longer written in Lisp, though, because to translate this program into C++ they literally had to write a Lisp interpreter: the source files of all the page-generating templates are still, as far as I know, Lisp code.&quot; [[Paul Graham (computer programmer)|Paul Graham]], [http://www.paulgraham.com/avg.html Beating the Averages]&lt;/ref&gt; Other notable examples include:<br /> <br /> * [[ACT-R]], a cognitive architecture used in a large number of research projects.<br /> * Authorizer's Assistant,&lt;ref&gt;[http://www.aaai.org/Papers/IAAI/1989/IAAI89-031.pdf Authorizer's Assistant]&lt;/ref&gt;&lt;ref&gt;[http://www.prenhall.com/divisions/bp/app/alter/student/useful/ch9amex.html American Express Authorizer's Assistant]&lt;/ref&gt; a large rule-based system used by American Express, analyzing credit requests.<br /> * [[Cyc]], a long running project with the aim to create a knowledge-based system that provides a huge amount of common sense knowledge<br /> * The [[Dynamic Analysis and Replanning Tool]] (DART), which is said to alone have paid back during the years from 1991 to 1995 for all thirty years of [[DARPA]] investments in AI research.<br /> * G2 from Gensym, a real-time business rules engine (BRE)&lt;ref&gt;[http://www.gensym.com/index.php?option=com_content&amp;view=article&amp;id=47&amp;Itemid=54 Real-time Application Development]. Gensym. Retrieved on 2013-07-17.&lt;/ref&gt;<br /> * [http://www.genworks.com Genworks GDL], based on the open-source [http://github.com/genworks/gendl Gendl] kernel.<br /> * The development environment for the [[Jak and Daxter]] video game series, developed by [[Naughty Dog]].<br /> * [[ITA Software]]'s low fare search engine, used by travel websites such as [[Orbitz]] and [[Kayak.com]] and airlines such as [[American Airlines]], [[Continental Airlines]] and [[US Airways]].<br /> * [[Mirai (software)|Mirai]], a 3d graphics suite. It was used to animate the face of Gollum in the movie Lord of the Rings: The Two Towers.<br /> * [[Prototype Verification System]] (PVS), a mechanized environment for formal specification and verification.<br /> * PWGL is a sophisticated visual programming environment based on Common Lisp, used in [[Computer assisted composition]] and sound synthesis.&lt;ref&gt;[http://www2.siba.fi/PWGL/ PWGL - Home]. . Retrieved on 2013-07-17.&lt;/ref&gt; <br /> * SPIKE, a scheduling system for earth or space based observatories and satellites, notably the Hubble Space Telescope.&lt;ref&gt;[http://www.stsci.edu/resources/software_hardware/spike/ Spike Planning and Scheduling System]. Stsci.edu. Retrieved on 2013-07-17.&lt;/ref&gt;<br /> <br /> There also exist open-source applications written in Common Lisp, such as:<br /> <br /> * [[ACL2]], a full-featured [[automated theorem prover]] for an [[applicative programming language|applicative]] variant of Common Lisp.<br /> * [[Axiom (computer algebra system)|Axiom]], a sophisticated [[computer algebra system]].<br /> * [[Maxima (software)|Maxima]], a sophisticated [[computer algebra system]].<br /> * [[OpenMusic]] is an object-oriented visual programming environment based on Common Lisp, used in [[Computer assisted composition]].<br /> * [[Stumpwm]], a tiling, keyboard driven X11 Window Manager written entirely in Common Lisp.<br /> <br /> ==Libraries==<br /> <br /> Since 2011 Zach Beane, with support of the Common Lisp Foundation, maintains the [[Quicklisp]] library manager. It allows easy access to several hundred libraries written in Common Lisp.<br /> <br /> ==See also==<br /> {{Portal|Computer Science|Computer programming}}<br /> *''[[Common Lisp the Language]]''<br /> *''[[On Lisp]]''<br /> *''[[Practical Common Lisp]]''<br /> {{Clear}}<br /> <br /> ==References==<br /> {{Reflist|2}}<br /> <br /> ==Bibliography==<br /> A chronological list of books published (or about to be published) about Common Lisp (the language) or about programming with Common Lisp (especially AI programming).<br /> {{Refbegin|2}}<br /> * [[Guy L. Steele]]: ''Common Lisp the Language, 1st Edition'', Digital Press, 1984, ISBN 0-932376-41-X<br /> * [[Rodney Allen Brooks]]: ''Programming in Common Lisp'', John Wiley and Sons Inc, 1985, ISBN 0-471-81888-7<br /> * [[Richard P. Gabriel]]: ''Performance and Evaluation of Lisp Systems'', The MIT Press, 1985, ISBN 0-262-57193-5, [http://www.dreamsongs.com/Files/Timrep.pdf PDF]<br /> * [[Robert Wilensky]]: ''Common LISPcraft'', W.W. Norton &amp; Co., 1986, ISBN 0-393-95544-3<br /> * [[Eugene Charniak]], [[Christopher K. Riesbeck]], [[Drew V. McDermott]], [[James R. Meehan]]: ''Artificial Intelligence Programming, 2nd Edition'', Lawrence Erlbaum, 1987, ISBN 0-89859-609-2<br /> * [[Wendy L. Milner]]: ''Common Lisp: A Tutorial'', Prentice Hall, 1987, ISBN 0-13-152844-0<br /> * [[Deborah G. Tatar]]: ''A Programmer's Guide to Common Lisp'', Longman Higher Education, 1987, ISBN 0-13-728940-5<br /> * [[Taiichi Yuasa]], [[Masami Hagiya]]: ''Introduction to Common Lisp'', Elsevier Ltd, 1987, ISBN 0-12-774860-1<br /> * [[Christian Queinnec]], [[Jerome Chailloux]]: ''Lisp Evolution and Standardization'', Ios Pr Inc., 1988, ISBN 90-5199-008-1<br /> * [[Taiichi Yuasa]], [[Richard Weyhrauch]], [[Yasuko Kitajima]]: ''Common Lisp Drill'', Academic Press Inc, 1988, ISBN 0-12-774861-X<br /> * [[Wade L. Hennessey]]: ''Common Lisp'', McGraw-Hill Inc., 1989, ISBN 0-07-028177-7<br /> * [[Tony Hasemer]], [[John Dominque]]: ''Common Lisp Programming for Artificial Intelligence'', Addison-Wesley Educational Publishers Inc, 1989, ISBN 0-201-17579-7<br /> * [[Sonya E. Keene]]: ''Object-Oriented Programming in Common Lisp: A Programmer's Guide to CLOS'', Addison-Wesley, 1989, ISBN 0-201-17589-4<br /> * [[David Jay Steele]]: ''Golden Common Lisp: A Hands-On Approach'', Addison Wesley, 1989, ISBN 0-201-41653-0<br /> * [[David S. Touretzky]]: ''Common Lisp: A Gentle Introduction to Symbolic Computation'', Benjamin-Cummings, 1989, ISBN 0-8053-0492-4. [http://www.cs.cmu.edu/~dst/LispBook/ Web/PDF] Dover reprint (2013) ISBN 978-0486498201<br /> * [[Christopher K. Riesbeck]], [[Roger C. Schank]]: ''Inside Case-Based Reasoning'', Lawrence Erlbaum, 1989, ISBN 0-89859-767-6<br /> * [[Patrick Winston]], [[Berthold Horn]]: ''Lisp, 3rd Edition'', Addison-Wesley, 1989, ISBN 0-201-08319-1, [http://people.csail.mit.edu/phw/Books/LISPBACK.HTML Web]<br /> * [[Gerard Gazdar]], [[Chris Mellish]]: ''Natural Language Processing in LISP: An Introduction to Computational Linguistics'', Addison-Wesley Longman Publishing Co., 1990, ISBN 0-201-17825-7<br /> * [[Patrick R. Harrison]]: ''Common Lisp and Artificial Intelligence'', Prentice Hall PTR, 1990, ISBN 0-13-155243-0<br /> * [[Timothy Koschmann]]: ''The Common Lisp Companion'', John Wiley &amp; Sons, 1990, ISBN 0-471-50308-8<br /> * [[Molly M. Miller]], [[Eric Benson]]: ''Lisp Style &amp; Design'', Digital Press, 1990, ISBN 1-55558-044-0<br /> * [[Guy L. Steele]]: ''[[Common Lisp the Language]], 2nd Edition'', Digital Press, 1990, ISBN 1-55558-041-6, [http://www.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html Web]<br /> * [[Steven L. Tanimoto]]: ''The Elements of Artificial Intelligence Using Common Lisp'', Computer Science Press, 1990, ISBN 0-7167-8230-8<br /> * [[Peter Lee (computer scientist)|Peter Lee]]: ''Topics in Advanced Language Implementation'', The MIT Press, 1991, ISBN 0-262-12151-4<br /> * [[John H. Riley]]: ''A Common Lisp Workbook'', Prentice Hall, 1991, ISBN 0-13-155797-1<br /> * [[Peter Norvig]]: ''Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp'', Morgan Kaufmann, 1991, ISBN 1-55860-191-0, [http://norvig.com/paip.html Web]<br /> * [[Gregor Kiczales]], [[Jim des Rivieres]], [[Daniel G. Bobrow]]: ''The Art of the Metaobject Protocol'', The MIT Press, 1991, ISBN 0-262-61074-4<br /> * [[Jo A. Lawless]], [[Molly M. Miller]]: ''Understanding CLOS: The Common Lisp Object System'', Digital Press, 1991, ISBN 0-13-717232-X<br /> * Mark Watson: ''Common Lisp Modules: Artificial Intelligence in the Era of Neural Networks and Chaos Theory'', Springer Verlag New York Inc., 1991, ISBN 0-387-97614-0<br /> * [[James L. Noyes]]: ''Artificial Intelligence with Common Lisp: Fundamentals of Symbolic and Numeric Processing'', Jones &amp; Bartlett Pub, 1992, ISBN 0-669-19473-5<br /> * [[Stuart C. Shapiro]]: ''COMMON LISP: An Interactive Approach'', Computer Science Press, 1992, ISBN 0-7167-8218-9, [http://www.cse.buffalo.edu/pub/WWW/faculty/shapiro/Commonlisp/ Web/PDF]<br /> * [[Kenneth D. Forbus]], [[Johan de Kleer]]: ''Building Problem Solvers'', The MIT Press, 1993, ISBN 0-262-06157-0<br /> * [[Andreas Paepcke]]: ''Object-Oriented Programming: The CLOS Perspective'', The MIT Press, 1993, ISBN 0-262-16136-2<br /> * [[Paul Graham (computer programmer)|Paul Graham]]: ''[[On Lisp]]'', Prentice Hall, 1993, ISBN 0-13-030552-9, [http://www.paulgraham.com/onlisp.html Web/PDF]<br /> * [[Paul Graham (computer programmer)|Paul Graham]]: ''ANSI Common Lisp'', Prentice Hall, 1995, ISBN 0-13-370875-6<br /> * [[Otto Mayer]]: ''Programmieren in Common Lisp'', German, Spektrum Akademischer Verlag, 1995, ISBN 3-86025-710-2<br /> * [[Stephen Slade]]: ''Object-Oriented Common Lisp'', Prentice Hall, 1997, ISBN 0-13-605940-6<br /> * [[Richard P. Gabriel]]: ''Patterns of Software: Tales from the Software Community'', Oxford University Press, 1998, ISBN 0-19-512123-6, [http://www.dreamsongs.org/Files/PatternsOfSoftware.pdf PDF]<br /> * [[Taiichi Yuasa]], [[Hiroshi G. Okuno]]: ''Advanced Lisp Technology'', CRC, 2002, ISBN 0-415-29819-9<br /> * [[David B. Lamkins]]: ''Successful Lisp: How to Understand and Use Common Lisp'', bookfix.com, 2004. ISBN 3-937526-00-5, [http://www.psg.com/~dlamkins/sl/contents.html Web]<br /> * [[Peter Seibel]]: ''[[Practical Common Lisp]]'', Apress, 2005. ISBN 1-59059-239-5, [http://www.gigamonkeys.com/book/ Web]<br /> * [[Doug Hoyte]]: ''Let Over Lambda'', Lulu.com, 2008, ISBN 1-4357-1275-7, [http://letoverlambda.com/ Web]<br /> * [[George F. Luger]], [[William A. Stubblefield]]: ''AI Algorithms, Data Structures, and Idioms in Prolog, Lisp and Java'', Addison Wesley, 2008, ISBN 0-13-607047-7, [http://wps.aw.com/wps/media/objects/5771/5909832/PDF/Luger_0136070477_1.pdf PDF]<br /> * [[Conrad Barski]]: ''Land of Lisp: Learn to program in Lisp, one game at a time!'', No Starch Press, 2010, ISBN 1-59327-200-6, [http://www.lisperati.com/landoflisp/ Web]<br /> * [[Pavel Penev]]: ''Lisp Web Tales'', Leanpub, 2013, [https://leanpub.com/lispwebtales Web]<br /> {{Refend}}<br /> <br /> ==External links==<br /> {{Wikibooks}}<br /> * The [http://www.cliki.net/ CLiki], a Wiki for [[free and open source software|free and open source]] Common Lisp systems running on Unix-like systems.<br /> * [http://www.common-lisp.net/ Common Lisp software repository].<br /> * {{cite web | url = http://www.lispworks.com/documentation/HyperSpec/Body/01_ab.htm | title = History | work = [[Common Lisp HyperSpec]] }}<br /> * [http://www.flownet.com/gat/jpl-lisp.html Lisping at JPL]<br /> * [http://www.defmacro.org/ramblings/lisp.html The Nature of Lisp] Essay that examines Lisp by comparison with XML.<br /> * [http://common-lisp.net/~dlw/LispSurvey.html Common Lisp Implementations: A Survey] Survey of maintained Common Lisp implementations.<br /> * [http://clqr.boundp.org Common Lisp Quick Reference]<br /> * [http://planet.lisp.org Planet Lisp] Articles about Common Lisp.<br /> <br /> {{Common Lisp}}<br /> <br /> [[Category:Common Lisp]]<br /> [[Category:Multi-paradigm programming languages]]<br /> [[Category:Functional languages]]<br /> [[Category:Dynamically typed programming languages]]<br /> [[Category:Dynamic programming languages]]<br /> [[Category:Object-oriented programming languages]]<br /> [[Category:Class-based programming languages]]<br /> [[Category:Procedural programming languages]]<br /> [[Category:Extensible syntax programming languages]]<br /> [[Category:Lisp programming language family]]<br /> [[Category:Lisp (programming language)]]<br /> [[Category:Articles with example Lisp code]]<br /> [[Category:Cross-platform software]]<br /> [[Category:Cross-platform free software]]<br /> [[Category:Programming languages created in 1984]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=GNU_Libtool&diff=689821065 GNU Libtool 2015-11-09T16:39:57Z <p>PuercoPop: Fix double definition of libtool manual reference</p> <hr /> <div>{{Multiple issues|<br /> {{refimprove|date=November 2010}}<br /> {{lead too short|date=November 2010}}<br /> {{context|date=November 2010}}<br /> }}<br /> <br /> {{ infobox software<br /> | name = GNU Libtool<br /> | logo = [[File:Libtool.jpg|frameless]]<br /> | developer = [[GNU Project]]&lt;ref&gt;{{cite web|url=http://directory.fsf.org/wiki/GNU|title=GNU|accessdate=25 June 2012}}&lt;/ref&gt;<br /> | released = {{Start date and age|1997|07|09}}<br /> | operating_system = [[Cross-platform]]<br /> | genre = [[Library (computing)|Library]]<br /> | license = [[GNU General Public License|GPLv2]]<br /> | website = [https://www.gnu.org/software/libtool/ gnu.org/s/libtool]<br /> }}<br /> <br /> '''GNU Libtool''' is a [[computer programming]] tool from the [[GNU build system]] used for creating portable compiled [[library (computer science)|libraries]].<br /> <br /> == Rationale ==<br /> <br /> Different [[operating system]]s handle [[shared library|shared libraries]] in different ways, and some platforms do not use shared libraries at all. It can be difficult to make a software program portable: the C compiler differs from system to system; certain library functions are missing on some systems; header files may have different names. One way to handle this is to write conditional code, with code blocks selected by means of preprocessor directives (&lt;code&gt;#ifdef&lt;/code&gt;); but because of the wide variety of build environments this approach quickly becomes unmanageable. The GNU build system is designed to address this problem more manageably.<br /> <br /> Libtool helps manage the creation of [[static library|static]] and [[dynamic library|dynamic]] [[library (computing)|libraries]] on various [[Unix-like]] operating systems. Libtool accomplishes this by abstracting the library-creation process, hiding differences between various systems (e.g. [[GNU/Linux]] systems vs. [[Solaris (operating system)|Solaris]]).<br /> <br /> GNU Libtool is designed to simplify the process of compiling a computer program on a new system, by &quot;encapsulating both the platform-specific dependencies, and the user interface, in a single script&quot;.&lt;ref name=&quot;Libtool manual&quot;&gt;[https://www.gnu.org/software/libtool/manual/libtool.html Libtool Manual]&lt;/ref&gt; When porting a program to a new system, Libtool is designed so the porter need not read low-level documentation for the shared libraries to be built, rather just run a ''configure'' script (or equivalent).&lt;ref name=&quot;Libtool manual&quot;&gt;&lt;/ref&gt;<br /> <br /> == Use ==<br /> <br /> Libtool is typically used with [[Autoconf]] and [[Automake]], two other tools of the GNU build system. However, it is designed so as not to be dependent upon either.&lt;ref name=&quot;other-implementations&quot;&gt;[https://www.gnu.org/software/libtool/manual/libtool.html#Other-implementations Other-implementations]&lt;/ref&gt;<br /> <br /> == Clones and derivatives ==<br /> <br /> Since GNU Libtool was released, other open source projects have created drop-in replacements under different [[software license|software licenses]].&lt;ref name=&quot;BSD-licensed libtool&quot;&gt;[http://BXR.SU/OpenBSD/usr.bin/libtool/ BSD-licensed libtool].&lt;/ref&gt;<br /> <br /> == See also ==<br /> {{Portal|Free software}}<br /> <br /> * [[GNU Compiler Collection]]<br /> * [[GNU build system]]<br /> <br /> == References ==<br /> <br /> {{reflist}}<br /> <br /> == External links ==<br /> <br /> * {{official website}}<br /> * [http://sources.redhat.com/autobook/ Autobook homepage]<br /> * [http://www.lrde.epita.fr/~adl/autotools.html Autotools Tutorial]<br /> * [http://metastatic.org/text/libtool.html Avoiding libtool minefields when cross-compiling]<br /> * [https://autotools.io/ Autotools Mythbuster]<br /> <br /> {{GNU}}<br /> <br /> [[Category:Compiling tools]]<br /> [[Category:GNU Project software|Libtool]]<br /> [[Category:Free computer libraries]]<br /> [[Category:Cross-platform software]]<br /> <br /> <br /> {{programming-software-stub}}</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Racket_(programming_language)&diff=689243643 Racket (programming language) 2015-11-05T21:24:01Z <p>PuercoPop: /* Code examples */ Add stylistic newline to separate requires from code</p> <hr /> <div>{{Infobox programming language<br /> | name = Racket<br /> | logo = [[File:Racket logo.png]]<br /> | paradigm = [[multi-paradigm programming language|Multi-paradigm]]: [[functional programming|functional]], [[procedural programming|procedural]], [[modular programming|modular]], [[object-oriented programming|object-oriented]], [[logic programming|logic]], [[reflection (computer science)|reflective]], [[metaprogramming|meta]]<br /> |screenshot = [[File:Drracket.png|thumb|DrRacket on Ubuntu GNU/Linux]]<br /> | year = 1994<br /> | designer = PLT Inc.<br /> | developer = PLT Inc.<br /> | latest_release_version = 6.2.1&lt;ref name=&quot;latestversion&quot;&gt;[http://blog.racket-lang.org/2015/08/racket-v621.html Racket blog]&lt;/ref&gt;<br /> | latest_release_date = {{Start date and age|2015|8|10}}<br /> | frequently updated = yes<br /> | typing = [[dynamic typing|Dynamic]], [[strong typing|strong]], [[static typing|static]]<br /> | implementations =<br /> | dialects = [http://docs.racket-lang.org/ts-guide/ Typed Racket], [http://docs.racket-lang.org/lazy/ Lazy Racket], [http://docs.racket-lang.org/scribble/ Scribble], [http://docs.racket-lang.org/frtime/ FrTime], more<br /> | influenced = [[Scheme (programming language)|Scheme]],&lt;ref name=&quot;r6rs&quot;&gt;{{cite web |url=http://www.r6rs.org |title=Revised&lt;sup&gt;6&lt;/sup&gt; Report on the Algorithmic Language Scheme (R6RS) |last1=Sperber |first1=Michael |last2=Dybvig |first2=R. Kent |last3=Flatt |first3=Matthew |last4=Van Straaten |first4=Anton|date=August 2007 |publisher=Scheme Steering Committee |accessdate=2011-09-13|display-authors=etal}}&lt;/ref&gt; [[Rust (programming language)|Rust]],&lt;ref&gt;{{cite web|url=https://mail.mozilla.org/pipermail/rust-dev/2013-May/003947.html|title=Planet2 questions}}&lt;/ref&gt; [[Clojure]]&lt;ref name=&quot;typed-clojure-thesis&quot;&gt;{{cite thesis|last=Bonnaire-Sergeant|first=Ambrose|title=A Practical Optional Type System for Clojure|publisher=The University of Western Australia|year=2012}}&lt;/ref&gt;<br /> | influenced_by = [[Scheme (programming language)|Scheme]], [[Eiffel (programming language)|Eiffel]]&lt;ref&gt;{{cite web |url=http://www.ccs.neu.edu/racket/pubs/dls10-sf.pdf |title=DLS 2010: Contracts for First-Class Classes |last1=Strickland |first1=T.S. |last2=Fellesisen |first2=Matthias |year=2010}}&lt;/ref&gt;<br /> | standard = [[R5RS]], [[R6RS]]<br /> | operating_system = [[Cross-platform]]<br /> | platform = [[x86]], [[PowerPC]], [[SPARC]], [[MIPS architecture|MIPS]], [[ARM architecture|ARM]]<br /> | license = [[GNU Lesser General Public License|LGPL]]<br /> | website = {{URL|racket-lang.org}}<br /> | file ext = &lt;code&gt;.rkt&lt;/code&gt;, &lt;code&gt;.rktl&lt;/code&gt;, &lt;code&gt;.rktd&lt;/code&gt;, &lt;code&gt;.scrbl&lt;/code&gt;, &lt;code&gt;.plt&lt;/code&gt;, &lt;code&gt;.ss&lt;/code&gt;, &lt;code&gt;.scm&lt;/code&gt;<br /> }}<br /> <br /> '''Racket''' (formerly named '''PLT Scheme''') is a [[General-purpose programming language|general purpose]], [[multi-paradigm programming language]] in the [[Lisp (programming language)|Lisp]]/[[Scheme (programming language)|Scheme]] family. One of its design goals is to serve as a platform for language creation, design, and implementation.&lt;ref&gt;{{cite web | title = Welcome to Racket | url = http://docs.racket-lang.org/guide/intro.html | accessdate = 2011-08-15}}&lt;/ref&gt;&lt;ref&gt;{{cite web | title = Dialects of Racket and Scheme | url = http://docs.racket-lang.org/guide/dialects.html | accessdate = 2011-08-15}}&lt;/ref&gt; The language is used in a variety of contexts such as [[script (computing)|scripting]], general-purpose programming, computer science education, and research.<br /> <br /> The platform provides an implementation of the Racket language (including a sophisticated [[run-time system]],&lt;ref name=&quot;mred&quot;/&gt; various libraries, [[just-in-time compilation|JIT compiler]], and more) along with a development environment called DrRacket (formerly named DrScheme) written in Racket itself.&lt;ref name=&quot;drscheme&quot;/&gt; The IDE and an accompanying programming curriculum is used in the [[ProgramByDesign]] outreach program, an attempt to turn computing and programming into &quot;an indispensable part of the liberal arts curriculum&quot;.&lt;ref name=&quot;teachscheme&quot;&gt;{{cite news| last1=Felleisen | last2=Findler | last3=Flatt | last4=Krishnamurthi | year = 2004 | url = http://www.ccs.neu.edu/scheme/pubs/#cse2003-fffk | title = The TeachScheme! Project: Computing and Programming for Every Student | journal = Journal of Computer Science Education}}&lt;/ref&gt;&lt;ref&gt;{{cite web|url=http://programbydesign.org/overview |title=Overview |publisher=Program by Design |date= |accessdate=2011-08-17}}&lt;/ref&gt; The core language is known for its extensive [[macro (computer science)|macro]] system which enables the creation of embedded and [[domain-specific language]]s, language constructs such as [[class (computer programming)|classes]] or [[modular programming|modules]], and separate dialects of Racket with different [[semantics of programming languages|semantics]].&lt;ref name=&quot;macros-matter&quot;&gt;{{cite web | title = Macros Matter | url = http://blog.racket-lang.org/2007/05/macros-matter.html | accessdate=2011-08-08 | date=2007-05-03}}&lt;/ref&gt;&lt;ref name=&quot;scheme-with-classes&quot;&gt;{{cite conference<br /> | last1 = Flatt | first1 = M.<br /> | last2 = Findler | first2 = R. B.<br /> | last3 = Felleisen | first3 = M.<br /> | title = Scheme with Classes, Mixins, and Traits<br /> | booktitle = Asian Symposium on Programming Languages and Systems<br /> | year = 2006<br /> | url = http://www.ccs.neu.edu/scheme/pubs/asplas06-fff.pdf}}<br /> &lt;/ref&gt;&lt;ref name=&quot;units&quot;&gt;{{cite conference<br /> | last1 = Flatt | first1 = M.<br /> | last2 = Felleisen | first2 = M.<br /> | title = Units: Cool Modules for Hot Languages<br /> | booktitle = Programming Language Design and Implementation<br /> | year = 1998<br /> | url = http://www.ccs.neu.edu/scheme/pubs/pldi98-ff.ps.gz}}<br /> &lt;/ref&gt;&lt;ref name=&quot;languages-as-libraries&quot;&gt;{{cite conference<br /> | last1 = Tobin-Hochstadt | first1 = S.<br /> | last2 = St-Amour | first2 = V.<br /> | last3 = Culpepper | first3 = R.<br /> | last4 = Flatt | first4 = M.<br /> | last5 = Felleisen | first5 = M.<br /> | title = Languages as Libraries<br /> | booktitle = Programming Language Design and Implementation<br /> | year = 2011<br /> | url = http://www.ccs.neu.edu/scheme/pubs/pldi11-thacff.pdf}}<br /> &lt;/ref&gt;<br /> <br /> The platform distribution is [[free and open source software]] distributed under the [[LGPL]]<br /> license.&lt;ref name=&quot;racket-lgpl-license&quot;&gt;{{cite web | title = Racket: Software License | url = http://download.racket-lang.org/license.html | accessdate=2015-10-20}}&lt;/ref&gt; Extensions and packages written by the community are uploaded to Racket's centralized [http://pkgs.racket-lang.org/ package catalog].<br /> <br /> == History ==<br /> <br /> === Development ===<br /> <br /> [[Matthias Felleisen]] founded PLT in the mid 1990s, first as a research group, soon after as a project dedicated to the production of [[pedagogic]] materials for novice programmers (lectures, exercises/projects, software). In January 1995, the group decided to develop a pedagogic programming environment based on [[Scheme (programming language)|Scheme]]. [[Matthew Flatt]] cobbled together MrEd—the original [[virtual machine]] for Racket—from libscheme,&lt;ref name=&quot;libscheme&quot;&gt;{{cite conference |url=https://www.usenix.org/legacy/publications/library/proceedings/vhll/benson.html |title=libscheme: Scheme as a C Library |last=Benson |first=Brent W. Jr. |date=October 26–28, 1994 |publisher=USENIX Association |publication-place=Berkeley, CA |booktitle=Proceedings of the USENIX Symposium on Very High Level Languages |pages=7–19 |location=Santa Fe, NM |isbn=978-1880446652 |accessdate=July 7, 2013}}&lt;/ref&gt; [[wxWidgets]], and a few other free systems.&lt;ref name=&quot;gui-rebuild&quot;&gt;{{cite web | title = Rebuilding Racket's Graphics Layer | accessdate = 2011-08-23 | date = 2010-12-08 | url = http://blog.racket-lang.org/2010/12/racket-version-5.html}}&lt;/ref&gt; In the years that followed, a team including Flatt, [[Robert Bruce Findler|Robby Findler]], [[Shriram Krishnamurthi]], Cormac Flanagan, and many others produced '''DrScheme''', a programming environment for novice Scheme programmers and a research environment for [[type system#Combining static and dynamic type-checking|soft typing]].&lt;ref name=&quot;drscheme&quot;&gt;{{cite journal|title=DrScheme: A Programming Environment for Scheme|journal=Journal of Functional Programming|last1=Findler|last2=Clements|last3=Flanagan|last4=Flatt|last5=Krishnamurthi|last6=Steckler|last7=Felleisen|url=http://www.ccs.neu.edu/racket/pubs/jfp01-fcffksf.pdf|year=2001}}&lt;/ref&gt; The main development language that DrScheme supported was called PLT Scheme.<br /> <br /> In parallel, the team started conducting workshops for high school teachers, training them in program design and functional programming. Field tests with these teachers and their students provided essential clues for the direction of the development.<br /> <br /> Over the following years, PLT added teaching languages, an algebraic stepper,&lt;ref&gt;{{cite conference | last1 = Clements | first1 = J. | last2 = Flatt | first2 = M. | last3 = Felleisen | first3 = M. | title = Modeling an Algebraic Stepper | booktitle = European Symposium on Programming Languages | year = 2001 | url = http://www.ccs.neu.edu/scheme/pubs/esop2001-cff.pdf}}&lt;/ref&gt; a transparent [[REPL|read-eval-print loop]], a constructor-based printer, and many other innovations to DrScheme, producing an application-quality pedagogic program development environment. By 2001, the core team (Felleisen, Findler, Flatt, Krishnamurthi) had also written and published their first textbook, ''[[How to Design Programs]]'', based on their teaching philosophy.<br /> <br /> === Version history ===<br /> <br /> The first generation of PLT Scheme revisions introduced features for [[programming in the large and programming in the small#Programming in the large|programming in the large]] with both [[modular programming|modules]] and [[class (computer programming)|classes]]. Version 42 introduced units — a first-class module system — to complement classes for large scale development.&lt;ref name=&quot;release-notes&quot;&gt;{{cite web|title=Racket Core Release Notes|url=http://docs.racket-lang.org/release-notes/racket/HISTORY.txt|accessdate=2012-04-15}}&lt;/ref&gt; The class system gained features (e.g. [[Java (programming language)|Java]]-style [[protocol (object-oriented programming)|interfaces]]) and also lost several features (e.g. [[multiple inheritance]]) throughout these versions.&lt;ref name=&quot;scheme-with-classes&quot; /&gt; The language evolved throughout a number of successive versions, and gaining milestone popularity in Version 53, leading to extensive work and the following Version 100, which would be equivalent to a &quot;1.0&quot; release in current popular version systems.<br /> <br /> The next major revision was named Version 200, which introduced a new default module system that cooperates with macros.&lt;ref name=&quot;release-notes&quot; /&gt; In particular, the module system ensures that run-time and [[compile-time]] computation are separated to support a &quot;tower of languages.&quot;&lt;ref&gt;{{cite conference | title = Composable and Compilable Macros | last = Flatt | first = M. | booktitle = International Conference on Functional Programming | year = 2002}}&lt;/ref&gt; Unlike units, these modules are not [[first-class object]]s.<br /> <br /> Version 300 introduced [[Unicode]] support, [[foreign function interface|foreign library]] support, and refinements to the class system.&lt;ref name=&quot;release-notes&quot; /&gt; Later on, the 300 series improved the [[computer performance|performance]] of the language runtime with an addition of a JIT compiler and a switch to a default [[generational garbage collection]].<br /> <br /> By the next major release, the project had switched to a more conventional [[software versioning#Sequence-based identifiers|sequence-based]] version numbering. Version 4.0 introduced the &lt;code&gt;#lang&lt;/code&gt; shorthand to specify the language that a module is written in. In addition, the revision introduced [[immutable object|immutable]] pairs and lists, support for fine-grained [[parallel computing|parallelism]], and a [[Static typing|statically-typed]] dialect.&lt;ref name=&quot;4.0&quot;&gt;{{cite web|url=http://blog.racket-lang.org/2008/06/plt-scheme-version-4.html|title=PLT Scheme version 4.0|date=2008-06-12|accessdate=2012-08-07}}&lt;/ref&gt;<br /> <br /> === Racket ===<br /> <br /> On June 7, 2010, PLT Scheme was renamed Racket.&lt;ref&gt;{{cite web|url=http://racket-lang.org/new-name.html |title=From PLT Scheme to Racket |publisher=Racket-lang.org |date= |accessdate=2011-08-17}}&lt;/ref&gt; The renaming coincided with the release of Version 5.0. Subsequently, the GUI backend was rewritten in Racket from [[C++]] in Version 5.1 using native [[widget toolkit|UI toolkits]] on all platforms.&lt;ref name=&quot;gui-rebuild&quot; /&gt; Version 5.2 included a background [[Static code analysis|syntax checking]] tool, a new plotting library, a database library, and a new extended REPL.&lt;ref name=&quot;5.2&quot;&gt;{{cite web |url=http://blog.racket-lang.org/2011/11/racket-v52.html |title=Racket 5.2 |publisher=PLT, Inc |date=2011-11-09 |accessdate=2012-06-16}}&lt;/ref&gt; Version 5.3 included a new submodule feature for optionally loaded modules,&lt;ref name=&quot;submodules&quot;&gt;{{cite web|url=http://blog.racket-lang.org/2012/06/submodules.html|title=Submodules|date=2012-06-03|accessdate=2012-08-07}}&lt;/ref&gt; new [[Program optimization|optimization]] tools, a [[JSON]] library, and other features.&lt;ref name=&quot;5.3&quot;&gt;{{cite web |url=http://blog.racket-lang.org/2012/08/racket-v53.html |title=Racket 5.3 |publisher=PLT, Inc |date=2012-08-07 |accessdate=2012-08-07}}&lt;/ref&gt; Version 5.3.1 introduced major improvements to DrRacket: the background syntax checker was turned on by default and a new documentation preview tool was added.&lt;ref name=&quot;5.3.1&quot;&gt;{{cite web |url=http://blog.racket-lang.org/2012/11/racket-v531.html |title=Racket 5.3.1 |publisher=PLT, Inc |date=2012-11-07|accessdate=2012-11-07}}&lt;/ref&gt;<br /> <br /> == Features ==<br /> {{Main|Racket features}}<br /> <br /> Racket's core language includes [[macro (computer science)#Syntactic macros|macros]], [[modular programming|modules]], [[closure (computer science)|lexical closures]], [[tail call]]s, [[delimited continuation]]s,&lt;ref name=icfp2007/&gt; parameters (fluid variables), [[design by contract|software contracts]],&lt;ref&gt;{{cite web | title = Contracts | url = http://docs.racket-lang.org/guide/contracts.html}}&lt;/ref&gt; [[green threads|green]] and OS [[thread (computer science)|threads]],&lt;ref&gt;{{cite web | title = Threads | url = http://docs.racket-lang.org/reference/threads.html}}&lt;/ref&gt;&lt;ref&gt;{{cite web | title = Futures | url = http://docs.racket-lang.org/reference/futures.html}}&lt;/ref&gt;&lt;ref&gt;{{cite web | title = Places | url = http://docs.racket-lang.org/reference/places.html}}&lt;/ref&gt; and more. The language also comes with primitives, such as eventspaces and custodians, which control resource management and enables the language to act like an [[operating system]] for loading and managing other programs.&lt;ref name=&quot;mred&quot;/&gt; Further extensions to the language are created with the powerful macro system, which together with the module system and custom parsers can control all aspects of a language.&lt;ref name=&quot;creating-languages&quot;&gt;{{Cite news | last = Flatt | first = Matthew | title = Creating Languages in Racket | newspaper = Communications of the ACM | year = 2012 | url = http://cacm.acm.org/magazines/2012/1/144809-creating-languages-in-racket | accessdate = 2012-04-08 | postscript = .}}&lt;/ref&gt; Unlike programming languages that lack macro systems, most language constructs in Racket are written on top of the base language using macros. These include a [[mixin]] class system,&lt;ref name=&quot;scheme-with-classes&quot;/&gt; a component (or module) system as expressive as [[Opaque ascription|ML]]'s,&lt;ref name=&quot;units&quot;/&gt; and [[pattern matching]].<br /> <br /> In addition, the language features the first contract system for a [[higher-order programming|higher-order]] language.&lt;ref&gt;{{cite conference<br /> | last1 = Findler | first1 = R. B.<br /> | last2 = Felleisen | first2 = M.<br /> | title = Contracts for Higher-Order Functions<br /> | booktitle = International Conference on Functional Programming<br /> | year = 2002<br /> | url = http://www.eecs.northwestern.edu/~robby/pubs/papers/ho-contracts-icfp2002.pdf}}&lt;/ref&gt;<br /> Racket's contract system is inspired by the [[Design by Contract]] work for [[Eiffel (programming language)|Eiffel]] and extends it to work for higher-order values such as [[first-class function]]s, objects, [[Reference (computer science)|reference]] cells, and so on. For example, an object that is checked by a contract can be ensured to make contract checks when its methods are eventually invoked.<br /> <br /> Racket's compiler is a [[bytecode]] compiler that translates to an internal bytecode format that is run by the Racket [[virtual machine]]. On [[x86]] and [[PowerPC]] platforms, the bytecode is further compiled using a [[JIT compiler]] at runtime.<br /> <br /> Since 2004, the language has also shipped with PLaneT, a package manager that is integrated into the module system so that [[third-party software component|third-party libraries]] can be transparently imported and used. Additionally, PLaneT has a built-in [[software versioning|versioning]] policy to prevent [[dependency hell]].&lt;ref name=&quot;planet&quot;&gt;{{cite conference | title = Component Deployment with PLaneT: You Want it Where? | last = Matthews | first = J. | booktitle = Scheme and Functional Programming Workshop | year = 2006}}&lt;/ref&gt;<br /> <br /> At the end of 2014, much of Racket's code was moved into a new packaging system separate from the main code base. This new packaging system is serviced by a client program called &lt;tt&gt;raco&lt;/tt&gt;. The new package system provides fewer features than PLaneT; a blog post by [[Jay McCarthy]] on the Racket blog explains the rationale for the change and how to duplicate the older system.&lt;ref&gt;{{cite web|url=http://blog.racket-lang.org/2014/12/the-racket-package-system-and-planet.html|title=The Racket package system and Planet}}&lt;/ref&gt;<br /> <br /> === Macros and extensibility ===<br /> <br /> {{See also|Racket features#Language Extensions|l1=Racket language extensions}}<br /> <br /> The feature that distinguishes Racket from other languages in the Lisp family is its integrated language [[Extensible programming|extensibility]]. Racket's extensibility features are built into the module system to allow context-sensitive and module-level control over syntax.&lt;ref name='languages-as-libraries'/&gt; For example, the &lt;code&gt;#%app&lt;/code&gt; syntactic form can be overridden to change the semantics of [[function application]]. Similarly, the &lt;code&gt;#%module-begin&lt;/code&gt; form allows arbitrary static analysis of the entire module.&lt;ref name='languages-as-libraries'/&gt; Since any module can be used as a language, via the &lt;code&gt;#lang&lt;/code&gt; notation, this effectively means a programmer can control virtually any aspect of the language.<br /> <br /> The module-level extensibility features are combined with a [[Scheme (programming language)|Scheme]]-like hygienic macro system, which provides more features than [[Lisp (programming language)|Lisp's]] S-expression manipulation system,&lt;ref name='you-want-it-when'&gt;{{cite conference | last = Flatt | first = Matthew | url = http://www.cs.utah.edu/plt/publications/macromod.pdf | title = Composable and Compilable Macros, You Want it When? | booktitle = International Conference on Functional Programming | year = 2002}}&lt;/ref&gt;&lt;ref&gt;Flatt, Culpepper, Darais, Findler, [http://www.cs.utah.edu/plt/publications/jfp12-draft-fcdf.pdf Macros that Work Together; Compile-Time Bindings, Partial Expansion, and Definition Contexts]&lt;/ref&gt; Scheme 84's [[Hygienic macro|hygienic]] extend-syntax macros, or [[R5RS]]'s [[syntax-rules]]. Indeed, it is fair to say that the macro system is a carefully tuned [[application programming interface]] (API) for [[compiler]] extensions. Using this compiler API, programmers can add features and entire [[domain-specific language]]s in a manner that makes them completely indistinguishable from built-in language constructs.<br /> <br /> The macro system in Racket has been used to construct entire language [[dialect (computing)|dialects]]. This includes Typed Racket—a statically typed dialect of Racket that eases the migration from [[dynamically typed|untyped]] to typed code,&lt;ref&gt;{{cite conference | last1 = Tobin-Hochstadt | first1 = S. | last2 = Felleisen | first2 = M. | title = The Design and Implementation of Typed Scheme | booktitle = Principles of Programming Languages | year = 2008}}&lt;/ref&gt; and Lazy Racket—a dialect with [[lazy evaluation]].&lt;ref&gt;{{cite conference | last1 = Barzilay | first1 = E. | last2 = Clements | first2 = J. | title = Laziness Without All the Hard Work: Combining Lazy and Strict Languages for Teaching | booktitle = Functional and Declarative Programming in Education | year = 2005}}&lt;/ref&gt;<br /> Other dialects include FrTime ([[functional reactive programming]]), Scribble (documentation language),&lt;ref&gt;{{cite conference | last1 = Flatt | first1 = M. | last2 = Barzilay | first2 = E. | last3 = Findler | first3 = R. B. | title = Scribble: Closing the Book on Ad Hoc Documentation Tools | booktitle = International Conference on Functional Programming | year = 2009}}&lt;/ref&gt; Slideshow ([[slide show|presentation]] language),&lt;ref&gt;{{cite conference | last1 = Findler | first1 = R. B. | last2 = Flatt | first2 = M. | title = Slideshow: Functional Presentations | booktitle = International Conference on Functional Programming | year = 2004}}&lt;/ref&gt; and several languages for education.&lt;ref name=&quot;functional-io&quot;&gt;{{cite conference | last1 = Felleisen | last2 = Findler | last3 = Flatt | last4 = Krishnamurthi | first1 = M. | first2 = R. B. | first3 = M. | first4 = S. | title = A Functional I/O System (or Fun for Freshman Kids) | url = http://www.ccs.neu.edu/scheme/pubs/icfp09-fffk.pdf | booktitle = International Conference on Functional Programming | year = 2009}}&lt;/ref&gt;&lt;ref&gt;{{cite journal | title = The Structure and Interpretation of the Computer Science Curriculum | last1 = Felleisen | last2 = Findler | last3 = Flatt | last4 = Krishnamurthi | first1 = M. | first2 = R. B. | first3 = M. | first4 = S. | journal = Journal of Functional Programming | url = http://www.ccs.neu.edu/scheme/pubs/fdpe2002-fffk.pdf | year = 2004}}&lt;/ref&gt; Racket's core distribution provides libraries to aid the process of constructing new programming languages.&lt;ref name=&quot;languages-as-libraries&quot;/&gt;<br /> <br /> Such languages are not restricted to S-expression based syntax. In addition to conventional readtable-based syntax extensions, Racket's &lt;code&gt;#lang&lt;/code&gt; makes it possible for a language programmer to define any arbitrary parser, for example, using the parser tools library.&lt;ref name=&quot;parsers&quot;&gt;{{cite web | title = Parser Tools: lex and yacc-style Parsing | url = http://docs.racket-lang.org/parser-tools/ | accessdate = 2011-08-16}}&lt;/ref&gt; See [[Racket features#Logic Programming|Racket logic programming]] for an example of such a language.<br /> <br /> == Programming environment ==<br /> <br /> The language platform provides a self-hosted [[integrated development environment|IDE]]&lt;ref name=&quot;drscheme&quot;/&gt; named DrRacket, a continuation-based [[web server]],&lt;ref name=&quot;web-server&quot;/&gt; a [[graphical user interface]],&lt;ref name=&quot;gui-rebuild&quot;/&gt; and other tools. Racket is also a viable scripting tool and can be used for scripting the Unix shell. It can parse [[command line arguments]], execute external tools and includes libraries like all common [[scripting language]]s.<br /> <br /> === DrRacket IDE ===<br /> <br /> DrRacket (formerly DrScheme) is widely used among introductory Computer Science courses that teach Scheme or Racket and is lauded for its simplicity and appeal to beginner programmers. The IDE was originally built for use with the TeachScheme! project (now [[ProgramByDesign]]), an outreach effort by [[Northeastern University]] and a number of affiliated universities for attracting high school students to computer science courses at the college level.<br /> <br /> The editor provides [[Syntax highlighting|source highlighting]] for syntax and run-time errors, parenthesis matching, a [[debugger]] and an algebraic stepper. Its student-friendly features include support for multiple &quot;language levels&quot; (Beginning Student, Intermediate Student and so on). It also has integrated library support, and sophisticated [[Program analysis|analysis]] tools for advanced programmers. In addition, [[modular programming|module-oriented programming]] is supported with the module browser, a contour view, integrated [[software testing|testing]] and [[Fault coverage|coverage]] measurements, and [[refactoring]] support. It provides integrated, context-sensitive access to an extensive hyper-linked help system named &quot;Help Desk&quot;.<br /> <br /> DrRacket is available for [[Microsoft Windows|Windows]] (95 and up), [[Mac OS X]], [[Unix]], and [[Linux]] with the [[X Window System]] and programs behave similarly on all these platforms.<br /> <br /> == Code examples ==<br /> {{See also|Racket features#Examples|l1=Racket examples}}<br /> Here's a trivial &quot;hello world&quot; program:<br /> &lt;source lang=&quot;Racket&quot;&gt;<br /> #lang racket/base<br /> &quot;Hello, World!&quot;<br /> &lt;/source&gt;<br /> Running this program produces the output:<br /> :{{samp|&quot;Hello, World!&quot;}}<br /> <br /> Here's a slightly less trivial program:<br /> [[File:Sierpinski Racket example.png|thumb|The result of this program, as shown in DrRacket]]<br /> &lt;source lang=&quot;Racket&quot;&gt;<br /> #lang racket<br /> (require 2htdp/image)<br /> <br /> (let sierpinski ([n 8])<br /> (if (zero? n)<br /> (triangle 2 'solid 'red)<br /> (let ([t (sierpinski (- n 1))])<br /> (freeze (above t (beside t t))))))<br /> &lt;/source&gt;<br /> This program, taken from the Racket website, draws a [[Sierpinski triangle]], nested to depth 8.<br /> <br /> Using the &lt;code&gt;#lang&lt;/code&gt; directive, a source file can be written in different dialects of Racket. Here is an example of the factorial program in Typed Racket, a [[statically typed]] dialect of Racket:<br /> &lt;source lang=&quot;Racket&quot;&gt;<br /> #lang typed/racket<br /> <br /> (: fact (Integer -&gt; Integer))<br /> (define (fact n)<br /> (cond [(zero? n) 1]<br /> [else (* n (fact (- n 1)))]))<br /> &lt;/source&gt;<br /> <br /> == Applications and practical use ==<br /> <br /> Apart from having a basis in [[programming language theory]], Racket was designed to be used as a general-purpose language in production systems. Thus, the Racket distribution features an extensive library that covers systems and network programming, web development,&lt;ref name=&quot;web-server&quot;&gt;{{cite journal|title=Implementation and Use of the PLT Scheme Web Server|journal=Journal of Higher-Order and Symbolic Programming|last1=Krishnamurthi, Hopkins|last2=McCarthy|last3=Graunke|last4=Pettyjohn|last5=Felleisen|year=2007|url=http://www.ccs.neu.edu/racket/pubs/hosc07-sk-mf.pdf}}&lt;/ref&gt; a uniform interface to the underlying operating system, a dynamic [[foreign function interface]],&lt;ref name=&quot;ffi&quot;&gt;{{cite conference |title=Foreign Interface for PLT Scheme |last1=Barzilay |first1=E. |last2=Orlovsky |first2=D. |booktitle=Scheme and Functional Programming |year=2004 |url=http://www.ccs.neu.edu/racket/pubs/scheme04-bo.pdf}}&lt;/ref&gt; several flavours of [[regular expressions]], lexer/parser generators,&lt;ref name=&quot;parsers&quot;/&gt; [[logic programming]], and a complete [[GUI]] framework.<br /> <br /> Racket has several features useful for a commercial language, among them an ability to generate standalone executables under Windows, Mac OS X and Unix, a [[profiling (computer programming)|profiler]] and [[debugger]] included in the [[integrated development environment]] (IDE), and a [[unit testing]] framework.<br /> <br /> Racket has been used for commercial projects and web applications. A notable example is the [[Hacker News]] website, which runs on [[Arc (programming language)|Arc]], which is developed in Racket. [[Naughty Dog]] has used it as a scripting language in several of their video games.&lt;ref&gt;{{cite web |url=http://cufp.org/conference/sessions/2011/functional-mzscheme-dsls-game-development |title=Functional mzScheme DSLs in Game Development |accessdate=2012-05-08}}&lt;/ref&gt;<br /> <br /> Racket is used to teach students algebra through game design in the [[bootstrap curriculum|Bootstrap program]].&lt;ref&gt;{{cite web|url=http://www.bootstrapworld.org/materials/fall2015/index.shtml|website=bootstrapworld.org|accessdate=2015-08-11|title=Bootstrap}}&lt;/ref&gt;<br /> <br /> == References ==<br /> {{Reflist|30em|refs=<br /> &lt;ref name=icfp2007&gt;<br /> {{cite conference | last1 = Flatt | first1 = M. | last2 = Yu | first2 = G. | last3 = Findler | first3 = R. B. | last4 = Felleisen | first4 = M.<br /> | title = Adding Delimited and Composable Control to a Production Programming Environment<br /> | booktitle = International Conference on Functional Programming | year = 2007 | url = http://www.ccs.neu.edu/scheme/pubs/icfp07-fyff.pdf}}&lt;/ref&gt;<br /> &lt;ref name=&quot;mred&quot;&gt;<br /> {{cite conference |last1=Flatt|last2=Findler|last3=Krishnamurthi|last4=Felleisen<br /> | conference=International Conference on Functional Programming<br /> | title=Programming Languages as Operating Systems (or, Revenge of the Son of the Lisp Machine)|year=1999}}&lt;/ref&gt;<br /> }}<br /> <br /> == Further reading ==<br /> <br /> * Felleisen ''et al.'', 2013. [http://realmofracket.com/ ''Realm of Racket'']. No Starch Press.<br /> * Felleisen ''et al.'', 2003. [http://www.htdp.org/ ''How to Design Programs'']. MIT Press.<br /> <br /> ==External links==<br /> <br /> === Tutorials ===<br /> * [http://docs.racket-lang.org/quick/ Quick: An Introduction to Racket with Pictures]<br /> * [http://hashcollision.org/brainfudge/ F*dging up a Racket]—shows how to write a [[Brainfuck]] dialect for Racket<br /> * [http://jarnaldich.me/2011/08/07/raw-strings-in-racket.html Raw strings in Racket]—a reader extension for [[raw string]]s<br /> <br /> === Style guide ===<br /> * [http://docs.racket-lang.org/style/index.html How to Program Racket]<br /> <br /> === Website and documentation ===<br /> * {{Official website}}<br /> * [http://blog.racket-lang.org/ Blog]<br /> * [http://git.racket-lang.org/plt/ Code Repository]<br /> * [http://planet.racket-lang.org/ PLaneT]<br /> * [http://docs.racket-lang.org/guide/ The Racket Guide]<br /> * [http://docs.racket-lang.org/reference/ The Racket Reference]<br /> * [http://docs.racket-lang.org/ All Racket Documentation]<br /> <br /> {{DEFAULTSORT:Racket}}<br /> [[Category:Functional languages]]<br /> [[Category:Object-oriented programming languages]]<br /> [[Category:Extensible syntax programming languages]]<br /> [[Category:Lisp programming language family]]<br /> [[Category:Scheme (programming language) implementations]]<br /> [[Category:Scheme (programming language) compilers]]<br /> [[Category:Scheme (programming language) interpreters]]<br /> [[Category:R6RS Scheme]]<br /> [[Category:Academic programming languages]]<br /> [[Category:Educational programming languages]]<br /> [[Category:Pedagogic integrated development environments]]<br /> [[Category:Cross-platform free software]]<br /> [[Category:Free compilers and interpreters]]<br /> [[Category:Programming languages created in 1994]]<br /> [[Category:Articles with example Racket code]]<br /> [[Category:Software using the LGPL license]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Boa_(web_server)&diff=679650652 Boa (web server) 2015-09-05T22:45:13Z <p>PuercoPop: add request for citation</p> <hr /> <div>{{multiple issues|<br /> {{Notability|Products|date=February 2011}}<br /> {{primary sources|date=February 2008}}<br /> }}<br /> <br /> {{Infobox software<br /> | logo =<br /> | screenshot =<br /> | author = [[Paul Phillips (poker player)|Paul Phillips]]<br /> | developer = Larry Doolittle and Jon Nelson<br /> | released = circa 1995<br /> | status = Discontinued<br /> | latest release version = 0.94.13<br /> | latest release date = {{start date and age|2002|07|30}}<br /> | latest preview version = 0.94.14rc21<br /> | latest preview date = {{start date and age|2005|02|23}}<br /> | operating_system = [[Cross-platform]]<br /> | genre = [[Web server]]<br /> | language = [[C (programming language)|C]]<br /> | license = [[GPLv2]]<br /> | website = {{URL|http://www.boa.org/}}<br /> }}<br /> <br /> '''Boa''' is an [[open source|open-source]], small-footprint [[web server]] that is suitable for embedded applications. Originally written by [[Paul Phillips (poker player)|Paul Phillips]], it is now maintained by Larry Doolittle and Jon Nelson.<br /> <br /> [[Slashdot]] and [[Fotolog]] use Boa to serve images.{{citation needed}}<br /> <br /> As of January 2006, Boa has the following limitations<br /> * No access control features (HTTP [[Basic access authentication]], etc.)<br /> * No [[chroot]] option (planned)<br /> * No [[Server Side Includes]] (deemed incompatible with server performance goals)<br /> * No SSL support although there are some patches against 0.94.13 that introduce SSL support<br /> <br /> ==See also==<br /> {{Portal|Free software}}<br /> * [[Comparison of web servers]]<br /> <br /> ==External links==<br /> *{{Official website}}<br /> *[http://www.osnews.com/story/2217/An_Overview_of_the_Boa_Web_Server An Overview of the Boa Web Server]<br /> *[http://www.linuxjournal.com/article/4773 Boa: an Embedded Web Server]<br /> *[http://www.freescale.com/files/32bit/doc/app_note/AN3238.pdf User Interface Design using CGI Programming and Boa Web Server on M5249C3 Board]<br /> *[http://a-voyage-into-the-land-of-boa.blogspot.in/2013/09/the-beginning-boa-log-bloag.html Reviving boa ]<br /> *[http://boa-web-server.999882.n3.nabble.com/ Mailing List]<br /> <br /> {{Web server software}}<br /> <br /> {{DEFAULTSORT:Boa (Web Server)}}<br /> [[Category:Free web server software]]<br /> <br /> <br /> {{network-software-stub}}</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Lisp_(programming_language)&diff=676442676 Lisp (programming language) 2015-08-17T01:09:48Z <p>PuercoPop: /* Major dialects */ Languages are not compiled nor interpreted, implementations are.</p> <hr /> <div>{{redirect|LISP|the Internet protocol|Locator/Identifier Separation Protocol}}<br /> {{Infobox programming language<br /> | name = Lisp<br /> | paradigm = [[multi-paradigm programming language|Multi-paradigm]]: [[functional programming|functional]], [[procedural programming|procedural]], [[Reflection (computer science)|reflective]], [[metaprogramming|meta]]<br /> | year = 1958<br /> | designer = [[John McCarthy (computer scientist)|John McCarthy]]<br /> | developer = [[Steve Russell]], Timothy P. Hart, and Mike Levin| latest release version =<br /> | latest release date =<br /> | turing-complete = Yes<br /> | typing = [[Dynamic typing|dynamic]], [[Strongly typed programming language|strong]]<br /> | implementations =<br /> | dialects = [[Arc (programming language)|Arc]], [[AutoLISP]], [[Clojure]], [[Common Lisp]], [[Emacs Lisp]], [[EuLisp]], [[Franz Lisp]], [[Hy]], [[Interlisp]], [[ISLISP]], [[LeLisp]], [[LFE (programming language)|LFE]], [[Maclisp]], [[MDL (programming language)|MDL]], [[Newlisp]], [[NIL (programming language)|NIL]], [[Picolisp]], [[Portable Standard Lisp]], [[Racket (programming language)|Racket]], [[Scheme (programming language)|Scheme]], [[Cadence SKILL|SKILL]], [[Spice Lisp]], [[T (programming language)|T]], [[XLISP]], [[Zetalisp]]<br /> | influenced by = [[Information Processing Language|IPL]]<br /> | influenced = [[CLIPS]], [[CLU (programming language)|CLU]], [[COWSEL]], [[Dylan (programming language)|Dylan]], [[Falcon (programming language)|Falcon]], [[Forth (programming language)|Forth]], [[Haskell (programming language)|Haskell]], [[Io (programming language)|Io]], [[Ioke (programming language)|Ioke]], [[JavaScript]], [[Julia (programming language)|Julia]], [[Logo (programming language)|Logo]], [[Lua (programming language)|Lua]], [[Mathematica]], [[MDL (programming language)|MDL]], [[ML (programming language)|ML]], [[Nu (programming language)|Nu]], [[OPS5]], [[Perl]], [[POP-2]]/[[POP-11|11]], [[Python (programming language)|Python]], [[R (programming language)|R]], [[Rebol]], [[Ruby (programming language)|Ruby]], [[Smalltalk]], [[Tcl]]<br /> }}<br /> <br /> '''Lisp''' (historically, '''LISP''') is a family of [[computer]] [[programming language]]s with a long history and a distinctive, fully parenthesized [[Polish notation|Polish prefix]] notation.&lt;ref&gt;<br /> {{cite book<br /> | title = Milestones in computer science and information technology<br /> | author = Edwin D. Reilly<br /> | publisher = Greenwood Publishing Group<br /> | year = 2003<br /> | isbn = 978-1-57356-521-9<br /> | pages = 156–157<br /> | url = http://books.google.com/books?id=JTYPKxug49IC&amp;pg=PA157<br /> }}&lt;/ref&gt;<br /> Originally specified in 1958, Lisp is the second-oldest [[high-level programming language]] in widespread use today; only [[Fortran]] is older (by one year).&lt;ref&gt;{{cite web|url=http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-5.html|quote=Lisp is a survivor, having been in use for about a quarter of a century. Among the active programming languages only Fortran has had a longer life.|title=SICP: Foreword}}&lt;/ref&gt;&lt;ref&gt;{{cite web|url=http://www-formal.stanford.edu/jmc/history/lisp/node6.html#SECTION00060000000000000000|title=Conclusions}}&lt;/ref&gt; Like Fortran, Lisp has changed a great deal since its early days, and a number of [[Programming language dialect|dialects]] have existed over its history. Today, the most widely known general-purpose Lisp dialects are [[Common Lisp]] and [[Scheme (programming language)|Scheme]].<br /> <br /> Lisp was originally created as a practical mathematical notation for computer programs, influenced by the notation of [[Alonzo Church]]'s [[lambda calculus]]. It quickly became the favored programming language for [[artificial intelligence]] (AI) research. As one of the earliest programming languages, Lisp pioneered many ideas in [[computer science]], including [[tree data structure]]s, [[Garbage collection (computer science)|automatic storage management]], [[dynamic typing]], [[Conditional (computer programming)|conditionals]], [[higher-order function]]s, [[Recursion (computer science)|recursion]], and the [[self-hosting]] [[compiler]].&lt;ref name=&quot;GRAHAM&quot;&gt;{{cite web| title=Revenge of the Nerds| author=Paul Graham | url=http://www.paulgraham.com/icad.html | accessdate=2013-03-14}}&lt;/ref&gt;<br /> <br /> The name ''LISP'' derives from &quot;LISt Processing&quot;. [[Linked list]]s are one of Lisp language's major [[data structure]]s, and Lisp [[source code]] is itself made up of lists. As a result, Lisp programs can manipulate source code as a data structure, giving rise to the [[Macro (computer science)|macro]] systems that allow programmers to create new syntax or new [[domain-specific language]]s embedded in Lisp.<br /> <br /> The interchangeability of code and data also gives Lisp its instantly recognizable syntax. All program code is written as ''[[s-expression]]s'', or parenthesized lists. A function call or syntactic form is written as a list with the function or operator's name first, and the arguments following; for instance, a function {{Lisp2|f}} that takes three arguments would be called as {{Lisp2|(f arg1 arg2 arg3)}}.<br /> <br /> ==History==<br /> {{Multiple image|image1 = John McCarthy Stanford.jpg|footer = John McCarthy (top) and Steve Russell (bottom)|image2 = Steve Russell.jpg|direction = vertical|}}<br /> <br /> Lisp was invented by [[John McCarthy (computer scientist)|John McCarthy]] in 1958 while he was at the [[Massachusetts Institute of Technology]] (MIT). McCarthy published its design in a paper in ''[[Communications of the ACM]]'' in 1960, entitled &quot;Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I&quot;&lt;ref name=&quot;MCCARTHY&quot;&gt;{{cite web| title=Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I| author=John McCarthy | url=http://www-formal.stanford.edu/jmc/recursive.html | accessdate=2006-10-13}}&lt;/ref&gt; (&quot;Part II&quot; was never published). He showed that with a few simple operators and a notation for functions, one can build a [[Turing-complete]] language for algorithms.<br /> <br /> [[Information Processing Language]] was the first AI language, from 1955 or 1956, and already included many of the concepts, such as list-processing and recursion, which came to be used in Lisp.<br /> <br /> McCarthy's original notation used bracketed &quot;[[M-expression]]s&quot; that would be translated into [[S-expression]]s. As an example, the M-expression {{Lisp2|car[cons[A,B]]}} is equivalent to the S-expression {{Lisp2|(car (cons A B))}}. Once Lisp was implemented, programmers rapidly chose to use S-expressions, and M-expressions were abandoned. M-expressions surfaced again with short-lived attempts of [[MLISP]]&lt;ref name=&quot;SMITH&quot;&gt;{{cite web| title=MLISP Users Manual| author=David Canfield Smith | url=http://www.softwarepreservation.org/projects/LISP/stanford/Smith-MLISP-AIM-84.pdf | accessdate=2006-10-13}}&lt;/ref&gt; by [[Horace Enea]] and [[CGOL]] by [[Vaughan Pratt]].<br /> <br /> Lisp was first implemented by [[Steve Russell]] on an [[IBM 704]] computer. Russell had read McCarthy's paper, and realized (to McCarthy's surprise) that the Lisp ''eval'' function could be implemented in [[machine code]].&lt;ref&gt;According to what reported by [[Paul Graham (computer programmer)|Paul Graham]] in ''[[Hackers &amp; Painters]]'', p. 185, McCarthy said: &quot;Steve Russell said, look, why don't I program this ''eval''..., and I said to him, ho, ho, you're confusing theory with practice, this ''eval'' is intended for reading, not for computing. But he went ahead and did it. That is, he compiled the ''eval'' in my paper into [[IBM 704]] machine code, fixing [[Software bug|bug]], and then advertised this as a Lisp interpreter, which it certainly was. So at that point Lisp had essentially the form that it has today...&quot;&lt;/ref&gt; The result was a working Lisp interpreter which could be used to run Lisp programs, or more properly, 'evaluate Lisp expressions.'<br /> <br /> Two assembly language macros for the [[IBM 704]] became the primitive operations for decomposing lists: [[Car and cdr|{{Lisp2|car}}]] (Contents of the Address part of Register number) and [[Car and cdr|{{Lisp2|cdr}}]] (Contents of the Decrement part of Register number).&lt;ref name=&quot;PREHISTORY&quot;&gt;{{cite web| title=LISP prehistory - Summer 1956 through Summer 1958| author=John McCarthy | url=http://www-formal.stanford.edu/jmc/history/lisp/node2.html | accessdate=2010-03-14}}&lt;/ref&gt; From the context, it is clear that the term &quot;Register&quot; is used here to mean &quot;Memory Register&quot;, nowadays called &quot;Memory Location&quot;. Lisp dialects still use {{Lisp2|car}} and {{Lisp2|cdr}} ({{IPAc-en|ˈ|k|ɑr}} and {{IPAc-en|ˈ|k|ʊ|d|ər}}) for the operations that return the first item in a list and the rest of the list respectively.<br /> <br /> The first complete Lisp compiler, written in Lisp, was implemented in 1962 by Tim Hart and Mike Levin at MIT.&lt;ref name=&quot;LEVIN&quot;&gt;{{cite web| title=AI Memo 39-The new compiler| author=Tim Hart and Mike Levin | url=ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-039.pdf | accessdate=2006-10-13}}&lt;/ref&gt; This compiler introduced the Lisp model of incremental compilation, in which compiled and interpreted functions can intermix freely. The language used in Hart and Levin's memo is much closer to modern Lisp style than McCarthy's earlier code.<br /> <br /> Lisp was a difficult system to implement with the compiler techniques and stock hardware of the 1970s. [[Garbage collection (computer science)|Garbage collection]] routines, developed by then-[[MIT]] graduate student [[Daniel Edwards (programmer)|Daniel Edwards]], made it practical to run Lisp on general-purpose computing systems, but efficiency was still a problem.{{citation needed|date=October 2010}} This led to the creation of [[Lisp machine]]s: dedicated hardware for running Lisp environments and programs. Advances in both computer hardware and compiler technology soon made Lisp machines obsolete.{{citation needed|date=May 2011}}<br /> <br /> During the 1980s and 1990s, a great effort was made to unify the work on new Lisp dialects (mostly successors to [[Maclisp]] like [[ZetaLisp]] and NIL (New Implementation of Lisp)) into a single language. The new language, [[Common Lisp]], was somewhat compatible with the dialects it replaced (the book [[Common Lisp the Language]] notes the compatibility of various constructs). In 1994, [[ANSI]] published the Common Lisp standard, &quot;ANSI X3.226-1994 Information Technology Programming Language Common Lisp.&quot;<br /> <br /> &lt;timeline&gt;<br /> Preset = TimeHorizontal_AutoPlaceBars_UnitYear<br /> ImageSize = width:1024<br /> PlotArea = right:256<br /> <br /> Define $bold = fontsize:L shift:(10,-4)<br /> <br /> Colors =<br /> id:offWhite value:rgb(0.97,0.97,0.97)<br /> id:paleGray value:rgb(0.86,0.86,0.86)<br /> id:darkGray value:gray(0.6)<br /> <br /> BackgroundColors = canvas:offWhite<br /> <br /> Period = from:1958 till:2013<br /> ScaleMajor = unit:year increment:5 start:1958 gridcolor:paleGray<br /> <br /> BarData=<br /> barset:Dialects<br /> <br /> PlotData=<br /> <br /> # set defaults<br /> width:15 fontsize:M textcolor:black align:left anchor:from shift:(0,-2) color:darkGray<br /> barset:Dialects<br /> <br /> from:1958 till:1965 text:&quot;Lisp 1.5&quot;<br /> from:1965 till:1985 text:&quot;[[Maclisp]]&quot;<br /> from:1970 till:1995 text:&quot;[[ZetaLisp]]&quot;<br /> from:1970 till:1980 text:&quot;[[NIL (programming language)|NIL]]&quot;<br /> from:1970 till:1990 text:&quot;[[Interlisp]]&quot;<br /> from:1984 till:2013 text:&quot;[[Common Lisp]]&quot;<br /> from:1975 till:2013 text:&quot;[[Scheme (programming language)|Scheme]]&quot;<br /> from:1986 till:2013 text:&quot;[[ISLISP]]&quot;<br /> from:2007 till:2013 text:&quot;[[Clojure]]&quot;<br /> &lt;/timeline&gt;<br /> <br /> ===Connection to artificial intelligence===<br /> Since its inception, Lisp was closely connected with the [[artificial intelligence]] research community, especially on [[PDP-10]]&lt;ref&gt;The 36-bit word size of the [[PDP-6]]/[[PDP-10]] was influenced by the usefulness of having two Lisp 18-bit pointers in a single word. {{cite newsgroup | quote = The PDP-6 project started in early 1963, as a 24-bit machine. It grew to 36 bits for LISP, a design goal. | url = http://groups.google.com/group/alt.folklore.computers/browse_thread/thread/6e5602ce733d0ec/17597705ae289112 | title = The History of TOPS or Life in the Fast ACs | newsgroup = alt.folklore.computers |message-id= 84950@tut.cis.ohio-state.edu | date = 18 October 1990 | author = Peter J. Hurley}}&lt;/ref&gt; systems. Lisp was used as the implementation of the programming language [[Planner programming language|Micro Planner]] which was used in the famous AI system [[SHRDLU]]. In the 1970s, as AI research spawned commercial offshoots, the performance of existing Lisp systems became a growing issue.{{Citation needed|date=March 2010}}<br /> <br /> ===Genealogy and variants===<br /> Over its fifty-year history, Lisp has spawned many variations on the core theme of an S-expression language. Moreover, each given dialect may have several implementations—for instance, there are more than a dozen implementations of [[Common Lisp]].<br /> <br /> Differences between dialects may be quite visible—for instance, Common Lisp uses the keyword &lt;code&gt;defun&lt;/code&gt; to name a function, but Scheme uses &lt;code&gt;define&lt;/code&gt;.&lt;ref&gt;Common Lisp: &lt;code&gt;(defun f (x) x)&lt;/code&gt;&lt;br/&gt;Scheme: &lt;code&gt;(define f (lambda (x) x))&lt;/code&gt; or &lt;code&gt;(define (f x) x)&lt;/code&gt;&lt;/ref&gt; Within a dialect that is standardized, however, conforming implementations support the same core language, but with different extensions and libraries.<br /> <br /> ====Historically significant dialects====<br /> [[File:LISP machine.jpg|thumb|right|A Lisp machine in the [[MIT Museum]]]]<br /> [[File:4.3 BSD UWisc VAX Emulation Lisp Manual.png|thumb|[[4.3BSD|4.3 BSD]] from the [[University of Wisconsin]], displaying the [[man page]] for [[Franz Lisp]]]]<br /> <br /> *LISP 1&lt;ref&gt;{{Cite journal<br /> | last = McCarthy | first = J. | author-link = John McCarthy (computer scientist)<br /> | last2 = Brayton | first2 = R. | author2-link = Robert Brayton (computer scientist)<br /> | last3 = Edwards | first3 = D. | author3-link = Daniel Edwards (programmer)<br /> | last4 = Fox | first4 = P. | author4-link = Phyllis Fox<br /> | last5 = Hodes | first5 = L. | author5-link = Louis Hodes<br /> | last6 = Luckham | first6 = D. | author6-link = David Luckham<br /> | last7 = Maling | first7 = K. | author7-link = Klim Maling (programmer)<br /> | last8 = Park | first8 = D. | author8-link = David Park (computer scientist)<br /> | last9 = Russell | first9 = S. | author9-link = Steve Russell <br /> | title = LISP I Programmers Manual<br /> | place = [[Boston]], [[Massachusetts]]<br /> | publisher = Artificial Intelligence Group, [[M.I.T. Computation Center]] and [[Research Laboratory of Electronics at MIT|Research Laboratory]]<br /> | origyear =<br /> |date=March 1960<br /> | volume =<br /> | edition =<br /> | chapter =<br /> | chapterurl =<br /> | page =<br /> | pages =<br /> | url = http://history.siam.org/sup/Fox_1960_LISP.pdf<br /> | archiveurl =<br /> | archivedate =<br /> | doi =<br /> | id =<br /> | isbn =<br /> | postscript = &lt;!--None--&gt; }} Accessed May 11, 2010.&lt;/ref&gt; – First implementation.<br /> *LISP 1.5&lt;ref&gt;{{Cite book| url = http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf | title = LISP 1.5 Programmer's Manual | publisher = [[MIT Press]] | first1 = John | last1 = McCarthy | first2 = Paul W. | last2 = Abrahams | first3 = Daniel J. | last3 = Edwards | first4 = Timothy P. | last4 = Hart | first5 = Michael I. | last5 = Levin | isbn = 0-262-13011-4 | origyear = 1962|edition= 2nd|year=1985}}&lt;/ref&gt; – First widely distributed version, developed by McCarthy and others at MIT. So named because it contained several improvements on the original &quot;LISP 1&quot; interpreter, but was not a major restructuring as the planned [[LISP 2]] would be.<br /> *[[Stanford LISP]] 1.6&lt;ref&gt;{{Cite book| url = http://www.softwarepreservation.org/projects/LISP/stanford/SAILON-28.6.pdf | format = PDF | title = Stanford LISP 1.6 Manual | first1 = Lynn H. | last1 = Quam | first2 = Whitfield | last2 = Diffle}}&lt;/ref&gt; – This was a successor to LISP 1.5 developed at the [[Stanford AI Lab]], and widely distributed to [[PDP-10]] systems running the [[TOPS-10]] operating system. It was rendered obsolete by Maclisp and InterLisp.<br /> *[[Maclisp|MACLISP]]&lt;ref&gt;{{cite web| url = http://zane.brouhaha.com/~healyzh/doc/lisp.doc.txt | title = Maclisp Reference Manual | date = March 3, 1979 | archiveurl = http://web.archive.org/web/20071214064433/http://zane.brouhaha.com/~healyzh/doc/lisp.doc.txt | archivedate = 2007-12-14}}&lt;/ref&gt; – developed for MIT's [[Project MAC]] (no relation to Apple's [[Macintosh]], nor to [[John McCarthy (computer scientist)|McCarthy]]), direct descendant of LISP 1.5. It ran on the PDP-10 and [[Multics]] systems. (MACLISP would later come to be called Maclisp, and is often referred to as MacLisp.)<br /> *[[InterLisp]]&lt;ref&gt;{{Cite book| url = http://www.bitsavers.org/pdf/xerox/interlisp/1974_InterlispRefMan.pdf | format = PDF | title = InterLisp Reference Manual | first = Warren | last = Teitelman | year = 1974 }}&lt;/ref&gt; – developed at [[BBN Technologies]] for PDP-10 systems running the [[TOPS-20|Tenex]] operating system, later adopted as a &quot;West coast&quot; Lisp for the Xerox Lisp machines as [[InterLisp-D]]. A small version called &quot;InterLISP 65&quot; was published for the [[MOS 6502|6502]]-based [[Atari 8-bit family]] computer line. For quite some time Maclisp and InterLisp were strong competitors.<br /> *[[Franz Lisp]] – originally a [[University of California, Berkeley|Berkeley]] project; later developed by Franz Inc. The name is a humorous deformation of the name &quot;[[Franz Liszt]]&quot;, and does not refer to [[Allegro Common Lisp]], the dialect of Common Lisp sold by Franz Inc., in more recent years.<br /> *[[XLISP]], which [[AutoLISP]] was based on.<br /> *[[Standard Lisp]] and [[Portable Standard Lisp]] were widely used and ported, especially with the Computer Algebra System REDUCE.<br /> *[[ZetaLisp]], also known as Lisp Machine Lisp – used on the [[Lisp machine]]s, direct descendant of Maclisp. ZetaLisp had a big influence on Common Lisp.<br /> *[[LeLisp]] is a French Lisp dialect. One of the first [[Interface Builder]]s was written in LeLisp.{{Citation needed|reason=No dispute about Lisp, but LeLisp specifically?|date=November 2014}}<br /> *[[Scheme (programming language)|Scheme]] (1975).&lt;ref&gt;ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-349.pdf&lt;/ref&gt;<br /> *[[Common Lisp]] (1984), as described by ''[[Common Lisp the Language]]'' – a consolidation of several divergent attempts (ZetaLisp, [[Spice Lisp]], [[NIL (programming language)|NIL]], and [[S-1 Lisp]]) to create successor dialects&lt;ref&gt;{{Cite book| chapterurl = http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node6.html | title = Common Lisp the Language | edition = 2nd | chapter = Purpose | first = Guy L., Jr. | last = Steele| isbn = 0-13-152414-3}}&lt;/ref&gt; to Maclisp, with substantive influences from the Scheme dialect as well. This version of Common Lisp was available for wide-ranging platforms and was accepted by many as a [[de facto standard]]&lt;ref&gt;{{cite web| url = http://www.cs.cmu.edu/Groups/AI/html/faqs/lang/lisp/part2/faq-doc-13.html | title = History: Where did Lisp come from? | work = FAQ: Lisp Frequently Asked Questions 2/7 | date = 20 February 1996 | first1 = Mark | last1 = Kantrowitz | first2 = Barry | last2 = Margolin}}&lt;/ref&gt; until the publication of ANSI Common Lisp (ANSI X3.226-1994).<br /> *[[Dylan (programming language)|Dylan]] was in its first version a mix of Scheme with the Common Lisp Object System.<br /> *[[EuLisp]] – attempt to develop a new efficient and cleaned-up Lisp.<br /> *[[ISLISP]] – attempt to develop a new efficient and cleaned-up Lisp. Standardized as ISO/IEC 13816:1997&lt;ref&gt;{{cite web|url=http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=22987 |title=ISO/IEC 13816:1997 |publisher=Iso.org |date=2007-10-01 |accessdate=2013-11-15}}&lt;/ref&gt; and later revised as ISO/IEC 13816:2007:&lt;ref&gt;{{cite web|url=http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=44338 |title=ISO/IEC 13816:2007 |publisher=Iso.org |date=2013-10-30 |accessdate=2013-11-15}}&lt;/ref&gt; ''Information technology – Programming languages, their environments and system software interfaces – Programming language ISLISP''.<br /> *IEEE [[Scheme (programming language)|Scheme]] – IEEE standard, 1178–1990 (R1995)<br /> *ANSI [[Common Lisp]] – an [[American National Standards Institute]] (ANSI) [[Standardization|standard]] for Common Lisp, created by subcommittee [[X3J13]], chartered&lt;ref&gt;{{cite web| url = http://www.nhplace.com/kent/CL/x3j13-86-020.html | title = X3J13 Charter}}&lt;/ref&gt; to begin with ''Common Lisp: The Language'' as a base document and to work through a public [[Consensus decision-making|consensus]] process to find solutions to shared issues of [[Portability (software)|portability]] of programs and [[Computer compatibility|compatibility]] of Common Lisp implementations. Although formally an ANSI standard, the implementation, sale, use, and influence of ANSI Common Lisp has been and continues to be seen worldwide.<br /> *[[ACL2]] or &quot;A Computational Logic for Applicative Common Lisp&quot;, an applicative (side-effect free) variant of Common LISP. ACL2 is both a programming language in which you can model computer systems and a tool to help proving properties of those models.<br /> *[[Clojure]], a modern dialect of Lisp which compiles to the [[Java virtual machine]] and handles [[Concurrency (computer science)|concurrency]] very well.<br /> <br /> ===2000-present===<br /> After having declined somewhat in the 1990s, Lisp has recently experienced a resurgence of interest. Most new activity is focused around implementations of [[Common Lisp]] as well as [[Clojure]], [[Racket (programming language)|Racket]], [[Scheme (programming language)|Scheme]] and [[Emacs Lisp]], and includes the development of new portable libraries and applications.<br /> <br /> Many new Lisp programmers were inspired by writers such as [[Paul Graham (computer programmer)|Paul Graham]] and [[Eric S. Raymond]] to pursue a language others considered antiquated. New Lisp programmers often describe the language as an eye-opening experience and claim to be substantially more productive than in other languages.&lt;ref&gt;{{cite web| title=The Road To Lisp Survey | url=http://wiki.alu.org/The_Road_To_Lisp_Survey | accessdate=2006-10-13}}&lt;/ref&gt; This increase in awareness may be contrasted to the &quot;[[AI winter]]&quot; and Lisp's brief gain in the mid-1990s.&lt;ref&gt;{{cite web|url=http://www.faqs.org/docs/artu/ch14s05.html |title=Trends for the Future |publisher=Faqs.org |accessdate=2013-11-15}}&lt;/ref&gt;<br /> <br /> Dan Weinreb lists in his survey of Common Lisp implementations&lt;ref&gt;{{cite web|last=Weinreb|first=Daniel|title=Common Lisp Implementations: A Survey|url=http://common-lisp.net/~dlw/LispSurvey.html|accessdate=4 April 2012}}&lt;/ref&gt; eleven actively maintained Common Lisp implementations. Scieneer Common Lisp is a new commercial implementation forked from CMUCL with a first release in 2002.<br /> <br /> The open source community has created new supporting infrastructure: [[CLiki]] is a wiki that collects Common Lisp related information, the [[Common Lisp directory]] lists resources, #lisp is a popular IRC channel (with support by a Lisp-written Bot), [[lisppaste]] supports the sharing and commenting of code snippets, [[Planet Lisp]] collects the contents of various Lisp-related blogs, on [[LispForum]] users discuss Lisp topics, [[Lispjobs]] is a service for announcing job offers and there is a weekly news service, ''[[Weekly Lisp News]]''. ''Common-lisp.net'' is a hosting site for open source Common Lisp projects. [[Quicklisp]] is a library manager for Common Lisp.<br /> <br /> 50 years of Lisp (1958–2008) has been celebrated at LISP50@OOPSLA.&lt;ref&gt;{{cite web|url=http://www.lisp50.org/ |title=LISP50@OOPSLA |publisher=Lisp50.org |accessdate=2013-11-15}}&lt;/ref&gt; There are regular local user meetings in Boston, Vancouver, and Hamburg. Other events include the European Common Lisp Meeting, the European Lisp Symposium and an International Lisp Conference.<br /> <br /> The Scheme community actively maintains [[Scheme (programming language)#Implementations|over twenty implementations]]. Several significant new implementations (Chicken, Gambit, Gauche, Ikarus, Larceny, Ypsilon) have been developed in the last few years. The Revised&lt;sup&gt;5&lt;/sup&gt; Report on the Algorithmic Language Scheme&lt;ref&gt;[http://www.schemers.org/Documents/Standards/R5RS/ Documents: Standards: R5RS]. schemers.org (2012-01-11). Retrieved on 2013-07-17.&lt;/ref&gt; standard of Scheme was widely accepted in the Scheme community. The [[Scheme Requests for Implementation]] process has created a lot of quasi standard libraries and extensions for Scheme. User communities of individual Scheme implementations continue to grow. A new language standardization process was started in 2003 and led to the R&lt;sup&gt;6&lt;/sup&gt;RS Scheme standard in 2007. Academic use of Scheme for teaching computer science seems to have declined somewhat. Some universities, such as MIT, are no longer using Scheme in their computer science introductory courses.&lt;ref&gt;{{cite news|url=http://cemerick.com/2009/03/24/why-mit-now-uses-python-instead-of-scheme-for-its-undergraduate-cs-program/|title=Why MIT now uses python instead of scheme for its undergraduate CS program|date=March 24, 2009|work=cemerick.com|accessdate=November 10, 2013}}&lt;/ref&gt;&lt;ref&gt;{{cite news|url=http://mitadmissions.org/blogs/entry/the_end_of_an_era_1|title=The End of an Era|first=Evan|last=Broder|date=January 8, 2008|work=mitadmissions.org|accessdate=November 10, 2013}}&lt;/ref&gt;<br /> <br /> There are several new dialects of Lisp: [[Arc (programming language)|Arc]], [[Hy]], [[Nu (programming language)|Nu]], [[Clojure]], [[Liskell]], [[LFE (programming language)|LFE]] (Lisp Flavored Erlang) and [[Racket (programming language)|Racket]].<br /> <br /> ==Major dialects==<br /> [[Common Lisp]] and [[Scheme (programming language)|Scheme]] represent two major streams of Lisp development. These languages embody significantly different design choices.<br /> <br /> [[Common Lisp]] is a successor to [[MacLisp]]. The primary influences were [[Lisp Machine Lisp]], [[MacLisp]], [[NIL (programming language)|NIL]], [[S-1 Lisp]], [[Spice Lisp]], and Scheme.&lt;ref&gt;Chapter 1.1.2, History, ANSI CL Standard&lt;/ref&gt; It has many of the features of Lisp Machine Lisp (a large Lisp dialect used to program [[Lisp Machine]]s), but was designed to be efficiently implementable on any personal computer or workstation. Common Lisp has a large language standard including many built-in data types, functions, macros and other language elements, as well as an object system ([[Common Lisp Object System]] or shorter CLOS). Common Lisp also borrowed certain features from Scheme such as [[lexical scoping]] and [[lexical closure]]s.<br /> <br /> Scheme (designed earlier) is a more minimalist design, with a much smaller set of standard features but with certain implementation features (such as [[tail-call optimization]] and full [[continuation]]s) not necessarily found in Common Lisp.<br /> <br /> [[Scheme (programming language)|Scheme]] is a statically scoped and properly tail-recursive dialect of the Lisp programming language invented by [[Guy L. Steele, Jr.|Guy Lewis Steele Jr.]] and [[Gerald Jay Sussman]]. It was designed to have exceptionally clear and simple semantics and few different ways to form expressions. A wide variety of programming paradigms, including imperative, functional, and message passing styles, find convenient expression in Scheme. Scheme continues to evolve with a series of standards (Revised&lt;sup&gt;n&lt;/sup&gt; Report on the Algorithmic Language Scheme) and a series of [[Scheme Requests for Implementation]].<br /> <br /> [[Clojure]] is a recent dialect of Lisp that principally targets the [[Java Virtual Machine]], as well as the [[Common Language Runtime|CLR]], the [[Python (programming language)|Python VM]], the Ruby VM [[YARV]], and compiling to [[JavaScript]]. It is designed to be a pragmatic general-purpose language. Clojure draws considerable influences from [[Haskell (programming language)|Haskell]] and places a very strong emphasis on immutability.&lt;ref name=&quot;clojure-immutability&quot;&gt;[http://www.infoq.com/articles/in-depth-look-clojure-collections An In-Depth Look at Clojure Collections], Retrieved 2012-06-24&lt;/ref&gt; Every feature supported by Clojure is supported at runtime. Clojure provides access to Java frameworks and libraries, with optional type hints and [[type inference]], so that calls to Java can avoid reflection and enable fast primitive operations.<br /> <br /> In addition, Lisp dialects are used as [[scripting language]]s in a number of applications, with the most well-known being [[Emacs Lisp]] in the [[Emacs]] editor, [[AutoLisp]] and later [[Visual Lisp]] in [[AutoCAD]], Nyquist in [[Audacity (audio editor)|Audacity]], Scheme in [[LilyPond]]. The potential small size of a useful Scheme interpreter makes it particularly popular for embedded scripting. Examples include [[SIOD]] and [[TinyScheme]], both of which have been successfully embedded in the [[GIMP]] image processor under the generic name &quot;Script-fu&quot;.&lt;ref name=&quot;script-fu&quot;&gt;[http://www.gimp.org/docs/script-fu-update.html Script-fu In GIMP 2.4], Retrieved 2009-10-29&lt;/ref&gt; LIBREP, a Lisp interpreter by John Harper originally based on the [[Emacs Lisp]] language, has been embedded in the [[Sawfish (window manager)|Sawfish]] [[window manager]].&lt;ref name=&quot;librep&quot;&gt;[http://sawfish.wikia.com/wiki/Librep librep] at Sawfish Wikia, retrieved 2009-10-29&lt;/ref&gt;<br /> <br /> ==Language innovations==<br /> Lisp was the first language where the structure of program code is represented faithfully and directly in a standard data structure—a quality much later dubbed &quot;[[homoiconicity]]&quot;. As a result, Lisp functions can be manipulated, altered or even created within a Lisp program without lower-level manipulations. This is generally considered one of the primary advantages of the language with regard to its expressive power, and makes the language suitable for [[syntactic macros]] and [[metacircular evaluation]].<br /> <br /> A conditional using an ''if-then-else'' syntax was invented by McCarthy in a Fortran context. He proposed its inclusion in [[ALGOL]], but it was not made part of the [[Algol 58]] specification. For Lisp, McCarthy used the more general ''cond''-structure.&lt;ref&gt;{{cite web|url=http://www-formal.stanford.edu/jmc/history/lisp/node2.html|title=LISP prehistory - Summer 1956 through Summer 1958.|quote=I invented conditional expressions in connection with a set of chess legal move routines I wrote in FORTRAN for the IBM 704 at M.I.T. during 1957-58...A paper defining conditional expressions and proposing their use in Algol was sent to the Communications of the ACM but was arbitrarily demoted to a letter to the editor, because it was very short.}}&lt;/ref&gt; [[Algol 60]] took up ''if-then-else'' and popularized it.<br /> <br /> Lisp deeply influenced [[Alan Kay]], the leader of the research on [[Smalltalk]], and then in turn Lisp was influenced by Smalltalk, by adopting object-oriented programming features (classes, instances, etc.) in the late 1970s. The Flavours object system (later CLOS) introduced multiple inheritance.<br /> <br /> Lisp introduced the concept of [[Garbage collection (computer science)|automatic garbage collection]], in which the system walks the heap looking for unused memory. Progress in modern sophisticated garbage collection algorithms such as generational garbage collection was stimulated by its use in Lisp.&lt;ref&gt;{{citation |last=Lieberman |first=Henry |last2=Hewitt |first2=Carl |title=A Real-Time Garbage Collector Based on the Lifetimes of Objects |url=http://web.media.mit.edu/~lieber/Lieberary/GC/Realtime/Realtime.html |journal=CACM |volume=26 |issue=6 |date=June 1983 |pages=419–429 |doi=10.1145/358141.358147}}&lt;/ref&gt;<br /> <br /> [[Edsger W. Dijkstra]] in his 1972 [[Turing Award]] lecture said,<br /> :&quot;With a few very basic principles at its foundation, it [LISP] has shown a remarkable stability. Besides that, LISP has been the carrier for a considerable number of in a sense our most sophisticated computer applications. LISP has jokingly been described as “the most intelligent way to misuse a computer”. I think that description a great compliment because it transmits the full flavour of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts.&quot;&lt;ref&gt;{{citation|url=http://www.cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD340.html|author=Edsger W. Dijkstra|year=1972|title=The Humble Programmer (EWD 340)}} (ACM Turing Award lecture).&lt;/ref&gt;<br /> <br /> Largely because of its resource requirements with respect to early computing hardware (including early microprocessors), Lisp did not become as popular outside of the [[AI]] community as [[Fortran]] and the [[ALGOL]]-descended [[C (programming language)|C]] language. Because of its suitability to complex and dynamic applications, Lisp is currently enjoying some resurgence of popular interest.<br /> <br /> ==Syntax and semantics==<br /> :'''''Note''': This article's examples are written in [[Common Lisp]] (though most are also valid in [[Scheme (programming language)|Scheme]]).''<br /> <br /> ===Symbolic expressions (S-expressions)===<br /> Lisp is an [[Expression (computer science)|expression]]-oriented language. Unlike most other languages, no distinction is made between &quot;expressions&quot; and [[Statement (programming)|&quot;statements&quot;]];{{dubious|date=April 2013}}&lt;!-- (progn ...), (setq ...). There is no syntactic distinction, but sequential evaluation is there. --&gt; all code and data are written as expressions. When an expression is ''evaluated'', it produces a value (in Common Lisp, possibly multiple values), which can then be embedded into other expressions. Each value can be any data type.<br /> <br /> McCarthy's 1958 paper introduced two types of syntax: [[S-expression]]s (Symbolic expressions, also called &quot;sexps&quot;), which mirror the internal representation of code and data; and [[M-expression]]s (Meta Expressions), which express functions of S-expressions. M-expressions never found favor, and almost all Lisps today use S-expressions to manipulate both code and data.<br /> <br /> The use of parentheses is Lisp's most immediately obvious difference from other programming language families. As a result, students have long given Lisp nicknames such as ''Lost In Stupid Parentheses'', or ''Lots of Irritating Superfluous Parentheses''.&lt;ref name=&quot;LEVIN2&quot;&gt;{{cite web| title=The Jargon File - Lisp| url=http://www.catb.org/~esr/jargon/html/L/LISP.html| accessdate=2006-10-13}}&lt;/ref&gt;&lt;!-- Do not insert more nicknames. People can look in the Jargon File for them. --&gt; However, the S-expression syntax is also responsible for much of Lisp's power: the syntax is extremely regular, which facilitates manipulation by computer. However, the syntax of Lisp is not limited to traditional parentheses notation. It can be extended to include alternative notations. [[XMLisp]], for instance, is a Common Lisp extension that employs the [[Meta-object protocol|metaobject-protocol]] to integrate S-expressions with the [[Xml|Extensible Markup Language (XML)]].<br /> <br /> The reliance on expressions gives the language great flexibility. Because Lisp [[function (programming)|functions]] are themselves written as lists, they can be processed exactly like data. This allows easy writing of programs which manipulate other programs ([[metaprogramming]]). Many Lisp dialects exploit this feature using macro systems, which enables extension of the language almost without limit.<br /> <br /> ===Lists===<br /> A Lisp list is written with its elements separated by whitespace, and surrounded by parentheses. For example, {{Lisp2|(1 2 foo)}} is a list whose elements are three ''atoms'' {{Lisp2|1}}, {{Lisp2|2}}, and [[foo|{{Lisp2|foo}}]]. These values are implicitly typed: they are respectively two integers and a Lisp-specific data type called a &quot;symbol&quot;, and do not have to be declared as such.<br /> <br /> 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.<br /> <br /> 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 &quot;special operator&quot; (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<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (list 1 2 (quote foo))<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to the list {{Lisp2|(1 2 foo)}}. The &quot;quote&quot; before the [[foo|{{Lisp2|foo}}]] in the preceding example is a &quot;special operator&quot; which returns its argument without evaluating it. Any unquoted expressions are recursively evaluated before the enclosing expression is evaluated. For example,<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (list 1 2 (list 3 4))<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to the list {{Lisp2|(1 2 (3 4))}}. Note that the third argument is a list; lists can be nested.<br /> <br /> ===Operators===<br /> Arithmetic operators are treated similarly. The expression<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (+ 1 2 3 4)<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to 10. The equivalent under [[infix notation]] would be &quot;{{Lisp2|1 + 2 + 3 + 4}}&quot;.<br /> <br /> Lisp has no notion of operators as implemented in Algol-derived languages. Arithmetic operators in Lisp are [[variadic function]]s (or ''[[n-ary]]''), able to take any number of arguments. A C-style '++' increment operator is sometimes implemented under the name &lt;tt&gt;incf&lt;/tt&gt; giving syntax <br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (incf x)<br /> &lt;/syntaxhighlight&gt;<br /> , equivalent to &lt;tt&gt;(setq x (+ x 1))&lt;tt&gt;, returning the new value of &lt;tt&gt;x&lt;/tt&gt;.<br /> <br /> &quot;Special operators&quot; (sometimes called &quot;special forms&quot;) provide Lisp's control structure. For example, the special operator {{Lisp2|if}} takes three arguments. If the first argument is non-nil, it evaluates to the second argument; otherwise, it evaluates to the third argument. Thus, the expression<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (if nil<br /> (list 1 2 &quot;foo&quot;)<br /> (list 3 4 &quot;bar&quot;))<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to {{Lisp2|(3 4 &quot;bar&quot;)}}. Of course, this would be more useful if a non-trivial expression had been substituted in place of {{Lisp2|nil}}.<br /> <br /> ===Lambda expressions and function definition===<br /> Another special operator, {{Lisp2|lambda}}, is used to bind variables to values which are then evaluated within an expression. This operator is also used to create functions: the arguments to {{Lisp2|lambda}} are a list of arguments, and the expression or expressions to which the function evaluates (the returned value is the value of the last expression that is evaluated). The expression<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (lambda (arg) (+ arg 1))<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to a function that, when applied, takes one argument, binds it to {{Lisp2|arg}} and returns the number one greater than that argument. Lambda expressions are treated no differently from named functions; they are invoked the same way. Therefore, the expression<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> ((lambda (arg) (+ arg 1)) 5)<br /> &lt;/syntaxhighlight&gt;<br /> evaluates to {{Lisp2|6}}.<br /> <br /> Named functions are created by storing a lambda expression in a symbol using the [[defun]] macro.<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (defun foo (a b c d) (+ a b c d))<br /> &lt;/syntaxhighlight&gt;<br /> <br /> {{Lisp2|(defun f (a) b...)}} defines a new function named {{Lisp2|f}} in the global environment. It is a shorthand for the expression:<br /> <br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (place-in-function-definition-slot-of-symbol 'f #'(lambda (a) b...))<br /> &lt;/syntaxhighlight&gt;<br /> <br /> ===Atoms===<br /> In the original '''LISP''' there were two fundamental [[data type]]s: atoms and lists. A list was a finite ordered sequence of elements, where each element is in itself either an atom or a list, and an atom was a [[number]] or a symbol. A symbol was essentially a unique named item, written as an [[alphanumeric]] string in [[source code]], and used either as a variable name or as a data item in [[symbolic processing]]. For example, the list {{Lisp2|(FOO (BAR 1) 2)}} contains three elements: the symbol FOO, the list {{Lisp2|(BAR 1)}}, and the number 2.<br /> <br /> The essential difference between atoms and lists was that atoms were immutable and unique. Two atoms that appeared in different places in source code but were written in exactly the same way represented the same object,{{Citation needed|date=November 2008}} whereas each list was a separate object that could be altered independently of other lists and could be distinguished from other lists by comparison operators.<br /> <br /> As more data types were introduced in later Lisp dialects, and [[programming style]]s evolved, the concept of an atom lost importance.{{Citation needed|date=November 2008}} Many dialects still retained the predicate ''atom'' for [[legacy compatibility]],{{Citation needed|date=November 2008}} defining it true for any object which is not a cons.<br /> <br /> ===Conses and lists===<br /> {{Main|Cons}}<br /> [[File:Cons-cells.svg|thumb|right|300px|Box-and-pointer diagram for the list (42 69 613)]]<br /> A Lisp list is [[singly linked list|singly linked]]. Each cell of this list is called a ''cons'' (in Scheme, a ''pair''), and is composed of two [[pointer (computer programming)|pointer]]s, called the ''car'' and ''cdr''. These are respectively equivalent to the {{Lisp2|data}} and {{Lisp2|next}} fields discussed in the article ''[[linked list]]''.<br /> <br /> Of the many data structures that can be built out of cons cells, one of the most basic is called a ''proper list''. A proper list is either the special {{Lisp2|nil}} (empty list) symbol, or a cons in which the {{Lisp2|car}} points to a datum (which may be another cons structure, such as a list), and the {{Lisp2|cdr}} points to another proper list.<br /> <br /> If a given cons is taken to be the head of a linked list, then its car points to the first element of the list, and its cdr points to the rest of the list. For this reason, the {{Lisp2|car}} and {{Lisp2|cdr}} functions are also called {{Lisp2|first}} and {{Lisp2|rest}} when referring to conses which are part of a linked list (rather than, say, a tree).<br /> <br /> Thus, a Lisp list is not an atomic object, as an instance of a container class in C++ or Java would be. A list is nothing more than an aggregate of linked conses. A variable which refers to a given list is simply a pointer to the first cons in the list. Traversal of a list can be done by &quot;cdring down&quot; the list; that is, taking successive cdrs to visit each cons of the list; or by using any of a number of [[higher-order function]]s to map a function over a list.<br /> <br /> Because conses and lists are so universal in Lisp systems, it is a common misconception that they are Lisp's only data structures. In fact, all but the most simplistic Lisps have other data structures – such as vectors ([[Array data type|arrays]]), hash tables, structures, and so forth.<br /> <br /> ====S-expressions represent lists====<br /> Parenthesized S-expressions represent linked list structures. There are several ways to represent the same list as an S-expression. A cons can be written in ''dotted-pair notation'' as {{Lisp2|(a . b)}}, where {{Lisp2|a}} is the car and {{Lisp2|b}} the cdr. A longer proper list might be written {{Lisp2|(a . (b . (c . (d . nil))))}} in dotted-pair notation. This is conventionally abbreviated as {{Lisp2|(a b c d)}} in ''list notation''. An improper list&lt;ref&gt;NB: a so-called &quot;dotted list&quot; is only one kind of &quot;improper list&quot;. The other kind is the &quot;circular list&quot; where the cons cells form a loop. Typically this is represented using #n=(...) to represent the target cons cell that will have multiple references, and #n# is used to refer to this cons. For instance, (#1=(a b) . #1#) would normally be printed as ((a b) a b) (without circular structure printing enabled), but makes the reuse of the cons cell clear. #1=(a . #1#) cannot normally be printed as it is circular, the CDR of the cons cell defined by #1= is itself.&lt;/ref&gt; may be written in a combination of the two – as {{Lisp2|(a b c . d)}} for the list of three conses whose last cdr is {{Lisp2|d}} (i.e., the list {{Lisp2|(a . (b . (c . d)))}} in fully specified form).<br /> <br /> ====List-processing procedures====<br /> Lisp provides many built-in procedures for accessing and controlling lists. Lists can be created directly with the {{Lisp2|list}} procedure, which takes any number of arguments, and returns the list of these arguments.<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (list 1 2 'a 3)<br /> ;Output: (1 2 a 3)<br /> &lt;/syntaxhighlight&gt;<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (list 1 '(2 3) 4)<br /> ;Output: (1 (2 3) 4)<br /> &lt;/syntaxhighlight&gt;<br /> Because of the way that lists are constructed from [[cons pair]]s, the {{Lisp2|cons}} procedure can be used to add an element to the front of a list. Note that the {{Lisp2|cons}} procedure is asymmetric in how it handles list arguments, because of how lists are constructed.<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (cons 1 '(2 3))<br /> ;Output: (1 2 3)<br /> &lt;/syntaxhighlight&gt;<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (cons '(1 2) '(3 4))<br /> ;Output: ((1 2) 3 4)<br /> &lt;/syntaxhighlight&gt;<br /> The {{Lisp2|append}} procedure appends two (or more) lists to one another. Because Lisp lists are linked lists, appending two lists has [[Big O notation|asymptotic time complexity]] &lt;math&gt;O(n)&lt;/math&gt;<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (append '(1 2) '(3 4))<br /> ;Output: (1 2 3 4)<br /> &lt;/syntaxhighlight&gt;<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (append '(1 2 3) '() '(a) '(5 6))<br /> ;Output: (1 2 3 a 5 6)<br /> &lt;/syntaxhighlight&gt;<br /> <br /> ====Shared structure====<br /> Lisp lists, being simple linked lists, can share structure with one another. That is to say, two lists can have the same ''tail'', or final sequence of conses. For instance, after the execution of the following Common Lisp code:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (setf foo (list 'a 'b 'c))<br /> (setf bar (cons 'x (cdr foo)))<br /> &lt;/syntaxhighlight&gt;<br /> the lists {{Lisp2|foo}} and {{Lisp2|bar}} are {{Lisp2|(a b c)}} and {{Lisp2|(x b c)}} respectively. However, the tail {{Lisp2|(b c)}} is the same structure in both lists. It is not a copy; the cons cells pointing to {{Lisp2|b}} and {{Lisp2|c}} are in the same memory locations for both lists.<br /> <br /> Sharing structure rather than copying can give a dramatic performance improvement. However, this technique can interact in undesired ways with functions that alter lists passed to them as arguments. Altering one list, such as by replacing the {{Lisp2|c}} with a {{Lisp2|goose}}, will affect the other:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (setf (third foo) 'goose)<br /> &lt;/syntaxhighlight&gt;<br /> This changes {{Lisp2|foo}} to {{Lisp2|(a b goose)}}, but thereby also changes {{Lisp2|bar}} to {{Lisp2|(x b goose)}} – a possibly unexpected result. This can be a source of bugs, and functions which alter their arguments are documented as ''destructive'' for this very reason.<br /> <br /> Aficionados of [[functional programming]] avoid destructive functions. In the Scheme dialect, which favors the functional style, the names of destructive functions are marked with a cautionary exclamation point, or &quot;bang&quot;—such as {{Lisp2|set-car!}} (read ''set car bang''), which replaces the car of a cons. In the Common Lisp dialect, destructive functions are commonplace; the equivalent of {{Lisp2|set-car!}} is named {{Lisp2|rplaca}} for &quot;replace car.&quot; This function is rarely seen however as Common Lisp includes a special facility, {{Lisp2|setf}}, to make it easier to define and use destructive functions. A frequent style in Common Lisp is to write code functionally (without destructive calls) when prototyping, then to add destructive calls as an optimization where it is safe to do so.<br /> <br /> ===Self-evaluating forms and quoting===<br /> Lisp evaluates expressions which are entered by the user. Symbols and lists evaluate to some other (usually, simpler) expression – for instance, a symbol evaluates to the value of the variable it names; {{Lisp2|(+ 2 3)}} evaluates to {{Lisp2|5}}. However, most other forms evaluate to themselves: if you enter {{Lisp2|5}} into Lisp, it returns {{Lisp2|5}}.<br /> <br /> Any expression can also be marked to prevent it from being evaluated (as is necessary for symbols and lists). This is the role of the {{Lisp2|quote}} special operator, or its abbreviation {{Lisp2|'}} (a single quotation mark). For instance, usually if you enter the symbol {{Lisp2|foo}} you will get back the value of the corresponding variable (or an error, if there is no such variable). If you wish to refer to the literal symbol, you enter {{Lisp2|(quote foo)}} or, usually, {{Lisp2|'foo}}.<br /> <br /> {{anchor|Backquote}}Both Common Lisp and Scheme also support the ''backquote'' operator (known as ''[[quasiquote]]'' in Scheme), entered with the {{Lisp2|`}} character ([[Grave accent#Use in programming|grave accent]]). This is almost the same as the plain quote, except it allows expressions to be evaluated and their values interpolated into a quoted list with the comma {{Lisp2|,}} ''unquote'' and comma-at {{Lisp2|,@}} ''splice'' operators. If the variable {{Lisp2|snue}} has the value {{Lisp2|(bar baz)}} then {{Lisp2|`(foo ,snue)}} evaluates to {{Lisp2|(foo (bar baz))}}, while {{Lisp2|`(foo ,@snue)}} evaluates to {{Lisp2|(foo bar baz)}}. The backquote is most frequently used in defining macro expansions.&lt;ref&gt;{{cite web|url=http://www.cs.washington.edu/education/courses/cse341/04wi/lectures/14-scheme-quote.html |title=CSE 341: Scheme: Quote, Quasiquote, and Metaprogramming |publisher=Cs.washington.edu |date=1999-02-22 |accessdate=2013-11-15}}&lt;/ref&gt;&lt;ref&gt;[http://repository.readscheme.org/ftp/papers/pepm99/bawden.pdf Quasiquotation in Lisp], Alan Bawden&lt;/ref&gt;<br /> <br /> Self-evaluating forms and quoted forms are Lisp's equivalent of literals. It may be possible to modify the values of (mutable) literals in program code. For instance, if a function returns a quoted form, and the code that calls the function modifies the form, this may alter the behavior of the function on subsequent iterations.<br /> <br /> &lt;syntaxhighlight lang=lisp&gt;<br /> (defun should-be-constant ()<br /> '(one two three))<br /> <br /> (let ((stuff (should-be-constant)))<br /> (setf (third stuff) 'bizarre)) ; bad!<br /> <br /> (should-be-constant) ; returns (one two bizarre)<br /> &lt;/syntaxhighlight&gt;<br /> <br /> Modifying a quoted form like this is generally considered bad style, and is defined by ANSI Common Lisp as erroneous (resulting in &quot;undefined&quot; behavior in compiled files, because the file-compiler can coalesce similar constants, put them in write-protected memory, etc.).<br /> <br /> Lisp's formalization of quotation has been noted by [[Douglas Hofstadter]] (in ''[[Gödel, Escher, Bach]]'') and others as an example of the [[philosophy|philosophical]] idea of [[self-reference]].<br /> <br /> ===Scope and closure===<br /> The Lisp family splits over the use of dynamic or static (a.k.a. lexical) [[scope (programming)|scope]]. Clojure, Common Lisp and Scheme make use of static scoping by default, while [[Newlisp]], [[Picolisp]] and the embedded languages in [[Emacs]] and [[AutoCAD]] use dynamic scoping.<br /> <br /> ===List structure of program code; exploitation by macros and compilers===<br /> A fundamental distinction between Lisp and other languages is that in Lisp, the textual representation of a program is simply a human-readable description of the same internal data structures (linked lists, symbols, number, characters, etc.) as would be used by the underlying Lisp system.<br /> <br /> Lisp uses this to implement a very powerful macro system. Like other macro languages such as [[C (programming language)|C]], a macro returns code that can then be compiled. However, unlike C macros, the macros are Lisp functions and so can exploit the full power of Lisp.<br /> <br /> Further, because Lisp code has the same structure as lists, macros can be built with any of the list-processing functions in the language. In short, anything that Lisp can do to a data structure, Lisp macros can do to code. In contrast, in most other languages, the parser's output is purely internal to the language implementation and cannot be manipulated by the programmer.<br /> <br /> This feature makes it easy to develop ''efficient'' languages within languages. For example, the Common Lisp Object System can be implemented cleanly as a language extension using macros. This means that if an application requires a different inheritance mechanism, it can use a different object system. This is in stark contrast to most other languages; for example, Java does not support multiple inheritance and there is no reasonable way to add it.<br /> <br /> In simplistic Lisp implementations, this list structure is directly [[interpreter (computing)|interpreted]] to run the program; a function is literally a piece of list structure which is traversed by the interpreter in executing it. However, most substantial Lisp systems also include a compiler. The compiler translates list structure into machine code or [[bytecode]] for execution. This code can run as fast as code compiled in conventional languages such as C.<br /> <br /> Macros expand before the compilation step, and thus offer some interesting options. If a program needs a precomputed table, then a macro might create the table at compile time, so the compiler need only output the table and need not call code to create the table at run time. Some Lisp implementations even have a mechanism, &lt;code&gt;eval-when&lt;/code&gt;, that allows code to be present during compile time (when a macro would need it), but not present in the emitted module.&lt;ref&gt;[https://www.gnu.org/software/emacs/manual/html_node/cl/Time-of-Evaluation.html Time of Evaluation - Common Lisp Extensions]. Gnu.org. Retrieved on 2013-07-17.&lt;/ref&gt;<br /> <br /> ===Evaluation and the read–eval–print loop===<br /> Lisp languages are frequently used with an interactive [[command line]], which may be combined with an [[integrated development environment]]. The user types in expressions at the command line, or directs the IDE to transmit them to the Lisp system. Lisp ''reads'' the entered expressions, ''evaluates'' them, and ''prints'' the result. For this reason, the Lisp command line is called a &quot;[[read–eval–print loop]]&quot;, or ''[[REPL]]''.<br /> <br /> The basic operation of the REPL is as follows. This is a simplistic description which omits many elements of a real Lisp, such as quoting and macros.<br /> <br /> The {{Lisp2|read}} function accepts textual S-expressions as input, and parses them into an internal data structure. For instance, if you type the text {{Lisp2|(+ 1 2)}} at the prompt, {{Lisp2|read}} translates this into a linked list with three elements: the symbol {{Lisp2|+}}, the number 1, and the number 2. It so happens that this list is also a valid piece of Lisp code; that is, it can be evaluated. This is because the car of the list names a function—the addition operation.<br /> <br /> Note that a {{Lisp2|foo}} will be read as a single symbol. {{Lisp2|123}} will be read as the number one hundred and twenty-three. {{Lisp2|&quot;123&quot;}} will be read as the string &quot;123&quot;.<br /> <br /> The {{Lisp2|eval}} function evaluates the data, returning zero or more other Lisp data as a result. Evaluation does not have to mean interpretation; some Lisp systems compile every expression to native machine code. It is simple, however, to describe evaluation as interpretation: To evaluate a list whose car names a function, {{Lisp2|eval}} first evaluates each of the arguments given in its cdr, then applies the function to the arguments. In this case, the function is addition, and applying it to the argument list {{Lisp2|(1 2)}} yields the answer {{Lisp2|3}}. This is the result of the evaluation.<br /> <br /> The symbol {{Lisp2|foo}} evaluates to the value of the symbol foo. Data like the string &quot;123&quot; evaluates to the same string. The list {{Lisp2|(quote (1 2 3))}} evaluates to the list (1 2 3).<br /> <br /> It is the job of the {{Lisp2|print}} function to represent output to the user. For a simple result such as {{Lisp2|3}} this is trivial. An expression which evaluated to a piece of list structure would require that {{Lisp2|print}} traverse the list and print it out as an S-expression.<br /> <br /> To implement a Lisp REPL, it is necessary only to implement these three functions and an infinite-loop function. (Naturally, the implementation of {{Lisp2|eval}} will be complicated, since it must also implement all special operators like {{Lisp2|if}} or {{Lisp2|lambda}}.) This done, a basic REPL itself is but a single line of code: {{Lisp2|(loop (print (eval (read))))}}.<br /> <br /> The Lisp REPL typically also provides input editing, an input history, error handling and an interface to the debugger.<br /> <br /> Lisp is usually evaluated [[eager evaluation|eagerly]]. In [[Common Lisp]], arguments are evaluated in [[applicative order]] ('leftmost innermost'), while in [[Scheme programming language|Scheme]] order of arguments is undefined, leaving room for optimization by a compiler.<br /> <br /> ===Control structures===<br /> Lisp originally had very few control structures, but many more were added during the language's evolution. (Lisp's original conditional operator, {{Lisp2|cond}}, is the precursor to later {{Lisp2|if-then-else}} structures.)<br /> <br /> Programmers in the Scheme dialect often express loops using [[tail recursion]]. Scheme's commonality in academic computer science has led some students to believe that tail recursion is the only, or the most common, way to write iterations in Lisp, but this is incorrect. All frequently seen Lisp dialects have imperative-style iteration constructs, from Scheme's {{Lisp2|do}} loop to [[Common Lisp]]'s complex {{Lisp2|loop}} expressions. Moreover, the key issue that makes this an objective rather than subjective matter is that Scheme makes specific requirements for the handling of [[tail call]]s, and consequently the reason that the use of tail recursion is generally encouraged for Scheme is that the practice is expressly supported by the language definition itself. By contrast, ANSI Common Lisp does not require&lt;ref&gt;[http://www.lispworks.com/documentation/HyperSpec/Body/03_bbc.htm 3.2.2.3 Semantic Constraints] in [http://www.lispworks.com/documentation/HyperSpec/Front/index.htm ''Common Lisp HyperSpec'']&lt;/ref&gt; the optimization commonly referred to as tail call elimination. Consequently, the fact that tail recursive style as a casual replacement for the use of more traditional [[iteration]] constructs (such as {{Lisp2|do}}, {{Lisp2|dolist}} or {{Lisp2|loop}}) is discouraged&lt;ref&gt;4.3. Control Abstraction (Recursion vs. Iteration) in [http://www.cs.umd.edu/~nau/cmsc421/norvig-lisp-style.pdf Tutorial on Good Lisp Programming Style] by [[Kent Pitman|Pitman]] and [[Peter Norvig|Norvig]], August, 1993.&lt;/ref&gt; in Common Lisp is not just a matter of stylistic preference, but potentially one of efficiency (since an apparent tail call in Common Lisp may not compile as a simple [[Branch (computer science)|jump]]) and program correctness (since tail recursion may increase stack use in Common Lisp, risking [[stack overflow]]).<br /> <br /> Some Lisp control structures are ''special operators'', equivalent to other languages' syntactic keywords. Expressions using these operators have the same surface appearance as function calls, but differ in that the arguments are not necessarily evaluated—or, in the case of an iteration expression, may be evaluated more than once.<br /> <br /> In contrast to most other major programming languages, Lisp allows the programmer to implement control structures using the language itself. Several control structures are implemented as Lisp macros, and can even be macro-expanded by the programmer who wants to know how they work.<br /> <br /> Both Common Lisp and Scheme have operators for non-local control flow. The differences in these operators are some of the deepest differences between the two dialects. Scheme supports ''re-entrant [[continuation]]s'' using the {{Lisp2|call/cc}} procedure, which allows a program to save (and later restore) a particular place in execution. Common Lisp does not support re-entrant continuations, but does support several ways of handling escape continuations.<br /> <br /> Frequently, the same algorithm can be expressed in Lisp in either an imperative or a functional style. As noted above, Scheme tends to favor the functional style, using tail recursion and continuations to express control flow. However, imperative style is still quite possible. The style preferred by many Common Lisp programmers may seem more familiar to programmers used to structured languages such as C, while that preferred by Schemers more closely resembles pure-functional languages such as [[Haskell (programming language)|Haskell]].<br /> <br /> Because of Lisp's early heritage in list processing, it has a wide array of higher-order functions relating to iteration over sequences. In many cases where an explicit loop would be needed in other languages (like a {{Lisp2|for}} loop in C) in Lisp the same task can be accomplished with a higher-order function. (The same is true of many functional programming languages.)<br /> <br /> A good example is a function which in Scheme is called {{Lisp2|map}} and in Common Lisp is called {{Lisp2|mapcar}}. Given a function and one or more lists, {{Lisp2|mapcar}} applies the function successively to the lists' elements in order, collecting the results in a new list:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (mapcar #'+ '(1 2 3 4 5) '(10 20 30 40 50))<br /> &lt;/syntaxhighlight&gt;<br /> This applies the {{Lisp2|+}} function to each corresponding pair of list elements, yielding the result {{Lisp2|(11 22 33 44 55)}}.<br /> <br /> ==Examples==<br /> Here are examples of Common Lisp code.<br /> <br /> The basic &quot;[[Hello world]]&quot; program:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (print &quot;Hello world&quot;)<br /> &lt;/syntaxhighlight&gt;<br /> Lisp syntax lends itself naturally to recursion. Mathematical problems such as the enumeration of recursively defined sets are simple to express in this notation.<br /> <br /> Evaluate a number's [[factorial]]:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (defun factorial (n)<br /> (if (= n 0) 1<br /> (* n (factorial (- n 1)))))<br /> &lt;/syntaxhighlight&gt;<br /> An alternative implementation, often faster than the previous version if the Lisp system has [[tail recursion]] optimization:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (defun factorial (n &amp;optional (acc 1))<br /> (if (= n 0) acc<br /> (factorial (- n 1) (* acc n))))<br /> &lt;/syntaxhighlight&gt;<br /> Contrast with an iterative version which uses [[Common Lisp]]'s {{Lisp2|loop}} macro:<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (defun factorial (n)<br /> (loop for i from 1 to n<br /> for fac = 1 then (* fac i)<br /> finally (return fac)))<br /> &lt;/syntaxhighlight&gt;<br /> <br /> The following function reverses a list. (Lisp's built-in ''reverse'' function does the same thing.)<br /> &lt;syntaxhighlight lang=Lisp&gt;<br /> (defun -reverse (list)<br /> (let ((return-value '()))<br /> (dolist (e list) (push e return-value))<br /> return-value))<br /> &lt;/syntaxhighlight&gt;<br /> <br /> ==Object systems==<br /> Various object systems and models have been built on top of, alongside, or into Lisp, including:<br /> *The [[Common Lisp Object System]], CLOS, is an integral part of ANSI Common Lisp. CLOS descended from New Flavors and CommonLOOPS. ANSI Common Lisp was the first standardized object-oriented programming language (1994, ANSI X3J13).<br /> *ObjectLisp&lt;ref&gt;pg 17 of Bobrow 1986&lt;/ref&gt; or [[Object Lisp]], used by [[Lisp Machines Incorporated]] and early versions of Macintosh Common Lisp<br /> *LOOPS (Lisp Object-Oriented Programming System) and the later [[CommonLOOPS]]<br /> *[[Flavors (computer science)|Flavors]], built at [[Massachusetts Institute of Technology|MIT]], and its descendant New Flavors (developed by [[Symbolics]]).<br /> *KR (short for Knowledge Representation), a [[Constraint satisfaction|constraint]]s-based object system developed to aid the writing of Garnet, a GUI library for [[Common Lisp]].<br /> *[[Knowledge Engineering Environment|KEE]] used an object system called UNITS and integrated it with an [[inference engine]]&lt;ref&gt;Veitch, p 108, 1988&lt;/ref&gt; and a [[Truth maintenance systems|truth maintenance system]] (ATMS).<br /> <br /> ==See also==<br /> *[[Fexpr]]<br /> *[[Maxima (software)|Maxima]]<br /> *[[mod_lisp]]<br /> *[[P convention]]<br /> *[[Prolog]]<br /> *[[LFE (programming language)|LFE (Lisp Flavored Erlang)]]<br /> *[[MATHLAB]]<br /> <br /> ==References==<br /> {{Reflist|30em}}<br /> <br /> ==Further reading==<br /> {{Refbegin}}<br /> *{{cite web<br /> | last = McCarthy<br /> | first = John<br /> | authorlink =<br /> | title = The implementation of Lisp<br /> | work = History of Lisp<br /> | publisher = Stanford University<br /> | date = 1979-02-12<br /> | url = http://www-formal.stanford.edu/jmc/history/lisp/node3.html<br /> | doi =<br /> | accessdate = 2008-10-17}}<br /> *{{Cite conference<br /> | first = Guy L.<br /> | last = Steele, Jr.<br /> | authorlink =<br /> |author2=Richard P. Gabriel<br /> | title = The evolution of Lisp<br /> | conference = The second ACM SIGPLAN conference on History of programming languages<br /> | pages = 231–270<br /> | publisher = ACM<br /> | year = 1993<br /> | location = New York, NY<br /> | url = http://www.dreamsongs.com/NewFiles/HOPL2-Uncut.pdf<br /> | doi =<br /> | id =<br /> | isbn = 0-89791-570-4<br /> | accessdate = 2008-10-17}}<br /> *{{Cite book<br /> | first = Jim<br /> | last = Veitch<br /> | author-link =<br /> | author2-link =<br /> | editor-last = Salus<br /> | editor-first = Peter H<br /> | editor2-last =<br /> | editor2-first =<br /> | contribution = A history and description of CLOS<br /> | contribution-url =<br /> | title = Handbook of programming languages<br /> | volume = Volume IV, Functional and logic programming languages<br /> | edition = first<br /> | year = 1998<br /> | pages = 107–158<br /> | place = Indianapolis, IN<br /> | publisher = Macmillan Technical Publishing<br /> | url =<br /> | doi =<br /> | id =<br /> | isbn = 1-57870-011-6<br /> | postscript = &lt;!--None--&gt; }}<br /> *{{Cite book<br /> |title= [[Structure and Interpretation of Computer Programs]]<br /> |first= Harold<br /> |last= Abelson<br /> |author-link= Harold Abelson<br /> |first2= Gerald Jay<br /> |last2= Sussman<br /> |author2-link= Gerald Jay Sussman<br /> |first3= Julie<br /> |last3= Sussman<br /> |author3-link= Julie Sussman<br /> |year= 1996<br /> |edition= 2nd<br /> |publisher= MIT Press<br /> |isbn= 0-262-01153-0<br /> |doi= }}<br /> *[https://www.gnu.org/gnu/rms-lisp.html My Lisp Experiences and the Development of GNU Emacs], [[transcription (linguistics)|transcript]] of [[Richard Stallman]]'s speech, 28 October 2002, at the [[International Lisp Conference]]<br /> *{{Cite book<br /> |first= Paul<br /> |last= Graham<br /> |author-link= Paul Graham (computer programmer)<br /> |title= [[Hackers &amp; Painters| Hackers &amp; Painters. Big Ideas from the Computer Age]]<br /> |year= 2004<br /> |publisher= O'Reilly<br /> |isbn= 0-596-00662-4<br /> |doi= }}<br /> *{{Cite book<br /> |editor-last= Berkeley<br /> |editor-first= Edmund C.<br /> |editor-link= Edmund Berkeley<br /> |editor2-last= Bobrow<br /> |editor2-first= Daniel G.<br /> |editor2-link= Daniel G. Bobrow<br /> |title= The Programming Language LISP: Its Operation and Applications<br /> |url= http://www.softwarepreservation.org/projects/LISP/book/III_LispBook_Apr66.pdf<br /> |date= March 1964<br /> |publisher= MIT Press<br /> |location= Cambridge, Massachusetts<br /> |isbn=<br /> |doi= }}<br /> *{{Cite book<br /> |last= Weissman<br /> |first= Clark<br /> |title= LISP 1.5 Primer<br /> |year= 1967<br /> |url= http://www.softwarepreservation.org/projects/LISP/book/Weismann_LISP1.5_Primer_1967.pdf<br /> |publisher= Dickenson Publishing Company Inc.<br /> |location= Belmont, California<br /> |isbn=<br /> |doi=}}<br /> {{Refend}}<br /> <br /> ==External links==<br /> {{Sister project links|wikt=Lisp|commons=Category:Lisp (programming language)|n=no|q=Lisp programming language|b=Subject:Lisp programming language|v=Topic:Lisp|s=Lambda Papers}}<br /> ;History<br /> *[http://www-formal.stanford.edu/jmc/history/lisp/lisp.html History of Lisp] – [[John McCarthy (computer scientist)|John McCarthy]]'s history of 12 February 1979<br /> *[http://www8.informatik.uni-erlangen.de/html/lisp-enter.html Lisp History]{{dead link|date=May 2013}} – Herbert Stoyan's history compiled from the documents (acknowledged by McCarthy as more complete than his own, see: [http://www-formal.stanford.edu/jmc/history/ McCarthy's history links])<br /> *[http://www.softwarepreservation.org/projects/LISP/ History of LISP at the Computer History Museum]<br /> <br /> ;Associations and meetings<br /> *[http://www.alu.org/ Association of Lisp Users]<br /> *[http://www.weitz.de/eclm2013/ European Common Lisp Meeting]<br /> *[http://european-lisp-symposium.org/ European Lisp Symposium]<br /> *[http://www.international-lisp-conference.org/ International Lisp Conference]<br /> <br /> ; Books and tutorials<br /> *''[http://www.lisperati.com/casting.html Casting SPELs in Lisp]'', a comic-book style introductory tutorial<br /> *''[http://paulgraham.com/onlisptext.html On Lisp]'', a free book by [[Paul Graham (computer programmer)|Paul Graham]]<br /> *''[http://www.gigamonkeys.com/book/ Practical Common Lisp]'', freeware edition by Peter Seibel<br /> * [https://leanpub.com/lispweb Lisp for the web]<br /> * [http://landoflisp.com/ Land of Lisp]<br /> * [http://letoverlambda.com/ Let over Lambda]<br /> <br /> ; Interviews<br /> *[http://purl.umn.edu/107476 Oral history interview with John McCarthy] at [[Charles Babbage Institute]], University of Minnesota, Minneapolis. McCarthy discusses his role in the development of time-sharing at the Massachusetts Institute of Technology. He also describes his work in artificial intelligence (AI) funded by the Advanced Research Projects Agency, including logic-based AI (LISP) and robotics.<br /> *[http://www.se-radio.net/2008/01/episode-84-dick-gabriel-on-lisp/ Interview] with [[Richard P. Gabriel]] (Podcast)<br /> <br /> ;Resources<br /> *[http://www.cliki.net/ CLiki: the common lisp wiki]<br /> *[http://www.cl-user.net/ Common Lisp directory]<br /> *[http://www.faqs.org/faqs/lisp-faq/ Lisp FAQ Index]<br /> *[http://paste.lisp.org/ lisppaste]<br /> *[http://planet.lisp.org/ Planet Lisp]<br /> *[http://lispnews.wordpress.com/ Weekly Lisp News]<br /> *{{dmoz|Computers/Programming/Languages/Lisp|Lisp}}<br /> <br /> {{John McCarthy navbox}}<br /> <br /> {{DEFAULTSORT:Lisp Programming Language}}<br /> [[Category:1958 in computer science]]<br /> [[Category:Academic programming languages]]<br /> [[Category:American inventions]]<br /> [[Category:Articles with example Lisp code]]<br /> [[Category:Dynamically typed programming languages]]<br /> [[Category:Functional languages]]<br /> [[Category:Lisp (programming language)| ]]<br /> [[Category:Lisp programming language family| ]]<br /> [[Category:Programming languages created in 1958]]<br /> [[Category:Programming languages created in the 1950s]]<br /> [[Category:Extensible syntax programming languages]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Continuation-passing_style&diff=676028331 Continuation-passing style 2015-08-14T05:51:25Z <p>PuercoPop: Citation needed</p> <hr /> <div>In [[functional programming]], '''continuation-passing style''' ('''CPS''') is a style of programming in which [[control flow|control]] is passed explicitly in the form of a [[continuation]]. This is contrasted with [[direct style]], which is the usual style of programming. [[Gerald Jay Sussman]] and [[Guy L. Steele, Jr.]] coined the phrase in [[AI Memo]] 349 (1975), which sets out the first version of the [[Scheme (programming language)|Scheme]] programming language.&lt;ref&gt;{{cite journal<br /> | author1-link = Gerald Jay Sussman | first1 = Gerald Jay | last1 = Sussman | author2-link = Guy L. Steele, Jr. | first2 = Guy L., Jr. | last2 = Steele<br /> |date=December 1975<br /> | title =[[wikisource:Scheme: An interpreter for extended lambda calculus|Scheme: An interpreter for extended lambda calculus]]<br /> | journal = [[AI Memo]]<br /> | volume = 349<br /> | page = 19<br /> | quote = That is, in this '''continuation-passing programming style''', ''a function always &quot;returns&quot; its result by &quot;sending&quot; it to another function''. This is the key idea.<br /> }}&lt;/ref&gt;&lt;ref&gt;{{cite journal<br /> | doi = 10.1023/A:1010035624696<br /> | author1-link = Gerald Jay Sussman | first1 = Gerald Jay | last1 = Sussman | author2-link = Guy L. Steele, Jr. | first2 = Guy L., Jr. | last2 = Steele<br /> |date=December 1998<br /> | title = Scheme: A Interpreter for Extended Lambda Calculus<br /> | url = http://www.brics.dk/~hosc/local/HOSC-11-4-pp405-439.pdf<br /> | format = reprint<br /> | journal = Higher-Order and Symbolic Computation<br /> | volume = 11<br /> | issue = 4<br /> | pages = 405–439<br /> | quote = We believe that this was the first occurrence of the term &quot;'''continuation-passing style'''&quot; in the literature. It has turned out to be an important concept in source code analysis and transformation for compilers and other metaprogramming tools. It has also inspired a set of other &quot;styles&quot; of program expression.<br /> }}&lt;/ref&gt;<br /> [[John C. Reynolds]] gives a detailed account of the numerous discoveries of continuations.&lt;ref&gt;{{cite journal<br /> | author1-link = John C. Reynolds | first1 = John C. | last1 = Reynolds<br /> | title = The Discoveries of Continuations<br /> | journal = Lisp and Symbolic Computation<br /> | volume = 6<br /> | number = 3-4<br /> | year = 1993<br /> | pages = 233–248<br /> | doi=10.1007/bf01019459<br /> }}<br /> &lt;/ref&gt;<br /> <br /> A function written in continuation-passing style takes an extra argument: an explicit &quot;continuation&quot; i.e. a function of one argument. When the CPS function has computed its result value, it &quot;returns&quot; it by calling the continuation function with this value as the argument. That means that when invoking a CPS function, the calling function is required to supply a procedure to be invoked with the subroutine's &quot;return&quot; value. Expressing code in this form makes a number of things explicit which are implicit in direct style. These include: procedure returns, which become apparent as calls to a continuation; intermediate values, which are all given names; order of argument evaluation, which is made explicit; and [[tail call]]s, which simply call a procedure with the same continuation, unmodified, that was passed to the caller.<br /> <br /> Programs can be automatically transformed from direct style to CPS. Functional and [[logic programming|logic]] compilers often use CPS as an [[intermediate representation]] where a compiler for an [[imperative programming|imperative]] or [[procedural programming|procedural]] [[programming language]] would use [[static single assignment form]] (SSA){{ citation needed }}. SSA is formally equivalent to a subset of CPS (excluding non-local control flow, which does not occur when CPS is used as intermediate representation).&lt;ref name=&quot;Kelsey1995&quot;&gt;* {{cite journal | first = Richard A. | last = Kelsey | title=A Correspondence between Continuation Passing Style and Static Single Assignment Form | journal=ACM SIGPLAN Notices |date=March 1995 | volume=30 | issue=3 | pages=13–22 | doi=10.1145/202530.202532}}&lt;/ref&gt; Functional compilers can also use [[A-normal form]] (ANF) (but only for languages requiring eager evaluation), rather than with '[[thunk (delayed computation) |thunks]]' (described in the examples below) in CPS. CPS is used more frequently by [[compiler]]s than by programmers as a local or global style.<br /> <br /> ==Examples==<br /> In CPS, each procedure takes an extra argument representing what should be done with the result the function is calculating. This, along with a restrictive style prohibiting a variety of constructs usually available, is used to expose the semantics of programs, making them easier to analyze. This style also makes it easy to express unusual control structures, like catch/throw or other non-local transfers of control.<br /> <br /> The key to CPS is to remember that (a) ''every'' function takes an extra argument, its continuation, and (b) every argument in a function call must be either a variable or a [[Lambda (programming)|lambda expression]] (not a more complex expression). This has the effect of turning expressions &quot;inside-out&quot; because the innermost parts of the expression must be evaluated first, so CPS explicates the order of evaluation as well as the control flow. Some examples of code in direct style and the corresponding CPS appear below. These examples are written in the [[Scheme (programming language)|Scheme programming language]]; by convention the continuation function is represented as a parameter named &quot;&lt;code&gt;k&lt;/code&gt;&quot;:<br /> {|<br /> !&lt;center&gt;Direct style&lt;/center&gt;!!&lt;center&gt;Continuation passing style&lt;/center&gt;<br /> |-valign=&quot;top&quot;<br /> |&lt;source lang=scheme&gt;<br /> (define (pyth x y)<br /> (sqrt (+ (* x x) (* y y))))&lt;/source&gt;<br /> ||<br /> &lt;source lang=scheme&gt;<br /> (define (pyth&amp; x y k)<br /> (*&amp; x x (lambda (x2)<br /> (*&amp; y y (lambda (y2)<br /> (+&amp; x2 y2 (lambda (x2py2)<br /> (sqrt&amp; x2py2 k))))))))<br /> &lt;/source&gt;<br /> |-valign=&quot;top&quot;<br /> |<br /> &lt;source lang=scheme&gt;<br /> (define (factorial n)<br /> (if (= n 0)<br /> 1 ; NOT tail-recursive<br /> (* n (factorial (- n 1)))))<br /> &lt;/source&gt;<br /> ||<br /> &lt;source lang=scheme&gt;<br /> <br /> (define (factorial&amp; n k)<br /> (=&amp; n 0 (lambda (b)<br /> (if b ; growing continuation<br /> (k 1) ; in the recursive call<br /> (-&amp; n 1 (lambda (nm1)<br /> (factorial&amp; nm1 (lambda (f)<br /> (*&amp; n f k)))))))))<br /> &lt;/source&gt;<br /> |-valign=&quot;top&quot;<br /> |<br /> &lt;source lang=scheme&gt;<br /> (define (factorial n)<br /> (f-aux n 1))<br /> (define (f-aux n a)<br /> (if (= n 0)<br /> a ; tail-recursive<br /> (f-aux (- n 1) (* n a))))<br /> &lt;/source&gt;<br /> ||<br /> &lt;source lang=scheme&gt;<br /> (define (factorial&amp; n k) (f-aux&amp; n 1 k))<br /> (define (f-aux&amp; n a k)<br /> (=&amp; n 0 (lambda (b)<br /> (if b ; unmodified continuation<br /> (k a) ; in the recursive call<br /> (-&amp; n 1 (lambda (nm1) <br /> (*&amp; n a (lambda (nta)<br /> (f-aux&amp; nm1 nta k)))))))))<br /> &lt;/source&gt;<br /> |}<br /> <br /> Note that in the CPS versions, the primitives used, like &lt;code&gt;+&amp;&lt;/code&gt; and &lt;code&gt;*&amp;&lt;/code&gt; are themselves CPS, not direct style, so to make the above examples work in a Scheme system we would need to write these CPS versions of primitives, with for instance &lt;code&gt;*&amp;&lt;/code&gt; defined by:<br /> &lt;source lang=scheme&gt;<br /> (define (*&amp; x y k)<br /> (k (* x y)))<br /> &lt;/source&gt; To do this in general, we might write a conversion routine:<br /> &lt;source lang=scheme&gt;<br /> (define (cps-prim f)<br /> (lambda args<br /> (let ((r (reverse args)))<br /> ((car r) (apply f<br /> (reverse (cdr r)))))))<br /> (define *&amp; (cps-prim *))<br /> (define +&amp; (cps-prim +))&lt;/source&gt;<br /> <br /> In order to call a procedure written in CPS from a procedure written in direct style, it is necessary to provide a continuation that will receive the result computed by the CPS procedure. In the example above (assuming that CPS-style primitives have been provided), we might call &lt;code&gt;(factorial&amp; 10 (lambda (x) (display x) (newline)))&lt;/code&gt;.<br /> <br /> There is some variety between compilers in the way primitive functions are provided in CPS. Above we have used the simplest convention, however sometimes boolean primitives are provided that take two [[Thunk (delayed computation)|thunks]] to be called in the two possible cases, so the &lt;code&gt;(=&amp; n 0 (lambda (b) (if b ...)))&lt;/code&gt; call inside &lt;code&gt;f-aux&amp;&lt;/code&gt; definition above would be written instead as &lt;code&gt;(=&amp; n 0 (lambda () (k a)) (lambda () (-&amp; n 1 ...)))&lt;/code&gt;. Similarly, sometimes the &lt;code&gt;if&lt;/code&gt; primitive itself is not included in CPS, and instead a function &lt;code&gt;if&amp;&lt;/code&gt; is provided which takes three arguments: a boolean condition and the two thunks corresponding to the two arms of the conditional.<br /> <br /> The translations shown above show that CPS is a global transformation. The direct-style ''factorial'' takes, as might be expected, a single argument; the CPS ''factorial&amp;'' takes two: the argument and a continuation. Any function calling a CPS-ed function must either provide a new continuation or pass its own; any calls from a CPS-ed function to a non-CPS function will use implicit continuations. Thus, to ensure the total absence of a function stack, the entire program must be in CPS.<br /> <br /> ===Continuations as objects===<br /> {{See also|Callback (computer programming)}}<br /> <br /> Programming with continuations can also be useful when a caller does not want to wait until the callee completes. For example, in user-interface (UI) programming, a routine can set up dialog box fields and pass these, along with a continuation function, to the UI framework. This call returns right away, allowing the application code to continue while the user interacts with the dialog box. Once the user presses the &quot;OK&quot; button, the framework calls the continuation function with the updated fields. Although this style of coding uses continuations, it is not full CPS.<br /> <br /> &lt;source lang=javascript&gt;<br /> function confirmName() {<br /> fields.name = name;<br /> framework.Show_dialog_box(fields, confirmNameContinuation);<br /> }<br /> <br /> function confirmNameContinuation(fields) {<br /> name = fields.name;<br /> }<br /> &lt;/source&gt;<br /> A similar idea can be used when the function must run in a different thread or on a different processor. The framework can execute the called function in a worker thread, then call the continuation function in the original thread with the worker's results. This is in [[Java (programming language)|Java]] using the [[Swing (Java)|Swing]] UI framework:<br /> <br /> &lt;source lang=java&gt;<br /> void buttonHandler() {<br /> // This is executing in the Swing UI thread.<br /> // We can access UI widgets here to get query parameters.<br /> final int parameter = getField();<br /> <br /> new Thread(new Runnable() {<br /> public void run() {<br /> // This code runs in a separate thread.<br /> // We can do things like access a database or a <br /> // blocking resource like the network to get data.<br /> final int result = lookup(parameter);<br /> <br /> javax.swing.SwingUtilities.invokeLater(new Runnable() {<br /> public void run() {<br /> // This code runs in the UI thread and can use<br /> // the fetched data to fill in UI widgets.<br /> setField(result);<br /> }<br /> });<br /> }<br /> }).start();<br /> }<br /> &lt;/source&gt;<br /> <br /> Using Java 8 lambda notation above code shortens to (&lt;code&gt;final&lt;/code&gt; keyword might be skipped):<br /> &lt;source lang=java&gt;<br /> void buttonHandler() {<br /> int parameter = getField();<br /> <br /> new Thread(() -&gt; {<br /> final int result = lookup(parameter);<br /> javax.swing.SwingUtilities.invokeLater(() -&gt; setField(result));<br /> }).start();<br /> }<br /> &lt;/source&gt;<br /> <br /> ==CPS and tail calls==<br /> Note that in CPS, there is no implicit continuation—every call is a [[tail call]]. There is no &quot;magic&quot; here, as the continuation is simply explicitly passed. Using CPS without [[tail call optimization]] (TCO) will cause not only the constructed continuation to potentially grow during recursion, but also the [[call stack]]. This is usually undesirable, but has been used in interesting ways - see the [[Chicken (Scheme implementation)|Chicken Scheme]] compiler. As CPS and TCO eliminate the concept of an implicit function return, their combined use can eliminate the need for a run-time stack. Several compilers and interpreters for [[functional programming language]]s use this ability in novel ways.&lt;ref&gt;Appel, Andrew W. (1992). Compiling with Continuations. Cambridge University Press. ISBN 0-521-41695-7.&lt;/ref&gt;<br /> <br /> ==Use and implementation==<br /> Continuation passing style can be used to implement continuations and control flow operators in a functional language that does not feature first-class [[continuations]] but does have [[first-class function]]s and [[tail-call optimization]]. Without tail-call optimization, techniques such as [[trampoline (computers)|trampolining]], i.e. using a loop that iteratively invokes [[Thunk (functional programming)|thunk]]-returning functions, can be used; without first-class functions, it is even possible to convert tail calls into just gotos in such a loop.<br /> <br /> Writing code in CPS, while not impossible, is often error-prone. There are various translations, usually defined as one- or two-pass conversions of pure [[lambda calculus]], which convert direct style expressions into CPS expressions. Writing in trampolined style, however, is extremely difficult; when used, it is usually the target of some sort of transformation, such as [[compiler|compilation]].<br /> <br /> Functions using more than one continuation can be defined to capture various control flow paradigms, for example (in [[Scheme (programming language)|Scheme]]):<br /> &lt;source lang=scheme&gt;<br /> (define (/&amp; x y ok err)<br /> (=&amp; y 0.0 (lambda (b)<br /> (if b<br /> (err (list &quot;div by zero!&quot; x y))<br /> (ok (/ x y))))))<br /> &lt;/source&gt;<br /> <br /> It is of note that CPS transform is conceptually a [[Yoneda embedding]].&lt;ref&gt;Mike Stay, [http://golem.ph.utexas.edu/category/2008/01/the_continuation_passing_trans.html &quot;The Continuation Passing Transform and the Yoneda Embedding&quot;]&lt;/ref&gt; It is also similar to the embedding of [[π-calculus]] in [[lambda calculus]].&lt;ref&gt;Mike Stay, [http://golem.ph.utexas.edu/category/2009/09/the_pi_calculus_ii.html &quot;The Pi Calculus II&quot;]&lt;/ref&gt;&lt;ref&gt;{{cite paper | first = Gérard | last = Boudol | id = {{citeseerx|10.1.1.52.6034}} | title = The π-Calculus in Direct Style }}&lt;/ref&gt;<br /> <br /> ==Use in other fields==<br /> Outside of [[computer science]], CPS is of more general interest as an alternative to the conventional method of composing simple expressions into complex expressions. For example, within linguistic [[semantics]], Chris Barker and his collaborators have suggested that specifying the denotations of sentences using CPS might explain certain phenomena in [[natural language]]. [http://www.semanticsarchive.net/Archive/902ad5f7/barker.continuations.pdf]<br /> <br /> In [[mathematics]], the [[Curry–Howard isomorphism]] between computer programs and mathematical proofs relates continuation-passing style translation to a variation of double-negation [[embedding]]s of [[classical logic]] into [[intuitionistic logic|intuitionistic (constructive) logic]]. Unlike the regular [[double-negation translation]], which maps atomic propositions ''p'' to ((''p'' → ⊥) → ⊥), the continuation passing style replaces ⊥ by the type of the final expression. Accordingly, the result is obtained by passing the [[identity function]] as a continuation to the CPS-style expression, as in the above example.<br /> <br /> Classical logic itself relates to manipulating the continuation of programs directly, as in Scheme's [[call-with-current-continuation]] control operator, an observation due to Tim Griffin (using the closely related C control operator).&lt;ref&gt;{{cite journal<br /> | first = Timothy | last = Griffin.<br /> |date=January 1990<br /> | title = A formulae-as-type notion of control<br /> | journal = Proceedings of the Conference on the Principles of Programming Languages<br /> | volume = 17<br /> | pages = 47–58<br /> | doi=10.1145/96709.96714<br /> }}&lt;/ref&gt;<br /> <br /> ==See also==<br /> *[[Tail recursion#Through trampolining|Tail recursion through trampolining]]<br /> <br /> ==References==<br /> *Continuation Passing C (CPC) - [http://www.pps.univ-paris-diderot.fr/~kerneis/software/ programming language for writing concurrent systems], designed and developed by Juliusz Chroboczek and Gabriel Kerneis. [https://github.com/kerneis/cpc github repository]<br /> *The construction of a CPS-based compiler for [[ML programming language|ML]] is described in: {{cite book | last = Appel | first = Andrew W. | title=Compiling with Continuations | publisher=Cambridge University Press | year=1992 | isbn=0-521-41695-7 | url = http://books.google.com/books?id=0Uoecu9ju4AC&amp;dq | authorlink= Andrew Appel}}<br /> *{{cite journal | doi=10.1017/S0960129500001535 | author1-link = Olivier Danvy | first1 = Olivier | last1 = Danvy | author2-link = Andrzej Filinski | first2 = Andrzej | last2 = Filinski | title=Representing Control, A Study of the CPS Transformation | journal=Mathematical Structures in Computer Science | volume=2 | issue=4 | pages=361–391 | year=1992 | id = {{citeseerx|10.1.1.46.84}} }}<br /> *[[Chicken Scheme compiler]], a [[Scheme (programming language)|Scheme]] to [[C (programming language)|C]] compiler that uses continuation-passing style for translating Scheme procedures into C functions while using the C-stack as the nursery for the [[Garbage collection (computer science)#Generational GC (aka Ephemeral GC)|generational garbage collector]]<br /> *{{cite journal | first = Richard A. | last = Kelsey | title=A Correspondence between Continuation Passing Style and Static Single Assignment Form | journal=ACM SIGPLAN Notices |date=March 1995 | volume=30 | issue=3 | pages=13–22 | doi=10.1145/202530.202532 |id = {{citeseerx|10.1.1.3.6773}} }}<br /> *{{cite journal | first = Andrew W. | last = Appel | title=SSA is Functional Programming | journal=ACM SIGPLAN Notices |date=April 1998 | volume=33 | issue=4 | pages=17–20 | doi=10.1145/278283.278285 | url = http://www.cs.princeton.edu/~appel/papers/ssafun.ps | authorlink= Andrew Appel}}<br /> *{{Cite web | first = Olivier | last = Danvy | first2 = Kevin | last2 = Millikin | first3 = Lasse R. | last3 = Nielsen | title = On One-Pass CPS Transformations | year = 2007 | pages = 24 | location = BRICS, Department of Computer Science, University of Aarhus | url = http://www.brics.dk/RS/07/6/ | id = RS-07-6 | issn = 0909-0878 | postscript = &lt;!--None--&gt; | accessdate=26 October 2007}}<br /> *{{cite book | authorlink = R. Kent Dybvig | first = R. Kent | last = Dybvig | title=The Scheme Programming Language | publisher=Prentice Hall | year=2003 | page=64 | url=http://www.scheme.com/tspl3/}} Direct link: [http://scheme.com/tspl3/further.html#./further:h4 &quot;Section 3.4. Continuation Passing Style&quot;].<br /> <br /> ==Notes==<br /> {{Reflist}}<br /> <br /> {{DEFAULTSORT:Continuation-Passing Style}}<br /> [[Category:Continuations]]<br /> [[Category:Functional programming]]<br /> [[Category:Implementation of functional programming languages]]<br /> [[Category:Articles with example Scheme code]]<br /> [[Category:Articles with example Java code]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Patty_Wong&diff=674421884 Patty Wong 2015-08-03T20:41:22Z <p>PuercoPop: Remove the ex from previous occupations</p> <hr /> <div>{{Infobox person<br /> | name = Patty Wong<br /> | image = &lt;!-- just the name, without the File: or Image: prefix or enclosing [[brackets]] --&gt;<br /> | image_size = <br /> | alt = <br /> | caption = <br /> | birth_name = <br /> | birth_date = {{Birth date and age|1980|10|29|mf=yes}}<br /> | birth_place = Lima, Peru<br /> | death_date = &lt;!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (death date then birth date) --&gt;<br /> | death_place = <br /> | nationality = <br /> | ethnicity = &lt;!-- Ethnicity should be supported with a citation from a reliable source --&gt;<br /> | citizenship = <br /> | education = <br /> | alma_mater = <br /> | occupation = [[Businesswoman]], [[Television presenter|TV presenter]], [[Model (profession)|model]]<br /> | religion = &lt;!-- Religion should be supported with a citation from a reliable source --&gt;<br /> | denomination = &lt;!-- Denomination should be supported with a citation from a reliable source --&gt;<br /> | criminal_charge = &lt;!-- Criminality parameters should be supported with citations from reliable sources --&gt;<br /> | criminal_penalty = <br /> | criminal_status = <br /> | spouse = {{ubl|{{marriage|Paolo Arroyo|2009|2010|reason=divorced}}}}<br /> | partner = &lt;!-- unmarried life partner; use ''Name (1950–present)'' --&gt;<br /> | children = Ariatna Guadalupe (b. 2005)<br /> | parents = <br /> | relatives = <br /> | awards = Miss Perú Tusán (2001)<br /> }}<br /> '''Patty Wong''' (born October 29, 1980 in [[Lima]], [[Peru]]) is a Peruvian model. She formerly co-hosted a popular youth-oriented Peruvian show called ''R con R''. She also won in &quot;Miss Perú Tusan,&quot; a beauty contest for [[Chinese Peruvian|Peruvian-Chinese]] girls, like her. She also co-hosts a Peruvian television show in the singing talent contest format, called ''Camino a la fama''. She was also the host of the cancelled children's show Zoombate along with Cati Caballero as co-host, another famous Peruvian model that started her career in ''R con R''.<br /> <br /> ==External links==<br /> *{{es icon}} [http://www.perumodelos.net/modelos/105/ Information and Photos]<br /> <br /> {{Persondata &lt;!-- Metadata: see [[Wikipedia:Persondata]]. --&gt;<br /> | NAME = Wong-wong, Patty<br /> | ALTERNATIVE NAMES =<br /> | SHORT DESCRIPTION = Peruvian model<br /> | DATE OF BIRTH = October 29, 1980<br /> | PLACE OF BIRTH = Lima, Peru<br /> | DATE OF DEATH =<br /> | PLACE OF DEATH =<br /> }}<br /> {{DEFAULTSORT:Wong-wong, Patty}}<br /> [[Category:Peruvian people]]<br /> [[Category:People from Lima]]<br /> [[Category:Peruvian women in business]]<br /> [[Category:Peruvian people of Chinese descent]]<br /> [[Category:Peruvian television presenters]]<br /> [[Category:Peruvian female models]]<br /> [[Category:1980 births]]<br /> [[Category:Living people]]<br /> <br /> <br /> {{peru-bio-stub}}</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Moira_Kelly&diff=672393882 Moira Kelly 2015-07-21T07:56:20Z <p>PuercoPop: /* Filmography */ properly disambiguate little odessa to film entry</p> <hr /> <div>{{About|the American actress|the Australian humanitarian|Moira Kelly (humanitarian)}}<br /> <br /> {{BLP sources|date=June 2012}}<br /> <br /> {{Infobox person<br /> | image = &lt;!-- only free-content images are allowed for depicting living people. Non-free and &quot;fair use&quot; images, e.g. promo photos, CD/DVD covers, posters, screen captures, etc., will be deleted - see [[WP:NONFREE]] --&gt; |<br /> | imagesize =<br /> | name = Moira Kelly<br /> | birth_date = {{birth date and age|mf=yes|1968|3|6}}<br /> | birth_name =<br /> | birth_place = [[Queens]], [[New York City|New York]], [[United States|U.S.]]<br /> | occupation = Actress<br /> | yearsactive = 1991–present<br /> | height = 5'4&quot; (1.62 m)&lt;ref&gt;http://www.imdb.com/name/nm0446702/&lt;/ref&gt;<br /> | spouse = Steve Hewitt (2000–present; 2 children)<br /> | children = Ella (b. 2001)&lt;br&gt;Eamon (b. 2003)<br /> }}<br /> '''Moira Kelly''' (born March 6, 1968) is an American actress. She played Dorothy Day in ''[[Entertaining Angels: The Dorothy Day Story]]'', Kate Moseley in the 1992 film ''[[The Cutting Edge]]'', as well as single mother [[List of One Tree Hill characters#Karen Roe|Karen Roe]] on the [[teen drama]] ''[[One Tree Hill (TV series)|One Tree Hill]]'', White House media consultant [[Mandy Hampton]] in the first season of ''[[The West Wing]]'', and the voice of Simba's love interest Nala in ''[[The Lion King]]'' and its sequel ''[[The Lion King II: Simba's Pride]]''.<br /> <br /> ==Early life==<br /> Kelly was born in [[Queens, New York]], the daughter of Irish immigrants. Her father, Peter, was trained as a concert violinist, and her mother, Anne, is a nurse. Kelly is the third of six children and was raised in [[Ronkonkoma, New York|Ronkonkoma]]. She was brought up as a Catholic.&lt;ref&gt;{{cite news|url=http://www.nytimes.com/1993/01/03/movies/up-coming-moira-kelly-playing-two-roles-chaplin-while-dreaming-joan-arc.html?pagewanted=1|title=Moira Kelly; Playing Two Roles in 'Chaplin' While Dreaming of Joan of Arc|publisher=[[The New York Times]]|work=|date=1993-01-03|quote = She is an ardent Roman Catholic...|accessdate=2010-05-20|first=Jeff|last=Giles}}&lt;/ref&gt; Kelly attended [[Connetquot High School|Connetquot Senior High School]] in [[Bohemia, New York|Bohemia, Long Island]], graduating in the class of 1986. Later she attended [[Marymount Manhattan College]].<br /> <br /> In her youth, Kelly was cast in a small role in her high school's 1984 production of ''[[Annie (musical)|Annie]]''. Due to illness, the girl playing Miss Hannigan was replaced, causing a series of cast changes leading to her choice of career. A faithful Catholic, Kelly had to decide between acting and her childhood ambition of becoming a [[nun]].&lt;ref name=&quot;Allmovie&quot;&gt;{{Cite web<br /> | last = Buchanan<br /> | first = Jason<br /> | title = Moira Kelly &gt; Biography<br /> | work = [[Allmovie]]<br /> | publisher = [[Rovi Corporation]]<br /> | url = http://www.allmovie.com/artist/moira-kelly-37546/bio<br /> | accessdate = 2010-01-08}}&lt;/ref&gt;<br /> <br /> ==Career==<br /> Kelly made her professional acting debut in the made-for-TV movie ''[[Love, Lies and Murder]]'', playing a teenage murderer. She went on to have small roles in the films ''[[The Boy Who Cried Bitch]]'' and ''[[Billy Bathgate]]'' before being cast as [[Donna Hayward]] in ''[[Twin Peaks: Fire Walk with Me]]''. For that film, she went home and got permission from her priest because of an explicit sex scene.&lt;ref name=&quot;Allmovie&quot; /&gt; In the same year, she starred opposite [[D. B. Sweeney]] in the romantic comedy ''[[The Cutting Edge]]'' and played two roles opposite [[Robert Downey, Jr.]] in ''[[Chaplin (film)|Chaplin]]''. According to a ''[[TV Guide (magazine)|TV Guide]]'' interview, before taking on her role in ''Daybreak'', Kelly once again asked her priest for advice: &quot;Being a Catholic, I wondered if it would be against my religion to play a girl who has premarital sex.&quot; The priest told her &quot;it was okay, as long as my artistic intentions were true and I wasn't doing it for the notoriety or the money.&quot;&lt;ref&gt;[http://www.catholic.com/thisrock/1993/9302drag.asp &quot;A Message from Marrs&quot;.] ''This Rock''. February 1993.&lt;/ref&gt;<br /> <br /> She has since appeared in the movies ''[[With Honors (film)|With Honors]]'', ''[[Little Odessa]]'', ''The Tie That Binds'' and ''[[Dangerous Beauty]]'' amongst others, and provided the adult voice of [[List of The Lion King characters|Nala]] in [[Disney]]'s ''[[The Lion King]]'', ''[[The Lion King II: Simba's Pride]]'', and ''[[The Lion King 1½]]''. In her independent film career, Kelly had the starring role of activist [[Dorothy Day]] in ''[[Entertaining Angels: The Dorothy Day Story]]'' and starred alongside [[Glenn Close]] in ''[[The Safety of Objects]]''. She played [[Helen Keller]] in the made-for-TV movie ''Monday After the Miracle'', which broadcast on November 15, 1998, on [[CBS]].<br /> <br /> Kelly starred in the CBS drama ''[[To Have &amp; to Hold (TV series)|To Have &amp; to Hold]]'' opposite [[Jason Beghe]] before playing [[Mandy Hampton]] in the first season of ''[[The West Wing]]''. In 2003, Kelly began playing single mother [[Karen Roe]] on the [[teen drama]] ''[[One Tree Hill (TV series)|One Tree Hill]]''. She also directed two episodes of the series: &quot;Resolve&quot; (2007) and &quot;I Slept with Someone in Fall Out Boy and All I Got Was This Stupid Song Written About Me&quot; (2006).{{Citation needed|date=April 2011}} In the fifth season, she ceased to be a regular cast member, but made guest appearances in the 100th episode and the sixth season finale. She has made guest appearances in television shows such as ''[[Heroes (TV series)|Heroes]]'', ''[[Law &amp; Order]]'', and ''[[Numbers (TV series)|Numb3rs]]''. Kelly has also appeared in the films ''[[Remember the Daze]]'', ''[[A Smile as Big as the Moon]]'' and ''Taken Back: Finding Haley''.<br /> <br /> ==Personal life==<br /> In 2000, Moira Kelly married Steve Hewitt, a Texas businessman. They have two children, Ella and Eamon.&lt;ref&gt;http://www.tvguide.com/celebrities/moira-kelly/bio/167050&lt;/ref&gt;<br /> <br /> ==Filmography==<br /> {|class=&quot;wikitable&quot; style=&quot;font-size: 95%;&quot; border=&quot;2&quot; cellpadding=&quot;4&quot; background: #f9f9f9;<br /> |- align=&quot;center&quot;<br /> ! style=&quot;background:#B0C4DE;&quot; | Year<br /> ! style=&quot;background:#B0C4DE;&quot; | Title<br /> ! style=&quot;background:#B0C4DE;&quot; | Role<br /> ! style=&quot;background:#B0C4DE;&quot; | Notes<br /> |-<br /> | rowspan = &quot;3&quot; | 1991 || ''[[The Boy Who Cried Bitch]]'' || Jessica ||<br /> |-<br /> | ''[[Love, Lies and Murder]]'' || Cinnamon || TV movie<br /> |-<br /> | ''[[Billy Bathgate (film)|Billy Bathgate]]'' || Rebecca ||<br /> |-<br /> | rowspan = &quot;3&quot; | 1992 ||''[[Twin Peaks: Fire Walk with Me]]'' || [[Donna Hayward]] ||<br /> |-<br /> | ''[[The Cutting Edge]]'' || Kate Moseley ||<br /> |-<br /> | ''[[Chaplin (film)|Chaplin]]'' || Hetty Kelly / [[Oona O'Neill]] ||<br /> |-<br /> | 1993 || ''[[Daybreak (1993 film)|Daybreak]]'' || Blue || TV Movie<br /> |-<br /> | rowspan=&quot;2&quot; | 1994 || ''[[The Lion King]]'' || Adult [[Nala (The Lion King)|Nala]] || Voice Only<br /> |-<br /> | ''[[With Honors (film)|With Honors]]'' || Courtney Blumenthal ||<br /> |-<br /> | 1995 || ''[[Little Odessa (film)|Little Odessa]]'' || Alla Shustervich ||<br /> |-<br /> | rowspan=&quot;2&quot; | 1996 || ''[[Unhook the Stars]]'' || Ann Mary Margaret ||<br /> |-<br /> | ''[[Entertaining Angels: The Dorothy Day Story]]'' || [[Dorothy Day]] ||<br /> |-<br /> | 1997 || ''[[Drive, She Said]]'' || Nadine Ship ||<br /> |-<br /> | rowspan=4 | 1998 || ''[[To Have &amp; to Hold (TV series)|To Have &amp; to Hold]]'' || Annie Cornell || TV Series: 13 Episodes<br /> |-<br /> | ''[[Love Walked In (1997 film)|Love Walked In]]'' || Vera ||<br /> |-<br /> | ''[[The Lion King II: Simba's Pride]]'' || Nala || Voice Only<br /> |-<br /> | ''[[Dangerous Beauty]]'' || Beatrice ||<br /> |-<br /> |1999–2000 || ''[[The West Wing]]'' || [[Mandy Hampton]] || TV Series: 22 Episodes<br /> |-<br /> | 1999 || ''[[Henry Hill (film)|Henry Hill]]'' || Cynthia ||<br /> |-<br /> | rowspan=2| 2002 || ''[[The Twilight Zone (2002 TV series)|The Twilight Zone]]'' || Elizabeth Carter / Bess Wicker || TV Series: Episode: &quot;[[Found and Lost]]&quot;<br /> |-<br /> | ''[[Hack (TV series)|Hack]]'' || Vanessa Griffin || TV Series: 1 Episode<br /> |-<br /> | 2003 || ''[[The Safety of Objects]]'' || Susan Train ||<br /> |-<br /> | 2003–2009 || ''[[One Tree Hill (TV series)|One Tree Hill]]'' || [[Karen Roe]] || TV Series: 90 Episodes<br /> |-<br /> | 2004 || ''[[The Lion King 1½]]'' || Adult Nala || Voice Only<br /> |-<br /> | 2006 || ''[[Two Tickets to Paradise (film)|Two Tickets to Paradise]]'' || Kate ||<br /> |-<br /> | 2007 || ''[[Remember The Daze]]'' || Mrs. Ford || Alternative Title: ''The Beautiful Ordinary''<br /> |-<br /> | 2008 || ''[[Law &amp; Order]]'' || Catherine Donovan || TV Series: 1 Episode<br /> |-<br /> | 2009 || ''[[Heroes (TV series)|Heroes]]'' || Abby Collins || TV Series: 1 Episode<br /> |-<br /> | 2010 || ''[[Numbers (TV series)|Numb3rs]]'' || Mary Paulson || TV Series: 1 Episode<br /> |-<br /> | rowspan=&quot;2&quot; | 2012 || ''[[A Smile as Big as the Moon]]'' || Darcy Kersjes || TV Movie<br /> |-<br /> | ''[[Taken Back: Finding Haley]]'' || Karen || TV Movie<br /> |-<br /> | 2013 || ''[[Drop Dead Diva]]'' || Cindy Kasper || TV Series: 1 Episode<br /> |}<br /> <br /> ==References==<br /> {{Reflist}}<br /> <br /> == External links ==<br /> * {{IMDb name|446702|Moira Kelly}}<br /> * [http://www.ultimatedisney.com/moirakelly-interview.html &quot;The Lion Queen&quot;: An Interview with Moira Kelly by Aaron Wallace at UltimateDisney.com]<br /> <br /> {{ScreenActorsGuildAwards EnsembleTVDrama 2000–2009}}<br /> <br /> {{Authority control}}<br /> <br /> {{Persondata<br /> |NAME= Kelly, Moira<br /> |ALTERNATIVE NAMES=<br /> |SHORT DESCRIPTION= [[Actor]]<br /> |DATE OF BIRTH= 1968-3-6<br /> |PLACE OF BIRTH= [[Queens]], [[New York]], [[United States|U.S.]]<br /> |DATE OF DEATH=<br /> |PLACE OF DEATH=<br /> }}<br /> {{DEFAULTSORT:Kelly, Moira}}<br /> [[Category:1968 births]]<br /> [[Category:American film actresses]]<br /> [[Category:American people of Irish descent]]<br /> [[Category:American Roman Catholics]]<br /> [[Category:American television actresses]]<br /> [[Category:American voice actresses]]<br /> [[Category:Living people]]<br /> [[Category:Marymount Manhattan College alumni]]<br /> [[Category:Actresses from New York City]]<br /> [[Category:20th-century American actresses]]<br /> [[Category:21st-century American actresses]]<br /> [[Category:People from Queens, New York]]<br /> [[Category:People from Ronkonkoma, New York]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Talk:Zo%C3%AB_Lund&diff=672344917 Talk:Zoë Lund 2015-07-20T23:12:46Z <p>PuercoPop: Remove vandalism</p> <hr /> <div>{{WPBiography<br /> |living=no<br /> |class=stub<br /> |musician-work-group=yes|musician-priority=low<br /> |filmbio-work-group=yes|filmbio-priority=low<br /> |listas=Tamerlis Lund, Zoe<br /> }}<br /> {{WikiProject Fashion<br /> |listas = Tamerlis Lund, Zoe<br /> |class = stub<br /> |importance = low<br /> }}<br /> {{WikiProject Women writers|importance=|class=stub|auto=stub}}<br /> <br /> ==Fair use rationale for Image:Zoe Lund as Thana in Ms. 45.jpg==<br /> [[Image:Nuvola apps important.svg|70px|left]]<br /> '''[[:Image:Zoe Lund as Thana in Ms. 45.jpg]]''' is being used on this article. I notice the image page specifies that the image is being used under [[Wikipedia:Fair use|fair use]] but there is no [[Wikipedia:Fair use rationale guideline|explanation or rationale]] as to why its use in '''this''' Wikipedia article constitutes fair use. In addition to the [[Wikipedia:Image copyright tags/Fair use|boilerplate fair use template]], you must also write out on the image description page a specific explanation or rationale for why using this image in each article is consistent with [[WP:FU|fair use]].<br /> <br /> Please go to [[:Image:Zoe Lund as Thana in Ms. 45.jpg|the image description page]] and edit it to include a [[Wikipedia:Fair use rationale guideline |fair use rationale]]. Using one of the templates at [[Wikipedia:Fair use rationale guideline]] is an easy way to insure that your image is in compliance with Wikipedia policy, but remember that you must complete the template. Do not simply insert a blank template on an image page.<br /> <br /> If there is other fair use media, consider checking that you have specified the fair use rationale on the other images used on this page. Note that any fair use images lacking such an explanation can be deleted one week after being tagged, as described on [[Wikipedia:Criteria for speedy deletion#Images.2FMedia|criteria for speedy deletion]]. If you have any questions please ask them at the [[Wikipedia:Media copyright questions|Media copyright questions page]]. Thank you.&lt;!-- Template:Missing rationale2 --&gt;<br /> <br /> [[User:BetacommandBot|BetacommandBot]] ([[User talk:BetacommandBot|talk]]) 03:19, 12 February 2008 (UTC)</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Arequipa&diff=668502229 Arequipa 2015-06-24T18:29:32Z <p>PuercoPop: /* Demographics */</p> <hr /> <div>{{about|the city of Arequipa}}<br /> {{cleanup|reason=horrifically bad direct translations|date=September 2014}}<br /> {{Infobox settlement<br /> |official_name = Arequipa<br /> |other_name =<br /> |native_name =<br /> |nickname = ''La Ciudad Blanca'' (The White City)<br /> |image_skyline =<br /> |imagesize = 250px<br /> |image_caption =<br /> |image_flag = Bandera_de_Arequipa.svg<br /> |flag_size =<br /> |image_shield = Escudo de Armas de Arequipa.svg<br /> |shield_size = 100px<br /> |image_blank_emblem =<br /> |blank_emblem_size =<br /> |image_map =<br /> |mapsize = <br /> |pushpin_map_caption = Location in Peru<br /> |pushpin_map = Peru<br /> |pushpin_label_position =<br /> |coordinates_region = PE<br /> |subdivision_type = Country<br /> |subdivision_name = [[Peru]]<br /> |subdivision_type1 = [[Regions of Peru|Region]]<br /> |subdivision_name1 = [[Arequipa Region|Arequipa]]<br /> |subdivision_type2 = [[Provinces of Peru|Province]]<br /> |subdivision_name2 = [[Arequipa Province|Arequipa]]<br /> |subdivision_type3 =<br /> |subdivision_name3 =<br /> |subdivision_type4 =<br /> |subdivision_name4 =<br /> |government_type =<br /> |leader_title = Mayor<br /> |leader_name = Alfredo Zegarra Tejada<br /> |leader_title1 = &lt;!-- for places with, say, both a mayor and a city manager --&gt;<br /> |leader_name1 =<br /> |leader_title2 =<br /> |leader_name2 =<br /> |leader_title3 =<br /> |leader_name3 =<br /> |leader_title4 =<br /> |leader_name4 =<br /> |established_title = Established<br /> |established_date = August 15, 1540<br /> |founder = [[Garcí Manuel de Carbajal]]<br /> |established_title2 = &lt;!-- Incorporated (town) --&gt;<br /> |established_date2 =<br /> |established_title3 = &lt;!-- Incorporated (city) --&gt;<br /> |established_date3 =<br /> |area_magnitude =<br /> |unit_pref = &lt;!--Enter: Imperial, if Imperial (metric) is desired--&gt;<br /> |area_footnotes =<br /> |area_total_km2 = 69<br /> |area_land_km2 =<br /> |area_water_km2 =<br /> |area_total_sq_mi =<br /> |area_land_sq_mi =<br /> |area_water_sq_mi =<br /> |area_water_percent =<br /> |area_urban_km2 =<br /> |area_urban_sq_mi =<br /> |area_metro_km2 = 2923.53<br /> |area_metro_sq_mi =<br /> |pop_est_as_of =2015<br /> |pop_est_footnotes =&lt;ref name=&quot;proyeccion2015INEI&quot;&gt;{{cite report |url=http://proyectos.inei.gob.pe/web/biblioineipub/bancopub/Est/Lib1020/cuadros/c0206.xls |title=Perú: Población estimada al 30 de junio y tasa de crecimiento de las ciudades capitales, por departamento, 2011 y 2015 |work=Perú: Estimaciones y proyecciones de población total por sexo de las principales ciudades, 2012-2015 |publisher=Instituto Nacional de Estadística e Informática |date=March 2012 |access-date=2015-06-03}}&lt;/ref&gt;<br /> |population_est =869351<br /> |population_as_of = <br /> |population_footnotes =<br /> |population_note =<br /> |settlement_type = &lt;!--For Town or Village of the Dead (Leave blank for the default City)--&gt;<br /> |population_total =<br /> |population_density_km2 = auto<br /> |population_density_sq_mi =<br /> |population_metro = [[List of metropolitan areas of Peru|920.047]]<br /> |population_density_metro_km2 = <br /> |population_density_metro_sq_mi =<br /> |population_urban =<br /> |population_density_urban_km2 =<br /> |population_density_urban_mi2 =<br /> |population_demonym = Arequipeño<br /> |timezone = PET<br /> |utc_offset = -5<br /> |timezone_DST = PET<br /> |utc_offset_DST = −5<br /> |latd= 16|latm= 23 |latNS=S<br /> |longd= 71|longm= 32 |longEW=W<br /> |coordinates_display=d<br /> |elevation_footnotes = &lt;!--for references: use&lt;ref&gt; &lt;/ref&gt; tags--&gt;<br /> |elevation_m = 2335<br /> |elevation_ft = <br /> |postal_code_type = Postal code<br /> |postal_code = 04000<br /> |area_code = 54<br /> |website = [http://www.muniarequipa.gob.pe www.munarequipa.gob.pe]<br /> |footnotes =<br /> }}<br /> <br /> '''Arequipa''' is the capital and largest city of the [[Arequipa Region]] and the seat of the [[Constitutional Court of Peru]]. It is the [[List of metropolitan areas of Peru|third most populous metropolitan area]] of Peru and according to the [[INEI|National Institute of Statistics and Informatics]] is the [[List of cities in Peru|second most populous city]] with 861,145 inhabitants.&lt;ref name=autogenerated1&gt;{{cite web |url=http://www.inei.gob.pe/web/NotaPrensa/Attach/14584.pdf |format=pdf |title=Población oficial 2012 |language=Spanish |deadurl=no |accessdate=13 December 2012}}&lt;/ref&gt;<br /> <br /> Arequipa is the second most industrialized&lt;ref name=&quot;export17p&quot;&gt;Mincetur. &quot;Export Investment Guide&quot;, p. 17&lt;/ref&gt; and commercial city of Peru.&lt;ref name=&quot;chanfreau40p&quot;&gt;Chanfreau, p. 40&lt;/ref&gt; Its industrial activity includes manufactured goods and camelid wool products for export. The city has close trade ties with [[Chile]], [[Bolivia]] and [[Brazil]].<br /> <br /> The city was founded on August 15, 1540 by [[Garcí Manuel de Carbajal]] as 'Villa Hermosa de Nuestra Señora de la Asunción&quot;. By Royal Decree of September 22, 1541, King [[Charles V, Holy Roman Emperor|Charles V]] of Spain granted Arequipa the title of 'City'. During the Colonial period, Arequipa became highly important for its economic prosperity &lt;ref name=&quot;chanfreau40p&quot;/&gt; and for its loyalty to the [[Monarchy of Spain|Spanish Crown]].&lt;ref name=&quot;linares115p&quot;&gt;Linares Málaga, p. 115.&lt;/ref&gt;<br /> <br /> After Peru gained its independence from Spain, the city acquired greater prominence in politics,&lt;ref name=&quot;ponce53p&quot;&gt;{{harv| Ponce|1960|p=53|sp=sí}}&lt;/ref&gt; being the center of uprisings. Many Peruvian intellectual, political, and religious figures became prominent in this era. Moreover, it was declared the capital city of Peru in 1835 and 1883.<br /> <br /> The historic center of Arequipa spans an area of 332 hectares&lt;ref name=&quot;compendio80p&quot;&gt;Provincial Municipality of Arequipa. &quot;Compendium of rules of the historic center of Arequipa&quot;, p. 80.&lt;/ref&gt; and is a [[UNESCO]] World Heritage Site.&lt;ref name=&quot;unesco&quot;&gt;{{cite web |url=http://whc.unesco.org/en/list/1016 |title=Historical Centre of the City of Arequipa |accessdate=4 August 2009 |author=UNESCO |date=30 November 2000}}&lt;/ref&gt; Its historic heritage, natural scenery and cultural sites, make the city a national and international tourist destination. Its religious, colonial, and republican architectural styles blend European and native characteristics&lt;ref name=&quot;Compendio&quot;&gt;{{cite journal |author=Oficina Técnica del Centro Histórico y Zona Monumental de Arequipa (MPA – OTCHA) |title=Compendio Normativo Final del Centro Histórico de Arequipa |year=2002 |number=1 |id=p. 2 |url=http://www.mincetur.gob.pe/apec1/pdf/Mincetur_Arequipa22.pdf}}&lt;/ref&gt; into a unique style called &quot;Escuela Arequipeña&quot;.&lt;ref name=&quot;benavides73p&quot;&gt;{{harv|Benavides|p=73|1990|sp=sí}}&lt;/ref&gt;<br /> <br /> == Etymology ==<br /> [[File:Basílica Catedral de Arequipa.jpg|thumb|right|View of the main square of the city of Arequipa at night, located in the historic centre of Arequipa. The Cathedral of Arequipa is seen at the right.]]<br /> The name of the city is a Spanish language transliteration of the name of the valley in which the city was founded. Based on traditions, there are various tales that attempt to explain the origins of the name.<br /> <br /> A local tradition states that the [[Inca]] [[Mayta Cápac|Mayta Capac]] received a petition from his subjects to reach the valley of the River Chili. They asked him for permission to stay in the region as they were impressed by the beauty of the landscape and the mild climate. The Inca answered ''&quot;Ari qhipay&quot;'' (Quechua: ''&quot;Yes, stay&quot;)''.&lt;ref name=&quot;garayar51p&quot;&gt;{{harv|Garayar|p=51|2004|sp=sí}}&lt;/ref&gt;<br /> <br /> Another similar tale says that when the Europeans first arrived there, they pointed at the ground and asked for the name of the land. the local chief, not understanding the question, assumed they were asking for a permission to sit down and gave a positive answer, which sounded like &quot;Arequipa&quot;.&lt;ref&gt;[[Lev Uspensky]], ''«Имя дома твоего»''&lt;/ref&gt;<br /> <br /> Chroniclers [[Blas Valera]] and [[Inca Garcilaso de la Vega]] suggested that the name of the city came from an ancient [[Aymara language|Aymara]] phrase, &quot;ari qquepan&quot;, supposedly meaning &quot;trumpet sound&quot;, in reference to the sound produced from blowing into an empty conch-like seashell.&lt;ref name=&quot;palma30p&quot;&gt;{{harv|Palma|1893|p=29|sp=sí}}&lt;/ref&gt;<br /> <br /> Another possible origin of the city's name comes from the [[Aymara language|Aymara]] language phrase &quot;qhipaya ari&quot; or &quot;Ari qipa&quot; (from 'ari': acute, sharp or pointed; and 'qhipaya': behind), which translates to &quot;behind the peak,&quot; referring to the nearby volcano, [[El Misti|Misti.]]&lt;ref name=&quot;Etimologia&quot;&gt;[http://www.saludarequipa.gob.pe/epidemiologia/ASIS/Asis2004/ASIS%20PRIMERA%20PARTE%202004.pdf Toponymy &quot;Arequipa&quot;]&lt;/ref&gt;<br /> <br /> == History ==<br /> {{Cleanup|reason = Poor English in this section, possibly translated from another version of Wikipedia|date = January 2014}}<br /> {{Simple Horizontal timeline<br /> |from=-500<br /> |to=2000<br /> |inc=500<br /> |row1=note<br /> |row1-10-at=-300<br /> |row1-10-text='''1st Agriculture?'''<br /> |row1-20-at=500<br /> |row1-20-text='''Tiwanaku'''<br /> |row1-40-at=1000<br /> |row1-40-text='''Churajon'''<br /> |row1-60-at=500<br /> |row1-60-text='''Tiwanaku'''<br /> |row1-80-at=1350<br /> |row1-80-text='''Inca'''<br /> |row1-100-at=1540<br /> |row1-100-text='''Spain'''<br /> |axis-negativeFmt=%s BC<br /> |axis-positiveFmt=%s AD<br /> |axis-zeroFmt= %s AD<br /> |axis-nudge=-0.8em<br /> |row2=scale<br /> }}<br /> <br /> === Pre-Inca period ===<br /> <br /> Centuries before the rise of the Inca Empire the area was inhabited by nomadic people who relied on activities such as [[hunting]], [[fishing]] and [[Hunter–gatherer|gathering]] for survival; pre-Inca cultures [[Domestication|domesticated]] llamas and became [[Sedentism|sedentary]] with the generation of [[agriculture]]. Eventually, after the start of migration process within the region, early settlements were established, many close to the sea, and as such giving rise to the first communication channels and thereby increasing the accessibility of the territory.&lt;ref name=&quot;galdos13p2&quot;&gt;{{harv|Galdós Rodríguez|1997|p = 13|sp = sí}}<br /> &lt;/ref&gt;<br /> <br /> During this time, major irrigation channels were built within the valley of the Chili river, which allowed the development of agriculture by means of terraces built on both sides of the river. The Yarabaya and Chimbe tribes settled in the city's current location, and together with the Cabana and Collagua tribes they developed an agrarian economy in the desert valley.&lt;ref name=&quot;galdos13p2&quot; /&gt;<br /> <br /> === Inca period ===<br /> <br /> When the [[Sapa Inca|Inca]] [[Huayna Capac]] arrived in the valley of the Chili river, he didn't build cities. Instead, he ordered his [[mitma|mitimae]] (settlers from lands within the Inca empire) to settle in the valley to gain control of the existing population, perform intelligence tasks and strengthen border enclaves as a way to control the unconquered villages.&lt;ref name=&quot;galdos14p2&quot;&gt;{{harv|Galdós Rodríguez|1997|p = 14|sp = sí}}<br /> &lt;/ref&gt;<br /> <br /> The mitimae system of settlements in the Inca Empire was not related to the act of founding of a town. The Inca, when conquering a new land, didn't order the founding of new cities; instead, they replaced most of the native population with settlers loyal to the Inca, while moving that native population to other places within the Inca Empire.&lt;ref name=&quot;galdos14p2&quot; /&gt; A Hispanic version of the events, detailed by chronicler [[Garcilaso de la Vega (chronicler)|Garcilaso de la Vega]], who has been described as historically inaccurate,&lt;ref name=&quot;galdos15p2&quot;&gt;{{harv|Galdós Rodríguez|1997|p = 15|sp = sí}}<br /> &lt;/ref&gt; suggests that around 1170 Huayna Capac stopped with his army in the valley of the Chili River, which he called ''Ari qepay'' - an expression meaning &quot;let's stay here&quot;. Lands were then distributed among three thousand families who founded the towns of Yanahuara, Cayma, Tiabaya, Socabaya, Characato and others, which still exist nowadays.&lt;ref name=&quot;garayar50p2&quot;&gt;{{harv|Garayar|2004|p = 50|sp = sí}}<br /> &lt;/ref&gt;<br /> <br /> === Colonial Arequipa ===<br /> Arequipa was founded on 15 August 1540 by [[Garcí Manuel de Carbajal|Garci Manuel de Carbajal]]&lt;nowiki&gt; &lt;/nowiki&gt;in the valley of the Chili river as &quot;Villa de la Asunción de Nuestra Señora del Valle Hermoso de Arequipa&quot; in an area occupied by some [[Native American (Americas)|Native American]] villages.&lt;ref name=&quot;«arellano257p»2&quot;&gt;{{harv|Arellano|1988|sp = sí|p = 257}}<br /> &lt;/ref&gt;&lt;nowiki&gt; &lt;/nowiki&gt;When the city was founded, the first blocks around the main square were given to the Pizarro Family, the [[Cabildo (council)|Cabildo]] (or City Hall) and the [[Dominican Order]].<br /> <br /> At the time of its foundation, Arequipa had already a city council, because the foundation of the town occurred in part as a relocation of Villa Hermosa de Camana, a coastal city. The name was partially conserved as Villa Hermosa de Arequipa.&lt;ref name=&quot;neira244p2&quot;&gt;{{harv|Neira|1990|p = 244|sp = sí}}<br /> &lt;/ref&gt; [[Charles V, Holy Roman Emperor|Charles V]] of Germany and I of Spain gave the town a status of 'city' by Royal Decree on 22 September 1541.&lt;ref name=&quot;cornejob35p2&quot;&gt;{{harv|Cornejo Bouroncle|1952||p = 16|sp = sí}}<br /> &lt;/ref&gt; The relocation efforts were led by [[Garcí Manuel de Carbajal|Garci Manuel de Carbajal]], who was selected as the political authority for the foundation of the&lt;nowiki&gt; &lt;/nowiki&gt;new town.&lt;ref name=&quot;neira246p2&quot;&gt;{{harv|Neira|1990|p = 246|sp = sí}}<br /> &lt;/ref&gt;<br /> <br /> Among the first public works carried out in the city are the Main&lt;nowiki&gt; &lt;/nowiki&gt;Church, the City Hall, the bridge on the Chili River and the monastery of Nuestra Señora de Gracia.&lt;ref name=&quot;neira256p2&quot;&gt;{{harv|Neira|1990|p = 256|sp = sí}}<br /> &lt;/ref&gt;<br /> <br /> === Arequipa during the Independence from Spain ===<br /> Although revolutionary movements like the one commanded by [[Mateo Pumacahua|Pumacahua]] and pro independence troops entered Arequipa, the city remained under Spaniard control&lt;nowiki&gt; &lt;/nowiki&gt;until the Battle of Ayacucho due to internal struggles for local political power.&lt;ref name=&quot;gadea1p2&quot;&gt;{{cite web |publisher = Universidad Católica de Santa María|title = ¿Por qué el Perú es independiente?|url = http://www.ucsm.edu.pe/arequipa/peru6.htm|accessdate = 8 November 2012|work = Arequipa al día|date = 23 August 2006|language = Spanish|last = Gadea Aburto|first = Saúl|editor = Arequipa al día}}<br /> &lt;/ref&gt;<br /> <br /> Colonial authorities were flexible concerning liberal thinking and higher education in Arequipa. An example of this is the foundation of the Academia Lauretana de Ciencias y Artes (Lauretan Academy of Sciences and Arts) on 10 December 1821, which was also home to the first printing office in the region. The main members of the academy: [[Francisco Xavier de Luna Pizarro]], Aparicio Gómez Sánchez, Francisco de Paula Gonzalez Vigil, Gualberto Valdivia, Manuel Amat y Leon and Juan de Dios Salazar took sides in favor of the independence from Spain. The result of the activity of the Lauretan Academy was the foundation of the National College of American Independence and the National University of San Agustin created in 1827.<br /> <br /> ==== Fidelismo ====<br /> One aspect that distinguished Arequipa from the rest of the country was the particularly explicit and public commitment of the city to the Spanish Crown, a phenomenon called ''fidelismo.'' Among its most remarkable defenders were Francisco de Paula Quiroz, Mariano de Rivero, Nicolás Fernández, and José Miguel de Lastarria.&lt;ref name=&quot;garayar54p2&quot;&gt;{{harv|Garayar|2004|p = 54|sp = sí}}<br /> &lt;/ref&gt; It was this attitude of its citizens the reason why the city received the title of ''Faithful'' by Royal Charter in 1805.&lt;ref name=&quot;caceres127p2&quot;&gt;{{harv|Cáceres-Péfaur|2006|p = 127|sp = sí}}<br /> &lt;/ref&gt;<br /> <br /> Since its Spanish founding and over three centuries, the population of the city was mostly of Spanish origin, which represented a faithful following of [[Spain]].&lt;ref name=&quot;caceres128p2&quot;&gt;{{harv|Cáceres-Péfaur|2006|sp = sí|p = 128}}<br /> &lt;/ref&gt; Another factor was geography, because of its location Arequipa was not heavily influenced by libertarian movements, and also kept the city distant to other cities with big Aboriginal population.&lt;ref name=&quot;caceres128p2&quot; /&gt;<br /> <br /> === Republican period ===<br /> [[File:BCP Building Arequipa.jpg|thumb|right|Main Office with eclectic architecture of Banco de Credito del Peru (BCP)]]<br /> After independence, the territory corresponding to the &quot;Intendencia de Arequipa&quot; was given the status of 'Departamento' or [[Arequipa Region|Region of Arequipa]] by decree of 26 May 1822. The Peruvian Congress of 1826 and the Constitutional Assembly of 1827 were led by Arequipa native Francisco Xavier de Luna Pizarro. During the government of [[Simón Bolívar|Bolivar]], right after the victory of the Battle of [[Battle of Ayacucho|Ayacucho]], Arequipa was a political center against the dictatorial powers of Bolivar.<br /> <br /> Arequipa did not have an important official status during the colonial period although it did play an important economic role. During colonial times its location was at the crossroads of the trade route of silver and after independence, the wool trade route. This privileged location allowed Arequipa to accumulate administrative, commercial and industrial power which benefited local social classes committed to the future of the city.&lt;ref name=&quot;chanfreau40p&quot; /&gt; Thus, Arequipa not only was the birthplace of significant political figures in Peru,&lt;ref name=&quot;cotler97p&quot;&gt;{{harv|Cotler|2009|p=97|sp=sí}}&lt;/ref&gt; but also the scene of several important political movements that achieved national prominence.&lt;ref name=&quot;cotler93p&quot;&gt;{{harv|Cotler|2009|p =93|sp=sí}}&lt;/ref&gt;<br /> <br /> From the 1820s until the end of the decade, Peruvian society was in a transitional period right after its independence from Spain.&lt;ref name=&quot;ponce51p&quot;&gt;{{harv| Ponce|1960|p=51|sp=sí}}&lt;/ref&gt; Also during this time, the pillars that supported the economy of Arequipa – manufacture of wool products and the operation of the Southern Railway – began to decline. For these and other reasons, Arequipa saw the rise of a number of political leaders shaped by a growing middle class of professionals, intellectuals and technocrats, who played a role in the defense of the legal and economic stability of the city.&lt;ref name=&quot;bethell402p&quot;&gt;{{harv|Bethell|1991|p=402|sp=sí}}&lt;/ref&gt; It was during this period that the population of the city increased significantly and its citizens had a prominent political participation thus establishing the importance of Arequipa as the country's second city, and in frequent rivalry with Lima.&lt;ref name=&quot;ponce53p&quot; /&gt;<br /> <br /> In 1835, [[Luis José de Orbegoso|General Orbegoso]] moved his government from Lima to Arequipa, by presidential decree on 13 January 1835.&lt;ref name=&quot;neira438p2&quot;&gt;{{harv|Neira|1990|p = 438|sp = sí}}<br /> &lt;/ref&gt; Meanwhile, in Lima, General [[Felipe Santiago Salaverry]]&lt;nowiki&gt; &lt;/nowiki&gt;named himself Supreme Chief of the Republic, arguing that the country was leaderless, i.e. without President, as Orbegoso was outside the capital.&lt;ref name=&quot;congreso.gob.pe2&quot;&gt;[[transport|Decree assuming command of the Republic General Felipe Santiago Salaverry, February 25, 1835]] .<br /> &lt;/ref&gt; Orbegoso then sought support from then Bolivian President [[Andrés de Santa Cruz]] against the claims of [[Felipe Santiago Salaverry|Salaverry.]]&lt;nowiki&gt; &lt;/nowiki&gt;Deciding battles between troops and Salaverry Confederation were in Uchumayo, near the city of Arequipa, on 4 February 1836, where he defeated Salaverry, and Socabaya, three days later, on 7 February, beating [[Andrés de Santa Cruz|Santa Cruz.]]&lt;ref name=&quot;garayar56p2&quot;&gt;{{harv|Garayar|2004|p = 56|sp = sí}}<br /> &lt;/ref&gt; On 18 February 1836, Salaverry and his top aides were shot in the main square of the city.&lt;ref name=&quot;rivap2&quot;&gt;{{harv |de la Riva Agüero|1858|sp = sí|p = }}<br /> &lt;/ref&gt;<br /> <br /> After expressing their rejection of the [[Peru–Bolivian Confederation|Confederation]], Chile sent under General [[Ventura Blanco Encalada]] a military expedition that reached the territory arequipeño 12 October 1837.&lt;ref name=&quot;pardo34p2&quot;&gt;{{harv|Pardo y Aliaga|2007|p = 34|sp = sí}}<br /> &lt;/ref&gt;<br /> &lt;nowiki&gt; &lt;/nowiki&gt;Before going into battle were negotiations that allowed signing a peace<br /> &lt;nowiki&gt; &lt;/nowiki&gt;treaty in Paucarpata, adjacent to the city district, on 17 November, <br /> between the Chilean military chief Gen. Quiroz, of the Confederation. <br /> Chile did not endorse the treaty and sent a second expedition under [[Manuel Bulnes Pinto|General Bulnes]], the following year, in support of [[Ramón Castilla]] and other Peruvian military leaders opposed to Santa Cruz.&lt;ref name=&quot;pinguioXp2&quot;&gt;{{harv|Monguió|1968|sp = sí|p = }}&lt;/ref&gt;<br /> <br /> In the following years the city hosted insurrectionary successive military coups. On 20 February 1843, there was proclaimed as the supreme head of the Republic General [[Manuel Ignacio de Vivanco]], whose ambitions ended with the Battle of Carmen Alto on 22 July 1844.<br /> <br /> On 14 April 1854 from Arequipa insirió as interim president General [[Ramón Castilla|Ramon Castilla]], who managed to take power. Against this de facto government, on 1 November 1856 took up arms again in Arequipa, [[Manuel Ignacio de Vivanco|General Vivanco.]] After failing his military expeditions to [[Lima]] and [[Trujillo, Peru|Trujillo]], had to return to Arequipa in late 1857 to organize its defense. The forces commanded by [[Miguel de San Román]] Vivanco faced in the battle of Paucarpata on 29 June 1857.&lt;ref name=&quot;garayar57p2&quot;&gt;{{harv|Garayar|2004|p = 57|sp = sí}}&lt;/ref&gt;<br /> <br /> ==== War with Chile ====<br /> {{main|War of the Pacific}}<br /> Lizardo Montero arrived in Arequipa on 31 August 1882, declaring the <br /> capital of Peru. Also, Montero convened a National Congress on 28 April <br /> 1883.&lt;ref name=&quot;neira532p2&quot;&gt;{{harv|Neira|1990|p = 532|sp = sí}}<br /> &lt;/ref&gt;<br /> <br /> {{blockquote|«De la noche a la mañana Arequipa se convirtió en la &quot;Capital del Perú&quot;: con presidente y escolta en &quot;palacio&quot;, con ministros y secretarios en sus despachos, con el alto mando militar en sus cuarteles. Un viejo y reitarado sueño se transformaba en realidad aunque con visos de sainete y de tragedia: el gobierno no ejercía el poder en todo el territorio nacional que en sus zonas neurálgicas estaba militarmente ocupado por el enemigo...»|Niera, Máximo, ''«Historia General de Arequipa»''&lt;ref name=neira532p&gt;{{harv|Neira|p=532|1990|sp=sí}}&lt;/ref&gt;}}<br /> <br /> Montero's government had a &quot;National Congress&quot; installed on 22 April <br /> 1883 in the cloisters of the College Independence and National <br /> University of San Agustin, a military support consists of all males 20 <br /> to 60 years&lt;ref name=&quot;mcevoy222p2&quot;&gt;{{harv|Mc Evoy|1997|p = 222|sp = sí}}<br /> &lt;/ref&gt; that formed an army of 4,000 men and 8,000 National Guardsmen to 10 000&lt;ref name=&quot;bulnes285p2&quot;&gt;{{harv|Bulnes|1996|p = 285|sp = sí}}<br /> &lt;/ref&gt;<br /> &lt;nowiki&gt; &lt;/nowiki&gt;and an important financial support based on quotas and taxes erogacione<br /> &lt;nowiki&gt; &lt;/nowiki&gt;both the economic elite and the various southern agricultural <br /> districts.&lt;ref name=&quot;mcevoy222p2&quot; /&gt;<br /> <br /> However, Peru's Arequipa forces revolted against the authority of <br /> Lizardo Montero. On 25 October 1883, a popular uprising overthrew the <br /> government and military of [[Lizardo Montero Flores]] who retired in Arequipa to [[La Paz, Honduras|La Paz]], bringing Chilean troops under Jose Velasquez occupied the city on 29 October, this being delivered by the diplomatic corps of the city.<br /> <br /> ==== Twentieth and twenty-first centuries ====<br /> [[File:Neocolonial Reniec Building.jpg|thumb|right|Headquarters of the National Registry of Identification and Civil Status (RENIEC). Built in the 1940s, is an example of the neo-colonial architecture in Arequipa.]]<br /> [[File:Chaves de la Rosa, Arequipa.jpg|thumb|right|French type architecture in Arequipa]]<br /> Reached the twentieth century, the city was the scene of military coups on 22 August 1930, when the commander [[Luis Miguel Sánchez Cerro|Luis Sánchez Cerro]] was proclaimed Supreme Head and forced the resignation to President Augusto B. Leguia, and 27 October 1948, when General [[Manuel A. Odría|Manuel A. Odria]] formed a joint government and ousted President [[José Bustamante y Rivero|José Luis Bustamante y Rivero.]]<br /> <br /> The city was also the scene of brave civic protests against arbitrariness.&lt;ref name=&quot;Atlas2&quot;&gt;{{cite book |last = GARAYAR|first = Carlos|title = Atlas del Perú – Arequipa|year = 2003|work = Lima: PEISA|id = 992-40-315-7}}<br /> &lt;/ref&gt; The two most important were against the [[Manuel A. Odría|Odria]], one on 17 June 1950, featuring students of the College of American Independence and the second for nine days of December 1955. As usual earthquakes in the department had special significance earthquakes in 1868,1878 and 1913, for the severe injury and damage that resulted.<br /> <br /> The city's economic development was favored by the railroad Arequipa [[Islay]] built by [[Henry Meiggs|Henry Meiggs.]] This was linked to the railway linking Arequipa, [[Cusco|Cuzco]] and [[Juliaca|Juliaca.]] The first telegraph system in the region, which connected [[Mollendo]], Arequipa and Vitor, was established in 1908. Drinking water was supplied to the city with an aqueduct leading Yumina mineral waters, <br /> opened in 1914. In 1931 he built roads Yura Arequipa-Puno and Arequipa. <br /> In Chili to {{convert|78|km|0|abbr = off}}<br /> &lt;nowiki&gt; &lt;/nowiki&gt;from the city and 4300 masl dam was built to irrigate El Fraile 3000 ha<br /> &lt;nowiki&gt; &lt;/nowiki&gt;in the plains of La Joya. This hardworking engineering work was <br /> completed in 1938. In 1940 he inaugurated the modern Alfredo Rodriguez <br /> Ballon Airport.<br /> <br /> In the mid-nineteenth century, the expansion of international demand <br /> helped reorganize the landlords and warlords colonial exploitation of <br /> indigenous peasants in Puno through the expansion of large estates while<br /> &lt;nowiki&gt; &lt;/nowiki&gt;a circle of Arequipa controlled the marketing and processing wool at <br /> the expense of rural communities.&lt;ref name=&quot;cotler20p2&quot;&gt;{{harv|Cotler|2009|p = 20|sp = sí}}<br /> &lt;/ref&gt;<br /> <br /> The momentum of this market, broader than deep, Arequipa is built <br /> from the second half of the nineteenth century as a city of middle <br /> classes, merchants, artisans, professionals, home to an elite regional <br /> macro in modern business city located.&lt;ref name=&quot;cotler27p2&quot;&gt;{{harv|Cotler|2009|p = 27|sp = sí}}<br /> &lt;/ref&gt;<br /> &lt;nowiki&gt; &lt;/nowiki&gt;In time, the elite arequipeña happens to collect, process and export <br /> wool, producing, acquiring lands medium farmers or indigenous highland <br /> and developing an operating system supported by income. This modern <br /> twentieth-century Arequipa, old families, industries, large middle <br /> classes and workers organized in unions, is constructed as a bourgeois <br /> city, civic, democratic.&lt;ref name=&quot;cotler28p2&quot;&gt;{{harv|Cotler|2009|p = 28|sp = sí}}<br /> &lt;/ref&gt;<br /> <br /> In the early twentieth century intellectual groups emerged, such as the &quot;Group Aquelarre&quot; movement, whose demands were focused on political decentralization and a regional identity which coincided with a resurgence of anti-limeño/anti-centralist sentiment. These groups were disassociated from issues related to social justice and economic reform and ultimately came to an abrupt end as a result of the [[Great Depression|Great Depression.]]&lt;ref name=&quot;love6p&quot;&gt;{{harv|Love|1995|p=6|sp=sí}}&lt;/ref&gt; Prominent leaders also arose such as Victor Andres Belaunde and [[José Bustamante y Rivero|José Luis Bustamante y Rivero]], who left their mark as strong-willed constitutionalists in early 1930, and from 1945 to 1948 when [[José Bustamante y Rivero|José Luis Bustamante y Rivero]] served as president of Peru.&lt;ref name=&quot;bethell402p&quot; /&gt;<br /> <br /> In 1945 Bustamante y Rivero became the president of Peru thanks to an alliance with the APRA party and lobbying from Arequipa and other supporters in Lima and other parts of the country. However, the alliance with APRA collapsed early in his presidency weakening his government and giving rise to a military coup by Odría who suppressed APRA and its leaders.<br /> <br /> In 1950 the lawyer Francisco Mostajo (a prominent liberal from Arequipa since 1901) led a failed revolution in Arequipa against the dictator general Odria. In 1962 and in 1963 Fernando Belaunde Terry and his [[Popular Action (Peru)|Popular Action]] party with the support of another party originally from Arequipa, the Christian Democrats, won the presidency of Peru.<br /> <br /> Law 15,923 of 10 January 1966 authorized the creation of the <br /> industrial park of Arequipa, important motivator mediated regional <br /> manufacturing.<br /> <br /> In the early years of this century the historic center of Arequipa was declared [[World Heritage Site|Cultural Heritage of Humanity]], there was also an 8.4 magnitude earthquake on 23 June 2001, one of the largest earthquakes in the world since 1900,&lt;ref&gt;[[tax|The highest magnitude earthquakes since 1900]].<br /> &lt;/ref&gt;<br /> &lt;nowiki&gt; &lt;/nowiki&gt;and of greater magnitude in the history of Peru because of this <br /> earthquake, many of the historic buildings in Arequipa were damaged or destroyed.&lt;ref&gt;{{cite web |url = http://khatati.igp.gob.pe/cns/publi/simposium02/pdf_simposium02/sgp_ber2_tave.PDF|title = Cuantificación del Tamaño del Terremoto de Arequipa del 23 June 2001|accessdate = 18 August 2012|author = Tavera, Hernando|year = 2011|language = Spanish|archivedate = 20 January 2010|archiveurl = http://web.archive.org/web/20100120020910/http://khatati.igp.gob.pe/cns/publi/simposium02/pdf_simposium02/sgp_ber2_tave.PDF}}<br /> &lt;/ref&gt;<br /> <br /> === Uprisings ===<br /> [[File:TomadeArequipa.JPG|thumb|right|Revolution of 1856, from his exile in Chile Vivanco epistolary conspired against the second government of Castile and proclaimed overlord by a revolution started in Arequipa (1 November 1856), returned to take charge. It was the beginning of a long civil war, perhaps the most serious suffered by the Peruvian Republic.]]<br /> Throughout history Arequipa policy have led to many uprisings that earned the city the adjective of &quot;The Lion of the South&quot;.&lt;ref name=&quot;leondelsur&quot;&gt;{{cite web |url=http://linda-arequipa.com/historia-de-arequipa/levantamientos-y-revoluciones/ |title=History of Arequipa |accessdate=5 February 2010 |author=Linda Arequipa |year=2007}}&lt;/ref&gt; According to Leslie Bethell Cambridge University &quot;if Arequipa was the capital of liberalism the other regions of Peru promoted their own interests only through their ideology'.&lt;ref name=&quot;bethell403p&quot;&gt;{{harv|Bethell|1991|p=403|sp=sí}}&lt;/ref&gt; other authors conclude that revolutions were not developed under personal interests or politicians that incentivized, but by passion for law and justice, for his religious faith and his honor.&lt;ref name=&quot;leondelsur&quot; /&gt;<br /> <br /> Leslie Bethell emphasizes the importance of revolutions of Arequipa stating:<br /> {{quote|:«None of the numerous ''aprista'' insurrections in the three decades, including that in Trujillo in 1932, secured as much political leverage as these three Arequipa-based movements.»<br /> <br /> : «Ninguna de las numerosas insurrecciones apristas en las tres décadas, incluyendo la de Trujillo en 1932, han garantizado una gran influencia política como estos tres movimientos surgidos en Arequipa.»|Leslie Bethell, ''The Cambridge History of Latin America: Latin America since 1930''&lt;ref name=bethell403p/&gt;}}<br /> <br /> This revolutionary fame known among Peruvians still won it through numerous rebellions where almost all revolutions, some with national impact, armed themselves to defend local autonomy, compared to a centralizing capital more and more taking up arms in the revolutions following:&lt;ref name=&quot;guillemete3p&quot;&gt;{{harv|Guillemette|2010|p=3|sp=sí}}&lt;/ref&gt;<br /> <br /> {{Columns<br /> |col1 = * Revolution of 1834<br /> * Revolution of 1841<br /> * Revolution of 1844<br /> * Revolution of 1851<br /> * Revolution of 1854|col2 = * Revolution of 1856<br /> * Revolution of 1865<br /> * Revolution of 1867<br /> * Revolution of 1883<br /> * Revolution of 1884|col3 = * Revolution of 1930<br /> * Revolution of 1931<br /> * Revolution of 1950<br /> * Revolution of 1955}}<br /> <br /> === Political trend ===<br /> The starting point of the political path followed by Arequipa is marked by the new national bourgeoisie, which appears to challenge the existing bourgeois elite in Peru, where there was a significant and growing stratum of people in Peru with professional, administrative and trade.&lt;ref name=&quot;bethell401p&quot;&gt;{{harv|Bethell|1991|p=401|sp=sí}}&lt;/ref&gt;<br /> <br /> Since the 1900s the rebellious spirit Arequipa, reborn from the pen of a group of intellectuals, a new generation of liberal anticlericalism characterized by a very Catholic society and opposition to economic and political centralization of the country,&lt;ref name=&quot;guillemete5p&quot;&gt;{{harv|Guillemette|2010|p=5|sp=sí}}&lt;/ref&gt; this opposition Arequipa to the political and economic centralization of the country naturally led to a constitutional position in the 1930s and the subsequent adoption of ideologies Christian Democrats in the 1940s and 1950s. Lawyers and projected a strong church influence in politics Arequipa, as well as the middle class gained further declined participation to economic prosperity in the south of the country.&lt;ref name=&quot;bethell402p&quot; /&gt;<br /> <br /> These new interests take political structure more clearly inside the country whose strongest political structure was the city of Arequipa, and their potential strengths of this national election that was reflected by strength in the candidacy of Fernando Belaunde Terry in the 1956 presidential elections. The southern region, dominated by the city of Arequipa has a long history of separatism and the Republic of Peru, Arequipa and the upper class of the twentieth century has preserved a distinctive regional identity.&lt;ref name=&quot;bethell402p&quot; /&gt;<br /> <br /> == Geography ==<br /> <br /> === Location ===<br /> The city is located at {{convert|2328|m}} of elevation above sea level, with the lowest part of the city being at {{convert|2041|m}} above sea level in the area called Huayco [[Uchumayo District|Uchumayo]] while the highest is located at {{convert|2810|m}} above sea level.<br /> <br /> The central part of the city is crossed by the Chili River from north to south; to the north and east of Arequipa are the Andes mountains, while to the south and west there are minor mountain ranges associated to the Andes. The valley of Arequipa, open toward the coast, plays a key role in allowing Arequipa to be a city that strategically links the coastal and highland regions of southern Peru.&lt;ref name=&quot;gutierrez17p&quot;&gt;{{harv|Gutiérrez|p=17|1994|sp=sí}}&lt;/ref&gt;<br /> <br /> A series of volcanic cones dominates the skyline from the city. These volcanoes form mountains like the [[El Misti|Misti]], [[Pikchu Pikchu]] and [[Chachani]]. This rugged [[Andes|Andean]] western edge of South America is characterized by thick layers of volcanic lava that cover large areas.&lt;ref name=&quot;regional19p&quot;&gt;Regional Government of Arequipa. &quot;Analysis of the state and of the determinants of health&quot;, p. 19.&lt;/ref&gt;<br /> <br /> === Climate ===<br /> <br /> The climate of the city is predominantly dry in [[winter]], [[autumn]] and [[Spring (season)|spring]] due to the low atmospheric moisture and an effective precipitation corresponding to that of a [[Semi-arid climate|semiarid]] climate. Arequipa has also 300 days of sunshine a year on average. Throughout the year, temperatures do not exceed {{convert|25|°C|0}} and rarely drop below {{convert|10|°C|0}}. The wet season lasts from December to March and is marked by the presence of clouds in the afternoon and low rainfall. In winter (June, July), weather gets a little cooler and the temperature drops to an average of {{convert|10|°C|0}}.<br /> <br /> The average relative humidity is 46%, with an average high of 70% in the summer season and a minimum average of 27% during the seasons of autumn, winter and spring, according to data from the weather station at Goyeneche Hospital.&lt;ref name=&quot;conam21p&quot;&gt;National Environmental Council. &quot;To clear the air&quot;, p. 21.&lt;/ref&gt;<br /> <br /> The winds are influenced by a system of local winds and the passage of frontal systems of low atmospheric pressure, which are conditioned by the topographical surrounding the valley where the city is. These winds occur mainly in the evening and early morning; mountain breezes flow in a north-east direction and in the course of the day valley breezes dominate with a South-West direction. The wind velocity along the day fluctuates between 1.5 m / s and 2.5 m / s.&lt;ref name=&quot;conam21-22p&quot;&gt;National Environmental Council. &quot;To clear the air&quot;, pp. 21–22.&lt;/ref&gt;<br /> <br /> {{Weather box<br /> |location = Arequipa|metric first = Y|single line = Y|Jan high C = 21.5|Feb high C = 21.0|Mar high C = 21.4|Apr high C = 21.7|May high C = 21.8|Jun high C = 21.3|Jul high C = 21.4|Aug high C = 21.9|Sep high C = 22.3|Oct high C = 22.6|Nov high C = 22.5|Dec high C = 22.1|year high C = 21.8|Jan low C = 8.6|Feb low C = 8.8|Mar low C = 8.5|Apr low C = 6.9|May low C = 6.3|Jun low C = 5.5|Jul low C = 5.5|Aug low C = 5.5|Sep low C = 6.4|Oct low C = 6.6|Nov low C = 6.6|Dec low C = 7.7|year low C = 6.9|rain colour = green|Jan rain mm = 28.0|Feb rain mm = 35.6|Mar rain mm = 21.3|Apr rain mm = 0.7|May rain mm = 0.2|Jun rain mm = 0.0|Jul rain mm = 0.0|Aug rain mm = 1.8|Sep rain mm = 1.4|Oct rain mm = 0.2|Nov rain mm = 1.1|Dec rain mm = 4.3|year rain mm = 94.6|source 1 = [[World Meteorological Organization]]&lt;ref name= WMO&gt;{{cite web <br /> | url = http://worldweather.wmo.int/029/c00109.htm<br /> | title = World Weather Information Service – Arequipa<br /> | publisher = World Meteorological Organization<br /> | accessdate = August 21, 2013}}&lt;/ref&gt;|date = August 2013}}<br /> <br /> === Solar radiation ===<br /> The global [[Sunlight|solar radiation]] recorded in the city ranges from 850–950 ''W / m &lt;sup&gt;2&lt;/sup&gt;'' (watts / square meter), considered one of the highest levels of radiation in South America and the highest recorded in Peru. This phenomenon is due to its proximity to the area of influence of the [[Atacama Desert]] and [[pollution]] at every stage.&lt;ref name=&quot;conam21p&quot; /&gt;<br /> <br /> === Cityscape ===<br /> <br /> ==== Historic Centre ====<br /> On 15 August 1540 a plot was made forty-nine &quot;blocks or islands.&quot; {{refn|«Se dispusieron las calles a cordel perpendicularmente, formando islas o manzanas en número de 56, es decir, un auténtico damero, que se conserva hasta nuestros días con muy pocas variantes.»&lt;ref name=neira224p&gt;{{harv|Neira|1990|p=224|sp=sí}}&lt;/ref&gt;|group = nota}} sides were measured and each had a length of &quot;400 feet Castilians' (111.40 meters), separated by streets&quot; 37 feet Castilian &quot;(10.30 meters), so that the checkerboard foundation is characterized by perfection in drawing apples.&lt;ref name=&quot;Municipalidad&quot;&gt;{{harv|Municipalidad Provincial de Arequipa|p=10|sp=sí|2002}}&lt;/ref&gt; {{refn|«La anchura de las calles fue de treinta pies y el largo de cada cuadra de 250 pies. La Planta primitiva fue luego alterada al fundarse los conventos y monasterios que requirieron dos manzanas algunos de ellos: Es entonces cuando recién aparecen las pequeñas plazas. Efectuada la distribución de solares por vecinos, estos no edificaron de inmediato, los Bandos del Cabildo son reiterativos para que edificaran sus viviendas.»&lt;ref name=neira224p/&gt;|group = nota}}<br /> <br /> The writer Pedro Davalos and Lisson, in his book ''The First Century ''contains the description given by Paz Soldan in 1855:<br /> {{blockquote|Fundose esa ciudad por orden de Francisco Pizarro y con bando solemne el día 15 de agosto de 1540. Su primer sitio, fue atrás de Caima, pero después se trasladó al en que hoy se halla, por presentar más extensión y comodidades. Al trazarla se cuidó que sus calles se cortasen en ángulos rectos y en dirección casi de NS y EO, y que cada cuadra tuviese 150 varas de largo y doce poco más o menos de ancho. Para conservar la salubridad, comodidad y aseo, se cortaron acequias en el medio de las calles, así rectas como transversales, cuyo cauce está bien acanalado. Las calles que corren −230- de E a O son ocho (las principales) y las otras también ocho: sus aceras todas están bien enlosadas con una especie de piedra blanca volcánica, llamada Sillary el piso restante empedrado con guijarros.|'''Pedro Dávalos y Lissón''' – ''La primera centuria : causas geográficas, políticas y económicas que han detenido el progreso moral y material del Perú en el primer siglo de su vida independiente. Tomo II.’’&lt;ref name=davalos320p&gt;{{harv|Dávalos y Lissón|p=320|1863|sp=sí}}&lt;/ref&gt;}}<br /> <br /> Because of this, there is no doubt that the former &quot;Villa Hermosa de Arequipa&quot; he intended to occupy the regional capital. The city became a connecting link between Cuzco, ponds and the ocean. And in fact the city of Arequipa in the exploitation phase of silver in Potosi, has since become &quot;'a major logistics hub.&quot; The urban setting near the present district of San Lazaro, where was erected the first chapel of the city occupied an area of 850 x 875 meters.&lt;ref name=&quot;diagnostico12p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 12.&lt;/ref&gt;<br /> <br /> The square foundation, located three blocks from the river and occupied an eccentric position in the founding and checkerboard patterns as Hispanic was the focal point of the city. Apples was occupied by four or eight lots, and were distributed according to their importance in the new neighborhood. With the passage of time some religious institutions came to occupy a block as the case of the Convent of Santa Catalina and San Francisco Monastery.&lt;ref name=&quot;diagnostico12p&quot; /&gt;<br /> <br /> ==== Republican Era ====<br /> In the Republican era shows a growth process similar to the colonial era, where the urban area has grown at the expense of the countryside, a process that has worsened in recent decades. The city also experienced an expansion to the east of what is now called historic, new avenues were plotted as Parra Boulevard and Twentieth Century Avenue, was established wooded neighborhood of El Vallecito, where he built the first shawls to the 1940s,&lt;ref name=&quot;vallecito&quot;&gt;{{cite web |url=http://www.mariorommelarce.com/portal/?p=439 |title=Los Barrios: Su historía, costumbre y tradiciones |accessdate=28 October 2009 |author=Mario Rommel Arce}}&lt;/ref&gt; and the city extended into Yanahuara, poor people came to occupy the districts of Miraflores, Barrio Obrero, Jacinto Ibanez.<br /> [[File:Av La Marina Arequipa.JPG|thumb|right|Consuelo Quiñones Interchange, located at the intersections of Quiñones Avenue and La Marina Avenue, is part of the modernization of road infrastructure in Arequipa]]<br /> <br /> Urban architecture is extended with new construction, and moved the market town located in the Plaza de Armas to the park Duhamel and later to its present location at the Convent of the Order of St. Camillus agonizing Parents, between 1905 and 1910 Goyeneche Hospital was built, also built bridges linking the city center with the district as the bridge Yanahuara Real. By the year 1940, the first project was proposed expansion and urban facilities. This plan envisaged the creation of a ring of houses greater than existing growth plan consolidating regarding radial and concentric paths regarding land use, neighborhoods were enabled Cuarto Centenario and Selva Alegre.&lt;ref name=&quot;diagnostico14p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 14.&lt;/ref&gt; He was also given a boost to urban facilities with the construction of the Municipal Theatre, the Hotel de Turistas, the Municipal Library, the Athenaeum Theatre, American Independence College, Campus of the Universidad Nacional de San Agustin.&lt;ref name=&quot;diagnostico14p&quot; /&gt;<br /> <br /> Until the late 1950s there were two factors that substantially changed the trends of urban growth, the earthquakes in the years of 1958 and 1960 and the drought plateau, which accelerated peripheral growth.&lt;ref name=&quot;diagnostico15p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 15.&lt;/ref&gt;<br /> <br /> This period starts with greater force the displacement of resident population sectors, there is a shift in the industry that was located in the Barrio del Solar and El Barrio Obrero&lt;ref name=&quot;diagnostico24p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 24.&lt;/ref&gt; following the creation of the industrial park, causing a process outsourcing of the city center towards commercial activities primarily in the informal sector.&lt;ref name=&quot;diagnostico6p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 6.&lt;/ref&gt; An example of this exodus is the displacement of some educational institutions that previously were located in the city center as the National University of San Agustin in the year of 1962 and residential sectors to consolidate the periphery to the center of the city as a dynamic central business district.&lt;ref name=&quot;diagnostico15p&quot; /&gt;<br /> <br /> == Demographics ==<br /> According to [[Peru 2007 Census|census XI]] of 2007, the province of Arequipa concentrates 75.5% of the total population of the region and the city of Arequipa, the capital of the department, with 70% of the total population and 90% of urban population. {{refn|«El departamento de Arequipa está ubicado en la zona sur occidental del Perú. Tiene una población de 1&amp;nbsp;140&amp;nbsp;810 habitantes, distribuida en 8 provincias y 109 distritos ubicados en una superficie de 63&amp;nbsp;345.39 km&lt;sup&gt;2&lt;/sup&gt;. El 82&amp;nbsp;% de la población vive en poblados de más de 2000 habitantes, considerados como población urbana y el 84&amp;nbsp;% vive en la sierra. La provincia de Arequipa concentra el 75,5&amp;nbsp;% de la población total de la región y la ciudad de Arequipa, capital del departamento, concentra el 70&amp;nbsp;% de la población total, y el 90&amp;nbsp;% de la población urbana.»&lt;ref name=cotler94p&gt;{{harv |Cotler|2009|p=94|sp=sí}}&lt;/ref&gt;|group = nota}}<br /> <br /> === Demographic trends ===<br /> <br /> One of the first references that can be found is the one by historian Ventura Travada y Córdova who in the mid-eighteenth century, wrote:<br /> {{blockquote|El número de gentes que tiene esta ciudad es de 30.000 de todos sexos, estados y edades.<br /> Los indios apenas 4.000 y para su doctrina basta una sola parroquia en la ciudad – la de Santa Marta – que comprende todos los indios forasteros y naturales que viven dispersos en la ciudad y para ser una sola no es muy numerosa porque excepcionando algunos negros, mulatos y otros apenas llegan a 6.000. todos los demás son españoles, muchos de ellos de nobleza conocida cuya sangre procuran honroso no degenerar...|Ventura Travada y Córdova&lt;ref name=ventura&amp;travada&gt;{{cite book |author=Ventura Travada y Córdova<br /> |title=El suelo de Arequipa convertido en cielo<br /> |year=1752<br /> |page= 90<br /> }}&lt;/ref&gt;<br /> <br /> }}<br /> <br /> One of the first population census in the city date back to 1796 where there were 37,241 inhabitants in the 'pen' which corresponded to 22 207 Spanish, 5929 Indians, mestizos 4908, 2487 and 1710 slave castes.&lt;ref name=&quot;gutierrez83p&quot;&gt;{{harv|Gutiérrez|p=83|1994|sp=sí}}&lt;/ref&gt; At the end of the first half of the twentieth century, the effects of momentum multplicadores to Arequipa by the works of 1940 demonstrated very quickly which was clearest symptom population growth, as annual population growth of 1.1% for the period of 1876 to 1917 tripled to 3.3% annually in the period that goes from 1940 to 1960.&lt;ref name=&quot;gutierrez226p&quot;&gt;{{harv|Gutiérrez|p=226|1994|sp=sí}}&lt;/ref&gt;<br /> <br /> In the early years of the second half of the twentieth century the city would rise from 85,000 in 1940 to 158,000 in 1961 in an unprecedented population explosion process, whose possible reasons have to do with the establishment of the first industrial enterprises generated as opening import substitution due to World War II and the transformation of agricultural production.&lt;ref name=&quot;gutierrez226p&quot; /&gt; The demographic trend is substantially modified by two factors: the earthquake of 1958 and the drought plateau, accelerating migration and urbanization, and peripheral growth that lasts until today.&lt;ref name=&quot;diagnostico15p&quot; /&gt; The population explosion was enhanced by the rearrangement of urban space after the earthquakes was really impressive and Arequipa's population doubled in a decade.&lt;ref name=&quot;gutierrez231p&quot;&gt;{{harv|Gutiérrez|p=231|1994|sp=sí}}&lt;/ref&gt; The 158 000 inhabitants in 1961, would be 309 000 in 1972 and almost 500,000 in 1983. The expansion of the urban area to previous rural areas incorporated subsistence farming actively into the urban cycle.&lt;ref name=&quot;gutierrez232p&quot;&gt;{{harv|Gutiérrez|p=232|1994|sp=sí}}&lt;/ref&gt;<br /> <br /> '''Evolution of the population of Arequipa in the period between 1796 and 2012'''<br /> <br /> <br /> : &lt;small&gt;Sources: Population Census 1804 (Gil de Toboada)&lt;ref name=&quot;diagnostico12p&quot; /&gt; Viceroyalty of Peru in 1812, {{refn|«Se ha considerado a la población del partido del &quot;Cercado&quot;, que puede ser más amplia que la de la ciudad propiamente dicha, pero puede servirnos de referencia.»&lt;ref name=contreras278p&gt;{{harv |Contreras|2004|p=278|sp=sí}}&lt;/ref&gt;|group = nota}} Census of inhabitants of Peru (1876) {{refn|«La ciudad de Arequipa está compuesta por los distritos de Arequipa, Miraflores y Palomar.»&lt;ref name=direccion426p&gt;{{harv |Dirección de Estadística|1878|p=426|sp=sí}}&lt;/ref&gt;|group = nota}} Census of the City of Arequipa in 1917&lt;ref name=&quot;inep&quot;&gt;{{harv|Instituto Nacional de Estadistica|1944|p=60|sp=sí}}&lt;/ref&gt; INEI,&lt;ref&gt;{{cite journal |title=El crecimiento de las ciudades |publisher=Migraciones Internas en el Perú |work=Instituto Nacional de Estadística e Informática |url=http://www.inei.gob.pe/biblioineipub/bancopub/Est/Lib0018/cap31002.htm |accessdate=9 August 2012}}&lt;/ref&gt; INEI 2012 population estimate&lt;ref name=&quot;proyeccion2015INEI&quot; /&gt; &lt;/small&gt;<br /> <br /> == Economy ==<br /> [[File:Anntarah, Campo Redondo, Arequipa.JPG|thumb|right|Boutique in Piazza Campo Redondo]]<br /> Since Arequipa is predominantly urban, industry, commerce and construction taking place in the capital of the department have a central role in the future of the town. However, the presence of fertile valleys and high Andes allows agricultural activity has great importance for the development of the city: a central axis of the demands arequipeñas is building irrigation to improve their productivity. Finally, in recent times, the mining industry has entered a stage of modernity, has ceased to be only artisanal or small business to include large-scale mining, as in the case of Cerro Verde,&lt;ref name=&quot;cotler96p&quot;&gt;{{harv|Cotler|2009|p =96|sp=sí}}&lt;/ref&gt; established in 1993 in the Arequipa.&lt;ref name=&quot;centrum&quot;&gt;Centrum. Cerro Verde Financial Reports, p. 4.&lt;/ref&gt;<br /> <br /> From the twentieth century in the city have developed the [[Industry|industries]] related to the primary sector, highlighting the textile and agricultural industries. They constitute a center of exchange and mediation in the southern Andes, serving as a link between the [[coast]] and the mountains.&lt;ref name=&quot;PlanArequipaMetro&quot;&gt;[http://www.cipca.org.pe/cipca/webir/regarequipa/captuloiv.pdf Metropolitan Strategic Plan of Arequipa, Arequipa Economics]&lt;/ref&gt;<br /> <br /> === Economic indicators ===<br /> The contribution of the city of Arequipa in Arequipa region's GDP is 74.2% of its GDP according to studies by the National University of San Agustin, also the region's GDP is the highest Arequipa after Lima.<br /> <br /> In the period 2003–2008 was the &quot;City with greatest economic growth in Latin America&quot;, according to the report in 2009 of &quot;America Economia&quot; presenting a percentage change in GDP per capita of 66.1%. Also in 2007–2008 was the city with the highest percentage change in GDP in Latin America with a variation of 9.59%.&lt;ref name=&quot;AméricaEconomía&quot;&gt;{{cite journal |author=América Economía |title=Ser verde en 2009 es como estar online en 1999 |year= 2009 |language=Spanish |journal=América Economía |number=7728 | id = p. 22 – p. 25 |url=http://web.archive.org/web/20090520235518/http://www.americaeconomia.com/Multimedios/Otros/7782.pdf<br /> }}&lt;/ref&gt;<br /> <br /> {| class=&quot;wikitable&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; width=&quot;50%&quot; style=&quot;float:center;text-align:center;clear:all;margin-left:25%;font-size:84%&quot;<br /> |-<br /> ! bgcolor=&quot;black&quot; colspan=&quot;5&quot;|Economic Indicators – City of Arequipa<br /> |- bgcolor=&quot;#efefef&quot;<br /> ! width=&quot;20%&quot;| Population (MM)<br /> ! width=&quot;20%&quot;| GDP 2010 (millions U.S. $)<br /> ! width=&quot;20%&quot;| GDP per capita 2010 (U.S. $)<br /> ! width=&quot;20%&quot;| % Unemployment 2011<br /> ! width=&quot;20%&quot;| No. investment banks<br /> |-<br /> | &amp;nbsp;0–9<br /> | 10,587<br /> | 12,188<br /> | 5,0<br /> | 1<br /> |-<br /> | colspan=&quot;5&quot; style=&quot;background:#e9e9e9&quot; align=&quot;center&quot;|&lt;small&gt;Source: American Journal Economics. ''Special Cities''&lt;ref name=&quot;america2011&quot;&gt;{{cite journal |author=América Economía |year=2012 |title=Las mejores ciudades para hacer negocios |publisher=Especiales |work=América Economía |url=http://rankings.americaeconomia.com/2011/ciudades/ranking.php |accessdate=23 August 2012}}&lt;/ref&gt;&lt;/small&gt;<br /> |-<br /> |}<br /> <br /> According to the &quot;Specialized Household Survey on Employment Levels&quot; has the largest amount of &quot;Economically able to work&quot; within the country amounting to 625 547 people, and the most economically active population (PEA) which amounts to 376 764 people having a same employment rate above the national average with an average monthly income of 928 soles&lt;ref&gt;{{cite journal |year=2007 |title=Ciudades:Promedio y mediana del ingreso laboral mensual de la PEA ocupada |publisher=Programa de Estadísticas y Estudios Laborales |work=Ministerio del Trabajo |url=http://www.mintra.gob.pe/archivos/file/estadisticas/peel/estadisticas/oflapeaocupada_17.pdf |accessdate=10 August 2012}}&lt;/ref&gt; whose main areas of activity in which play is manufacturing (12.9%), trade (23%) and non-personal services (36.6%).&lt;ref&gt;{{cite journal |year=2000 |title=PEA Ocupada según diversas variables: estructura de mercado, grupo ocupacional y rama de actividad |publisher=Programa de Estadísticas y Estudios Laborales |work=Ministerio del Trabajo |url=http://www.mintra.gob.pe/archivos/file/estadisticas/peel/estadisticas/40_1.pdf |accessdate=10 August 2012}}&lt;/ref&gt;<br /> <br /> The contribution to the national sales tax is 20.3%, in solidarity tax on 17% being the second national taxpayer in these taxes. Arequipa has a production structure strongly biased to trade and services sectors, the primary sector of agriculture and [[mining]] accounted for 29.6% of GDP, the secondary sector of manufacturing industry and 20.7% in the tertiary sector and trade and services 49.7%, it was strengthened in recent years by a lack of productive investment.<br /> <br /> === Construction ===<br /> <br /> &lt;!-- {| class=&quot;toc&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; width=&quot;25%&quot; style=&quot;float:right;text-align:center;clear:all;margin-left:3px;font-size:85%&quot;<br /> |-<br /> ! bgcolor=&quot;black&quot; colspan=&quot;3&quot; style=&quot;color:white&quot;|Construction<br /> |-<br /> |}<br /> !bgcolor = # e0e0e0 colspan = 3 | construction activity<br /> |-Bgcolor = # efefef<br /> ! width = 60% | Destination<br /> ! width = 20% | m &lt;sup&gt;2&lt;/sup&gt;<br /> ! width = 20% |%<br /> | –<br /> | Align = left | '''Housing | | 401,530 | | 65.61'''<br /> | –<br /> | Align = left '''| Commercial | | 63,456 | | 10.37'''<br /> | –<br /> | Align = left | '''Offices | | 23,367 | | 3.82'''<br /> | –<br /> | Align = left | '''Other Destinations | | 123,608 | | 20.2'''<br /> | –<br /> | Align = center | '''TOTAL | | 611,961 | | 100%'''<br /> | –<br /> | Align = center colspan = 3 | &lt;small&gt;'''Peruvian Chamber of Construction''' &lt;/small&gt;<br /> | –<br /> |}<br /> --&gt;<br /> [[File:Villa Médica Towers.jpg|thumb|right|Construction has been the fastest growing sector in recent years. High-rise apartment buildings at Villa Medica.]]<br /> The construction sector of the city is the second most dynamic in the country, after Lima, according to the Study of Urban Buildings by the Institute of Construction and Development of the Peruvian Chamber of Construction.{{Citation needed|date=December 2012}} Building activity in 2011 amounted to 611 961 m &lt;sup&gt;2,&lt;/sup&gt; 65% for housing, 10% for offices and commercial premises 4%.{{Citation needed|date=December 2012}} In the case of housing supply, departments account for 70% and 30% households of the total supply in this sector of destination.{{Citation needed|date=December 2012}}<br /> <br /> === Fairs, exhibitions and congresses ===<br /> The city is seen as a place of exhibitions and events in the country,&lt;ref&gt;{{cite news |title= Eguren, Arequipa se consolida como plaza para convenciones y eventos|url=http://www.rpp.com.pe/2009-11-21-eguren-arequipa-se-consolida-como-plaza-para-convenciones-y-eventos-noticia_224065.html |work=Radio Programas del Perú |date=21 November 2009 |accessdate=10 August 2012}}&lt;/ref&gt;&lt;ref name=&quot;eventosTravel&quot;&gt;{{cite news |title=Convención minera 2011 confirma a la ciudad como plaza principal de realización de eventos |url=http://www.travelupdate.com.pe/nacional/6227-arequipa-convencion-minera-2011-confirma-a-la-ciudad-como-plaza-principal-de-realizacion-de-eventos |work=Travel Update |accessdate=10 August 2012}}&lt;/ref&gt; among which were:<br /> <br /> * '''International Book Fair'''<br /> <br /> The III International Book Fair held in Arequipa in 2011 had an influx of 400,000 people and a collection of a million and a half soles&lt;ref&gt;{{Cite web |title=¿CÓMO SE GESTÓ EL PREMIO INTERNACIONAL DE NOVELA CORTA MARIO VARGAS LLOSA? – Premio Internacional de Novela Corta Mario Vargas Llosa |url=http://filarequipa.pe/premiomariovargasllosa/como-se-gesto-el-premio-internacional-de-novela-corta-mario-vargas-llosa-2 |deadurl=no |accessdate=11 December 2012}}&lt;/ref&gt;<br /> <br /> * '''Mining Convention'''<br /> <br /> Oriented mining sector entrepreneurs, investors and government delegations in the last edition in the year 2011 had the presence of 40 countries bringing together 50,000 people.&lt;ref&gt;{{Cite web |title=requipa: 50 mil personas visitan al momento Convención Minera |url=http://www.rpp.com.pe/2011-09-15-arequipa-50-mil-personas-visitan-al-momento-convencion-minera-noticia_404087.html |deadurl=no |accessdate=11 December 2012}}&lt;/ref&gt;<br /> <br /> === Tourism ===<br /> In Arequipa tourism is a factor of the economy energizing establishing itself as the third most visited city in the country after Cusco and [[Lima]].&lt;ref name=&quot;export17p&quot;/&gt; In 2010, Arequipa received a total of 1.395 million visitors according to the [[Ministry of Foreign Commerce and Tourism (Peru)|Ministry of Commerce and Tourism.]]&lt;ref name=&quot;Turistas&quot;&gt;{{cite journal |year=2011 |title=Arequipa:principales indicadores del sector turismo 2001–2010 |publisher=Banco de publicaciones estadísticas |work=Instituto Nacional de Estadística e Informática |url=http://www.inei.gob.pe/biblioineipub/bancopub/Est/Lib0937/cuadros/arequipa/2_4_3_16.xls |accessdate=9 August 2012}}&lt;/ref&gt;<br /> <br /> === Industry ===<br /> [[File:Parque Industrial de Arequipa.jpg|thumb|right|Partial view of Arequipa Industrial Park located south of the metropolis]]<br /> The city's industrial sector has the largest nationwide diversification&lt;ref name=&quot;Industria&quot;&gt;{{cite book |work=Banco Central de Reserva del Perú |title=Arequipa, perfil Económico |url=http://www.bcrp.gob.pe/bcr/dmdocuments/Publicaciones/seminarios/Conf200701/Lib200701-03 |edition=ilustrada |year=2006 |page=292 |chapter=3}}&lt;/ref&gt; and is the second most industrialized city of Peru&lt;ref name=&quot;export17p&quot;/&gt; product of the Industrial Park was established during the first government of [[Fernando Belaúnde Terry|Fernando Belaúnde Terry.]] After two major earthquakes, in 1958 and 1960, with the law of the &quot;Rehabilitation and Development Board of Arequipa» Industrial Park was built with two or three factories at that time, and the Yura Cement factory.&lt;ref name=&quot;Industria&quot;/&gt;<br /> <br /> The city's industrial sector comprises industrial parks among which may be mentioned the &quot;Parque Industrial de Arequipa&quot; orientaado to large and medium enterprises, the &quot;Industrial Park APIMA&quot; to small businesses,&lt;ref name=&quot;apima&quot;&gt;{{cite book |last=Centty Villafuerte |first=Eymor B. |work=Banco Central de Reserva del Perú |title=Informe Pymes de Arequipa 2002|url=http://www.eumed.net/libros/2008c/422/PROMOCION%20ESTATAL%20A%20LAS%20PYMES.htm |year=2002|page=124}}&lt;/ref&gt; the &quot;Industrial Park Rio Seco &quot;and industrial areas in the Alfonso Ugarte Av, Alternative Uchumayo and North Cone.&lt;ref name=&quot;zonificación&quot;&gt;{{cite book |work=Oficina de Planificación y Gestión Urbano Ambiental – Municipalidad Provincial de Arequipa |title=Aspecto Normativos del Plan Director |url=http://web.archive.org/web/20070306125343/http://www.muniarequipa.gob.pe/proyectos/plan_director/aspectos_normativos/aspectos_normativos.pdf|year=2002 |id=p. 11 |page=29 |chapter=Zonificación Industrial}}&lt;/ref&gt; Finally, there is a consolidated sector and planned and Ladrilleras Umapalca Yarabamba way. Spatial occupancy for industrial zones cover an area of 286 hectares.&lt;ref name=&quot;conamu26p&quot;&gt;National Environmental Council. &quot;To clear the air&quot;, p. 26.&lt;/ref&gt;<br /> <br /> * '''Arequipa Industrial Park,''' along its existence has undergone several transformations of their industries, showing a more dynamic consumer related industries (food and beverages), construction (PVC, cement and steel) and those of Export (textile companies). In this industrial companies are also engaged in the chemical industry and plastics, companies producing non-metallic minerals, stationery and printing, among others,&lt;ref name=&quot;Industria&quot;/&gt; conglomerando over 150 companies, among which we can highlight to Alicorp SAA, Processed Foods SA, Laive, La Iberica, Manuel Muñoz Najar, Bin Pan SA, Consorcio Industrial Arequipa SA, Omniagro, Backus &amp; Johnston, Corporación Aceros Arequipa. Also in Arequipa is developed textiles both cotton and alpaca and wool factories represented by: Francky and Ricky, Michell &amp; Cia. e IncaTops, companies are also in the Arequipa Industrial Park.&lt;ref name=&quot;Industria&quot;/&gt;<br /> <br /> === Media and Entertainment ===<br /> On 15 August 1959 was the first television transmission in the city of Arequipa at the Cultural Hall of the National University of San Agustin. It was an initiative of businessman Jack Dwyre through his new company Televisora Sur Peruana in partnership with the [[Universidad Nacional de San Agustín de Arequipa|National University of San Agustin]] as Channel 2 (now TV UNSA).&lt;ref name=&quot;television&quot;&gt;{{cite web |url=http://www.mariorommelarce.com/portal/?p=470 |title=50 años de la televisión en Arequipa |accessdate=29 October 2009 |author=Mario Rommel Arce}}&lt;/ref&gt; The aforementioned university became one of the first in South America to operate a public TV station from inside its campus.&lt;ref name=&quot;television&quot; /&gt;<br /> <br /> Furthermore, two other public television stations began to operate in Arequipa: Radio Television Continental (Channel 6) in 1962 and Compañía de Radiodifusión Arequipa (Channel 8) in 1987 (broadcasting as ATV Sur since 2012).&lt;ref name=&quot;television2&quot;&gt;{{Cite book |url=http://books.google.com.pe/books?id=fOKgtCnP9FoC&amp;dq |title=El impacto económico de la cultura en Perú |accessdate=10 July 2012 |author=Universidad de &quot;San Martín de Porres.&quot; Escuela Profesional de Turismo y Hotelería. Instituto de Investigacíon |year=2005}}&lt;/ref&gt;<br /> <br /> Among the newspapers that are printed in the city, ''El Pueblo'' is the oldest (active since 1 January 1905) and the second oldest in the country. Writers like Percy Gibson and Alberto Hidalgo, and politicians like Hector Cornejo Chavez, Mario Polar Ugarteche and Alfonso Montesinos started their careers in this newspaper.&lt;ref name=&quot;garayar60p&quot;&gt;{{harv|Garayar|p=60|2004|sp=sí}}&lt;/ref&gt;<br /> <br /> == Education ==<br /> According to the 2007 Census data INEI in [[Arequipa Province|Arequipa]], there is a student population totaling 823,148 inhabitants of three years or more to attend a regular school, which represents 95.24% of the entire provincial population of Arequipa.<br /> <br /> === Nursery, primary and secondary ===<br /> In 2007 in the districts of the city 20% nbsp; 595 students at grade level or initial childhood education, primary education, 143 543 and 219 305 secondary education. Among the oldest schools in the city are the Seminary of San Jeronimo in operation since 1622,&lt;ref&gt;{{cite web |url=http://www.seminariosanjeronimoarequipa.org.pe/historia.php |title=Historia del Colegio San Jerónimo |accessdate=3 August 2012 |work=Colegio San Jerónimo}}&lt;/ref&gt; the American Independence College, St. Francis College, Don Bosco Salesian College, College De La Salle and St. Joseph College.<br /> <br /> === Higher education ===<br /> The city of Arequipa has the presence of more than 15 universities, with only one national and eight private headquartered in the city, the rest are private and national universities both at home and abroad (Chile).<br /> <br /> In 2007 in the existing universities housed a university population of 70,894 students and colleges university not a population of 56 087 students, becoming the city with the highest number of home university of the country after the capital and the city with the highest population percentage-wise university of Peru. The population categorized with university and complete university reached 108 823 and 70 252 students respectively.<br /> <br /> ==== National University of San Agustin ====<br /> {{main|National University of St Augustin of Arequipa}}<br /> [[File:Pabellón de la Cultura, UNSA.JPG|thumb|right|University City at the National University of San Agustin, Arequipa marking neocolonial style under a scheme of L'Ecole des Beaux Arts in Paris]]<br /> It is the second largest public university in the country, behind the University of San Marcos,&lt;ref name=&quot;anr10p&quot;&gt;National Assembly of Rectors. &quot;University Statistical Data&quot;, p. 10.&lt;/ref&gt; had the predecessor to the Royal and Pontifical University Intra calustra, created by decree on 22 January 1714 and the Academy of Sciences Lauretana Arts and founded on 10 December 1821,&lt;ref name=&quot;robles45p&quot;&gt;{{harv|Robles|p=45|2006|sp=sí}}&lt;/ref&gt; from which was born the National University of San Agustin who was installed on 11 November 1828 but according to the university law recognizes the creation of the university on 2 June 1827.&lt;ref name=&quot;unsaresena&quot;&gt;{{cite web |author=Universidad Nacional de San Agustín |year=2012 |title=Reseña Histórica |publisher=La Universidad |url=http://www.unsa.edu.pe/index.php/la-universidad/resena-historica |accessdate=11 August 2012}}&lt;/ref&gt;<br /> <br /> ===== University Campus =====<br /> The construction of the university city of the National University of San Agustin is a product of the projection made by the architect Hector Velarde in 1940&lt;ref name=&quot;gutierrez216p&quot;&gt;{{harv|Gutiérrez|p=216|1994|sp=sí}}&lt;/ref&gt; but it was not until 1962 that the university decentralizes its functions and moves to the campus.&lt;ref name=&quot;diagnostico15p&quot; /&gt; The campus features correspond to a scheme totally academic teaching style of L'Ecole des Beaux Arts in Paris, with remarkable symmetry in the arrangement of the elements and pavilions which then lead to a neo-formal lexicon&lt;ref name=&quot;gutierrez217p&quot;&gt;{{harv|Gutiérrez|p=217|1994|sp=sí}}&lt;/ref&gt; that led it to adopt a &quot;style arequipeño&quot; whose formal features transcended the city and were projected to other centers of Peru and the rest of America. {{refn|«Buen ejemplo del neoarequipeño es el edificio del Diario de la Nación de Buenos Aires en la calle Florida, obra del Arq. Pirovano.»&lt;ref name=gutierrez217p_a&gt;Citado en {{harv|Gutiérrez|1994|p=217|sp=sí}}&lt;/ref&gt;|group = nota}}<br /> <br /> ==== Private Universities ====<br /> The first private university established in the city was the Catholic University of Santa Maria, the establishment of this university was followed by San Pablo Catholic University, University of San Francisco.&lt;ref&gt;University of San Francisco. [http://spij.minjus.gob.pe/Normas/sumillas/020909S.pdf ''Creating the Autonomous University of San Francisco'']''&lt;nowiki/&gt;''&lt;/ref&gt; and the University of La Salle, it belongs to International Network of Universities of La Salle, and Javier Prado Private University and Southern University.<br /> <br /> Additionally, in the city are located branches from other universities, as a branch of the [[National University of San Marcos|Universidad Nacional Mayor de San Marcos]], subsidiaries of Néstor Cáceres Velásquez Andean University, Technological University of Peru, Peruvian Wings University; San Pedro Private University, the University del Mar, Chile, the University of Chimbote Los Angeles, School of Business San Francisco Xavier, the Universidad Inca Garcilaso de la Vega and San Martin de Porres University for example-that add universities established in the city of Arequipa.<br /> <br /> {| class=&quot;wikitable sortable&quot; style=&quot;float:center;text-align:center;clear:all;margin-left:15%;font-size:80%&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; width=&quot;70%&quot;<br /> <br /> ! colspan=&quot;4&quot; bgcolor=&quot;#e0e0e0&quot; |<br /> Universities&lt;ref name=&quot;anr19p&quot;&gt;National Assembly of Rectors. &quot;University Statistical Data&quot;, p. 19.&lt;/ref&gt;&lt;ref name=&quot;anr20p&quot;&gt;National Assembly of Rectors. &quot;University Statistical Data&quot;, p. 20.&lt;/ref&gt;<br /> |- bgcolor=&quot;#efefef&quot;<br /> ! width=&quot;60%&quot; |<br /> University<br /> ! width=&quot;20%&quot; |<br /> Installation<br /> ! width=&quot;20%&quot; |<br /> Undergraduates&lt;ref name=&quot;universitarioredatam&quot;&gt;{{cite journal |journal=Instituto Nacional de Estadística e Informática |authorlink=http://desa.inei.gob.pe/cenaun/redatam/ |year=2012 |title=Reporte Universitario REDATAM |url=https://docs.google.com/spreadsheet/ccc?key=0AlWxBwWL6_X6dE9SX3hKQUw3eUtXeDAzWVhfVWJBSlE |accessdate=18 August 2012}}&lt;/ref&gt;<br /> ! width=&quot;20%&quot; |<br /> Main Campus<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''National University of San Agustin'''<br /> | 1828<br /> | 24188<br /> | Arequipa<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''Catholic University of Santa Maria'''<br /> | 1963<br /> | 12268<br /> | Arequipa<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''San Pablo Catholic University'''<br /> | 2004<br /> | 4769<br /> | Arequipa<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''San Francisco University'''<br /> | 2010<br /> | –<br /> | Arequipa<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''University of La Salle'''<br /> | Maestría en Ingeniería del Software Aplicada<br /> | –<br /> | Arequipa<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''Private University of Health Sciences'''<br /> | Maestría en Ingeniería del Software Aplicada<br /> | –<br /> | Arequipa<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''Private Autonomous University of South'''<br /> | Maestría en Ingeniería del Software Aplicada<br /> | –<br /> | Arequipa<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''Javier Prado University&lt;ref name=&quot;javierprado&quot;&gt;{{cite web |url=http://es-la.facebook.com/note.php?note_id=339160186127553 |title=El &quot;boom&quot; de las universidades particulares |accessdate=25 April 2012 |work=Semanario Vista Libre |language=Spanish}}&lt;/ref&gt;'''<br /> | Maestría en Ingeniería del Software Aplicada<br /> | –<br /> | Arequipa<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''San Francisco Xavier University'''<br /> | 2010<br /> | –<br /> | Arequipa<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''Alas Peruanas University&lt;ref name=&quot;alasperuanas&quot;&gt;{{cite web |url=http://www.uap.edu.pe/Esp/DondeEstamos/FilialesUAP/Arequipa/ |title=Página Institucional de la Universidad Alas Peruanas |accessdate=25 April 2012 |work=Dónde estamos}}&lt;/ref&gt;'''<br /> | 2004<br /> | 9743<br /> | Lima<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''José Carlos Mariátegui University&lt;ref name=&quot;mariategui&quot;&gt;{{cite web |url=http://www.universidadmariategui.com/universidadmariategui.html |title=Página Institucional de la Universidad José Carlos Mariategui |accessdate=25 April 2012 |work=La Universidad |language=Spanish}}&lt;/ref&gt;'''<br /> | Maestría en Ingeniería del Software Aplicada<br /> | –<br /> | Lima<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''Néstor Cáceres Velásquez University&lt;ref name=&quot;uncv&quot;&gt;{{cite book |url=http://www.uancv.edu.pe/archivo/memoria2011.pdf |title=Memoria Institucional 2011}}&lt;/ref&gt;'''<br /> | 2006<br /> | 1038<br /> | Puno<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''Technological University of Peru&lt;ref name=&quot;utparequipa&quot;&gt;{{cite web |url=http://www.utpaqp.edu.pe/index.php?option=com_content&amp;task=view&amp;id=15&amp;Itemid=60 |title=Página Institucional de la Universidad Tecnológica del Perú Arequipa |accessdate=25 April 2012|work=UTP Arequipa |language=Spanish}}&lt;/ref&gt;'''<br /> | 2007<br /> | 1201<br /> | Lima<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''San Pedro Private University{{citation needed|date = April 2012}}'''<br /> | 2010<br /> | –<br /> | Chimbote<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''University Los Angeles de Chimbote'''<br /> | 2009<br /> | 344<br /> | Chimbote<br /> |-<br /> | align=&quot;left&quot; |&amp;nbsp;'''University of the Sea&lt;ref name=&quot;mararequipa&quot;&gt;{{cite web |url=http://larevista.aqpsoluciones.com/2011/08/06/carrera-en-prevencion-de-riesgos-y-medio-ambiente-en-arequipa/ |title=Carrera en Prevención de Riesgo de la Universidad del Mar |accessdate=25 April 2012}}&lt;/ref&gt;'''<br /> | 2009<br /> | –<br /> | Chile<br /> |-<br /> ! colspan=&quot;4&quot; style=&quot;color:gray&quot; |<br /> &lt;small&gt;'''Source:''' Second National Census of Universities (2010)&lt;/small&gt;<br /> |}<br /> <br /> == Culture ==<br /> Arequipa culture is marked by the regionalism of its inhabitants. Arequipa, unlike other big Peruvian cities with mestizo and indigenous features, has been highlighted as a &quot;Spanish island in an indigenous sea&quot;, resulting in regional cultural features more clearly defined than in the rest of Peru, being described both culturally and geographically as a cultural and natural oasis.&lt;ref name=&quot;love4p&quot;&gt;{{harv|Love|1995|p=4|sp=sí}}&lt;/ref&gt; This important Spanish presence is documented by many historians and chroniclers such as Ventura Travada y Córdova:<br /> <br /> {{blockquote|«El número de gentes de esta ciudad es apenas 30.000... los negros, mulatos y otros apenas llegan a 6000, todos los demás son españoles, muchos de ellos de conocida nobleza, porque esta ciudad es de las que sobresalen en el reino de gente española cuya sangre procuran no degenerar, celebrando muchos casamientos con españoles llamados huampos. [Estos españoles] al instante que arriban a este reino se aplican al comercio mercantil porque generalmente es uno de los empleos más honrosos...»|Ventura Travada y Córdova&lt;ref name=ventura&amp;travada/&gt;<br /> <br /> }}<br /> <br /> Unlike other regional sentiments within Peru, Arequipa's regionalism was connected to the fight against centralism:<br /> <br /> {{blockquote|«En contraste con otros regionalismos peruanos, especialmente el del Cusco con su singular legado de haber sido la capital del Imperio Incaico, el sentimiento regionalista arequipeño estaba conectado a la lucha contra la política centralista de crear un Estado moderno, alternativa creíble para el centralismo limeño. El regionalismo arequipeño ha logrado evitar ser despedido como un mero provincianismo. Critíca a la política descentralista esfuerzo sobre la base de una reserva de locales, el lugar específico de las imágenes como capital simbólico para validar el éxito material de las clases dominantes regionales.»|Thomas Love, ''Redefining Identity, Maintaining Control in Southwestern Peru''&lt;ref name=love1p&gt;{{harv|Love|1995|p=1|sp=sí}}&lt;/ref&gt;}}<br /> <br /> This proud [[Regionalism (international relations)|regionalism]], expressed in numerous insurrections or revolutions that have earned the city the nickname &quot;Ciudad Caudillo&quot; (Warlord City) or better explained by Peruvian historian Jorge Basadre: &quot;Arequipa is a gun pointed at the heart of Lima ', when making a reference to the antagonism between both cities.&lt;ref name=&quot;guillemete3p&quot; /&gt;<br /> <br /> === Dialect ===<br /> An element of culture in Arequipa City is its Spanish dialect that incorporates a distinctive rhythmic way of speaking, which usually elongates the last vowel of the final word in each sentence. Spanish language in Arequipa, also incorporates several Quechua words, besides the use of the [[Voseo|voseo.]]<br /> <br /> ==== Voseo ====<br /> [[File:Mapa - Paises voseantes.png|thumb|right|Map showing Arequipa]]<br /> Many sources agree that the province of Arequipa is the representative area of Peruvian [[voseo]],&lt;ref name=&quot;guajardo15p&quot;&gt;{{harv|Guajardo Castro|2009|p=15|sp=sí}}&lt;/ref&gt;&lt;ref name=&quot;carricaburo36p&quot;&gt;{{harv|Carricaburo|1997|p=36|sp=si}}&lt;/ref&gt; that is, the use in Spanish language of the pronoun 'vos' to replace the use of 'tú' or 'usted' (all meaning the pronoun 'you'). In Peru, the voseo is sometimes heard only in rural areas except in Arequipa, where that way of speaking is heard in both rural and urban areas.&lt;ref name=&quot;voseoRAE&quot;&gt;{{cite web |url=http://www.rae.es/dpd/?key=voseo |title=Diccionario Panhispánico de Dudas |accessdate=2 February 2009 |author=Real Academia Española de la Lengua |date=October 2005}}&lt;/ref&gt;<br /> <br /> ==== Loncco ====<br /> It is a rural dialect of the city, has been largely lost due to migration from other provinces and the standardization of Castilian by the media in the capital, however, always in schools competitions are promoted lonccos poems.<br /> <br /> {{Quote box|border = 1px|align = left|quote = &lt;poem style=&quot;margin-left: 4px&quot;&gt;<br /> Dicen que los Lonccos somos rudos y vulgares,<br /> también que somos rústicos, toscos y ordinarios:<br /> pueden ponernos todos los apodos que truenen mal,<br /> comparamos con un desgastado cuchillo oxida'u.<br /> pero nunca nos quitaran nuestro modo de hablar.<br /> <br /> No importa, maqueseya cantando o quetimbiando,<br /> nuestro dejo es arequipeño, no es roto, guaso ni limeño.<br /> Loncco es el que madruga con el Lucero matutino,<br /> pa' tomar el primer bebe de agua del fresco manantial<br /> o el primer chorro de leche antes de mamanto del ternero<br /> &lt;/poem&gt;}}<br /> <br /> {{Quote box|border = 1px|align = left|title = Excerpt from &quot;Loncco&quot; Felix Garcia Salas,&lt;br/&gt; &quot;The Poet Loncco&quot; of Arequipa|quote = &lt;poem style=&quot;margin-left: 4px&quot;&gt;<br /> Drolomm…drolóomm…<br /> dos clamores sonaron,<br /> allá en el campanario<br /> de mi pueblito solitario;<br /> dos clamores llorones<br /> que me ccajllaron l’alma,<br /> había muerto mi mama,<br /> la más guapa de las mamas.<br /> <br /> Y las gentes de la útra banda,<br /> chimbando el rio llegaban,<br /> y tuitos puel’alma rezaban<br /> de la qu’en vida jué mi mama”;<br /> tan güeña que era la finada,<br /> tuito el pueblo comentaba,<br /> y cada campanazo que sonaba,<br /> era pa’mí una puñalada.<br /> &lt;/poem&gt;}}<br /> <br /> === Visual arts ===<br /> <br /> Its principle is based or iconographic art of petroglyphs and pre-Columbian pottery. The site with more graphs in stone are the Toro Muerto has been the subject of many studies, most notably those of Dr. Eloy Linares Málaga and Dr. Antonio Núñez Jiménez Cuban.<br /> <br /> His second contribution is the Spanish state and Indo-American, who initially had applications in the size of walls, faces carved churches and altars, des painting appeared as mestizo, which is a naïve tried to recreate the Christian symbolism . The art of deep chiaroscuro, anatomical and ingenuity hieratic provisions lasted for many years since the European Renaissance failed hard because of geographical distance, but so that the increased media and travel advances and ado came to the third stage, which is the art academic and romantic, then arequipeñas wealthy families brought European art, mostly from France, England and Spain, the art, but not high-level teachers, gave the foundation for what would advance the fourth state of our history of fine arts, Carlos Baca Flor, Masias and Reynoso Vinatea preamble contemporary art [[Teodoro Núñez Ureta|Teodoro Nunez Ureta]], Ureta Alejandro Nunez and Luis Palao Berastain among youth of that based on the short edge new American realism and impressionism .<br /> <br /> After the fifth stage amorphous art, symbolist and other current and conceptual styles imported from North America and Europe with vertigo by mass media, among the master of this new era are Ramiro Pareja, Germán Rondon, Ricardo Córdova, the Evaristo and brothers Dario Callo Anco, Erick Huanca, Juan Carlos Zevallos, Companoca and other young master that currently contribute at various isms and boundaries of what is visual art. The Museum of Contemporary Art and the Museum of Arequipa Fundo del Fierro are good benchmarks.<br /> <br /> [[File:Pedro Paulet, padre de la Aeronautica.PNG|thumb|<br /> Pedro Paulet, scientist born in Arequipa in 1874, was one of the first to experiment with rocket propulsion.<br /> ]]<br /> <br /> === Gastronomy ===<br /> {{main|Arequipan cuisine}}<br /> The city has a great diversity of foods compared to many other parts of Peru, with a registered 194 varieties of dishes, which represent 40 entrees, 11 soups or lunches, 11 wines, 70 dishes, 51 desserts and 11 drinks.&lt;ref name=&quot;cornejo44p&quot;&gt;{{harv|Cornejo Velásquez|p=44|2010|sp=sí}}&lt;/ref&gt; The cuisine of the city stands by the use of seasonings and preparation methods introduced by both Andean and Europeans,&lt;ref name=&quot;internaXp&quot;&gt;{{cite journal |title=El egasín, revista interna de Egasa |accessdate=18 August 2012 |author=Various authors |year=2011 |language=Spanish |url=https://docs.google.com/open?id=0B1WxBwWL6_X6VHlDQUwzTk1RNVU}}&lt;/ref&gt; because many dishes were created to satisfy the tastes of Spanish merchants, soldiers and priests who had settled in Arequipa.&lt;ref name=&quot;cornejo54p&quot;&gt;{{harv|Cornejo Velásquez|p=54|2010|sp=sí}}&lt;/ref&gt;<br /> <br /> The eating habits are characterized by a slow diet for each day of the week, this fact shows that in most restaurants and picanterías gets used to prepare on Monday: Chaque, Tuesday: Chairo, Wednesday: Chochoca, Thursday: Suck Colorado or potato flour, Friday: Suck, Saturday: stew or Timpusca and Sunday: white broth or Pebre loins.&lt;ref name=&quot;cornejo47p&quot;&gt;{{harv|Cornejo Velásquez|p=47|2010|sp=sí}}&lt;/ref&gt; This practice follows a global context where food has established fixed schedules and are respected by the population and most restaurants and picanterías city and moved to the availability of specific ingredients in local markets to meet demand according to the day of the week.&lt;ref name=&quot;cornejo48p&quot;&gt;{{harv|Cornejo Velásquez|p=48|2010|sp=sí}}&lt;/ref&gt;<br /> <br /> Among the most popular dishes are the shrimp Suck, Ocopa Arequipa, Rocoto filling Adobo Arequipa, Single cheese, potato cake, fried ribs, Cuy chactado, Cauche cheese, Locro pectoris, Chaque, among others. For dessert highlight the cream cheese, donuts, convent sweets, chocolates, and beverages such as, Chicha de Jora, the region anise (anise or aniseed liqueur).&lt;ref name=&quot;cornejo58p&quot;&gt;{{harv|Cornejo Velásquez|p=58|2010|sp=sí}}&lt;/ref&gt;<br /> <br /> === Literature ===<br /> [[File:Vargas Llosa-PUC.jpg|thumb|right|Jorge Mario Pedro Vargas Llosa (Arequipa, Peru, 28 March 1936) Nobel Prize for Literature in 2010]]<br /> The identity of Arequipa literature is linked to the early nineteenth-century libertarians. [[Mariano Melgar]] is, in that sense, a compulsory reference, as to the quality of his lyrics, his example and his vital attention to the themes and modes land drew the line that would guide the creative writing in his hometown. In the mid-nineteenth century, the poetic voices from Benito Bonifaz, Manuel Castillo, José Mariano Llosa, Ignacio Gamio, among others, gave prestige to the letters Arequipa. Later that century, the novel George, the son of the village (1892), Maria Nieves and Bustamante, on the line of Victor Hugo, in the opinion of Luis Alberto Sanchez, gave us in his interesting 'Introduction', some signs preciosistas White City.<br /> [[File:Mariano Melgar.jpg|thumb|right|Lorenzo Mariano Melgar Valdivieso, Peruvian poet and revolutionary independence]]<br /> <br /> Poetry is heading towards the teaching of [[Manuel González Prada]] vibrant, and there are poems full of ideas and concepts Jorge Polar, philosopher and jurist, author of Arequipa. Description and social studies (1891), whose statement: &quot;Years Arequipa has fought bravely to win free institutions for the Fatherland. Not born in vain at the foot of a volcano &quot;, summarizes the feeling that inaugurated [[Mariano Melgar]] and that in one way or another, is present in Arequipa literature of the nineteenth and much of the twentieth, and the romantic voice of Francisco Mostajo, popular leader, who openly criticized the prevailing tone and advocated without success, the vital airs of modernism in its statements to the wind, 1908.<br /> <br /> The twentieth century imposes rhythm and casually characteristic of youth. In this area appears Group The Coven, with distinctly modernist aspirations. Their representatives make up a generation varied, but a common concern for change. They are in their ranks: Percy Gibson, Cesar Rodriguez Atahualpa, and Renato Federico Morales Agüero Well Rivera. This group Arequipa, sort of &quot;colónidos&quot; (Colónida group of Lima, founded by [[Abraham Valdelomar]] in the decade of 10), to which are added the poets featured Alberto Guillen and Alberto Hidalgo latter a vanguard that has not yet received the recognition it deserves, assumes a freer language, away from the prevailing rhetoric and romantic. His affiliation would be closer to some avant-garde notions.<br /> <br /> The gathering is organized in the halls, and the talents of the poets of the time are not indexed for arequipeño masterfully, but [[Abraham Valdelomar|Valdelomar Abraham]], who evokes an evening of 1910 in the article &quot;The throne of the sun. Notes of a journey.&quot; The Conde de Lemos highlights in it to Percy Gibson author of the verses of the famous waltz Melgar, who put music Benigno Ballon, who invites Colónida write in the journal.<br /> <br /> In this Gibson he published the poem &quot;Democratic Gospel&quot;:<br /> <br /> {{Quote box|Revista Colonida – Percy Gibson, «Evangelio democrático» |border = 1px|align = left|quote = &lt;poem style=&quot;margin-left: 4px&quot;&gt;<br /> ¡Yo soy arequipeño del cogollo,<br /> valeroso, nervudo, de meollo/ volcánico,<br /> fantástico, potente<br /> y lo mismo que yo es cualquier criollo!...&lt;/poem&gt;}}<br /> <br /> For its part, the paradoxes Tower (1926), Cesar Rodriguez Atahualpa, which pays homage to his homeland, as well as his &quot;Song of Arequipa&quot; (1918), set the tone of the regionalist pride to which we have referred at the beginning. This group accounted mamuel happened that Gallego Sanz, brothers Jorge and Xavier Bacacorzo and Guillermo Mercado (1904–1983), the latter poet who started within indigenismo and published, among other books, Golden Soul (1925) A chullo of poems (1928) and Song of Sachaca (1940). The prose had its greatest exponent in the first half of the twentieth century, in the figure of Augusto Morales Aguirre (1888–1957), who left as proof of his masterly novel The People of the sun (the first is around 1924), which managed continental resonance. His works include Dream Flower (1906) and Prayer (1913), poems, and Justice of Huayna Capac (1919), novel.<br /> <br /> Scholar and journalist, Aguirre Morales worked in newspapers and Universal Chronicle. Among his contemporaries are Juan Manuel Osorio and Juan Manuel Polar. Later, Arequipa also produce a noted literary critic, internationally recognized, Enrique Cornejo Quea (1936–1996) who applied the concept so sharply of &quot;diversity&quot; in American literary studies. Born in Arequipa in 1931, Oswaldo Reynoso released in 1961, &quot;The innocent stories&quot;, and in 1964, the novel &quot;In October there are no miracles, who have had multiple reprints. Owner of a poetic prose breath, then posted The beetle and man &quot;(1970)&quot;, In search of Aladdin &quot;(1993) and&quot; The eunuchs immortal &quot;(1995). But undoubtedly the most renowned Arequipa in the field of letters is [[Mario Vargas Llosa]] (1936), [[Anexo:Premio Nobel de Literatura|Nobel Prize for Literature in 2010]] and author among other texts ''of the Hero'' (1964), ''The Green House'' (1966), ''The War of the End of the World'' (1981), ''The Feast of the Goat'' (2000) and inspired by the life of [[Flora Tristan]], ''The Paradise on the other corner'' (2003).<br /> <br /> Arequipa maintains an intense literary life, to mention a few names of different generations, quote Jose Ruiz Rosas, poet who, although born in Lima (1928), developed his poetic valuable in the city of Arequipa and currently resides in this, among others, the poems Grocery (1978), Poems (1980), gathered Poetry (1992) in the White City; Oswaldo Chanove (1953), poet, author of The Hero and his relationship with the heroine (1983), Study on the action and passion (1987) y.el Pale Rider (1994), or Carlos Herrera (1961), the original focus narrator who posted black and white (1995) and blind Argonaut Chronicles (2002).<br /> <br /> === Museums and cultural centers ===<br /> [[File:Teatro Municipal de Arequipa Pano.jpg|thumb|right|Teatro Municipal de Arequipa, built in commemoration of the fourth centenary of the Spanish founding of Arequipa]]<br /> Cultural events are mainly in the cultural institutes, organizations such as the Alliance Française, the Peruvian Center for German and Peruvian North American Cultural Center organized activities around the arts, music, dance and literature, among others. Meanwhile, the Centro Cultural de la Rosa Chaves National University of San Agustin and the Catholic University of Santa Maria promote cultural activities.&lt;ref name=&quot;López53p&quot;&gt;{{harv|sp=sí|López de Romaña|2006|p=53}}&lt;/ref&gt;<br /> <br /> In the 1990s banking institutions showed great interest in promoting and managing cultural activities, private companies, meanwhile, joined this movement by sponsoring various projects.&lt;ref name=&quot;López54p&quot;&gt;{{harv|sp=sí|López de Romaña|2006|p=54}}&lt;/ref&gt;<br /> <br /> * '''Cathedral Museum'''&lt;ref&gt;[http://www.andina.com.pe/espanol/Noticia.aspx?id=rx/v4rI7Em4= Andina: New Museum of Arequipa Cathedral opens its doors]&lt;/ref&gt;<br /> * '''Virtual Hall of Arequipa,'''&lt;ref&gt;Provincial Municipality Virtual Room Arequipa&lt;/ref&gt; located at the &quot;Gateway to the City&quot; are contained several aspects of urban town of the historic center of Arequipa, more precisely the area that has been declared as a World Heritage Site and some nearby; here shows the evolution of the architecture over time arequipeña.<br /> * '''Regional Museum of the Central Reserve Bank.'''&lt;ref&gt;Andean [http://www.andina.com.pe/Espanol/Noticia.aspx?id=vo4syk8tHsM= BCR Museum].&lt;/ref&gt; The center has a numismatic room, where you can see notes and coins that were minted in the Central Reserve Bank of Arequipa in the sixteenth and seventeenth centuries. The museum also has a gallery comprising 17 eighteenth-century paintings of the Cusco School, and archaeological pieces in metal and ceramics from the Chavin, Chimu, Moche, Viru, Recuay, Nasca and Inca.<br /> * '''Archaeological Museum José María Morante'''&lt;ref&gt;[http://www.unsa.edu.pe/index.php?option=com_content&amp;amp;view=article&amp;amp;id=344&amp;amp;Itemid=347 UNSA Museum]&lt;/ref&gt;<br /> * '''Archaeological Museum of the University of St. Augustine''', located in a seventeenth-century mansion, the museum exhibits a varied collection comprising lithic, bone remains of human sacrifices, pottery elementary and pre-Columbian textiles.&lt;ref name=&quot;López54p&quot; /&gt;<br /> <br /> [[File:Mac arequipa.jpg|left|thumb|right|Virtual Hall of Arequipa, located in City Hall, opened in June 2003]]<br /> * '''UCSM Archaeological Museum,'''&lt;ref&gt;[http://www.deperu.com/arqueologia/museos2.html Guide Museums: Archaeological UCSM]&lt;/ref&gt; displays about 1000 objects developed different cultural groups in the region from 12 000 a year.&amp;nbsp;C. until the colony: Nasca, Tiahuanaco, Wari, Churajón, Acari, Aruni and Inca, and colonial and transitional material.<br /> * '''Andean Sanctuaries''' Museum of the Catholic University of Santa Maria, was created on 26 March 1997, following the significant archaeological research by Project 'height Sanctuaries Southern Andes &quot;, led by Professors [[Johan Reinhard]] and Jose Antonio Chavez.&lt;ref&gt;{{cite web |author=Universidad Católica de Santa María |title=Museo Santuarios Andinos |url=http://www.ucsm.edu.pe/santury/|accessdate=22 September 2012}}&lt;/ref&gt; In this museum is the Mummy Juanita who was sacrificed on Mount Ampato, despite being an attractive displays, museum work has been questioned.&lt;ref name=&quot;López54p&quot; /&gt;<br /> * Numismatic Museum<br /> * '''Museum of Contemporary Art,'''&lt;ref name=&quot;López55p&quot;&gt;{{harv|López de Romaña|p=55|sp=sí|2006}}&lt;/ref&gt; is devoted to painting and photography from 1900 onwards, houses an interesting collection of twentieth-century art, photography and exhibitions of Miguel Vargas and Carlos Vargas, Cusco photographer Martin Chambi, was mentor of the two brothers, that through his work documenting daily life and customs of the city of Arequipa twentieth-century. Also on display are works by young local artists, paintings [[Fernando de Szyszlo|of]] Peruvian artists like [[Fernando de Szyszlo|Fernando]] and [[Carlos Enrique Polanco]] [[Fernando de Szyszlo|Szyszlo]], Ramiro Llona, José Tola, Gerardo Chavez, Natalia Iguíñiz, Jaime Higa, Light Letts, Carlos Runcie Tanaka, Amelia Weiss, Claudia Cuzzi and Venancio Shinki.<br /> * '''Museum of Natural History,'''&lt;ref&gt;[http://museohn.unmsm.edu.pe/ Natural History Museum]&lt;/ref&gt; located in the metropolitan district of Yanahuara, under the administration of the convent of La Recoleta.<br /> * '''Museo de Santa Catalina'''&lt;ref&gt;[http://www.santacatalina.org.pe/ Museum of Santa Catalina]&lt;/ref&gt;<br /> * '''Graphic Museum Gazette,''' the house museum located in Bolivar, it shows the evolution of writing from cave paintings to the first printing presses and machinery involved in the production process of official gazette '''El Peruano.''' In this museum you can see the resolution of Arequipa passport and Original Declaration in which Arequipa is declared on 4 September 1882 as &quot;Capital of Peru&quot;.<br /> * Colonial Art Museum Santa Teresa<br /> * Columbian Museum La Recoleta<br /> * Chiribaya Culture Museum<br /> * '''The Amazonian Museum,''' located in the district of Yanahuara exhibiting objects from the activity of the missionaries in the jungle during the XVI, XVII, XVIII.<br /> * '''Forestry Museum Ecological Police,''' this museum located in the metropolitan district of Paucarpata has a sample of more than 300 animal species of Peruvian wildlife, especially the one in danger of extinction. Also has 35 live animals.<br /> <br /> === Music ===<br /> Since late viceroyalty there are important academic composers like [[Mariano Melgar]] (who was best known in his role as poet), Pedro Jiménez Tirado April and Florentino Diaz is apparently coming to Arequipa one of the cities in the country with more of the best composers and musical training.&lt;ref name=&quot;musica&quot;&gt;{{cite book |author=Patronato Popular y Porvenir Pro Música Clásica |title=La Música en el Perú |year=1985|work=Lima, Perú: Patronato Popular y Pro Música Clásica|page=121|url=http://books.google.com.pe/books?ei=fgMqT5m1IJDUgQeI6vnQDw&amp;id=fMxbAAAAMAAJ&amp;dq=la+musica+en+el+peru&amp;q=parece+ser+Arequipa#search_anchor}}&lt;/ref&gt;<br /> <br /> In the Republican era include Manuel Aguirre who assimilated the teachings of Chopin and Schuman to give them some melanconlia and simplicity to his music. Similarly, Luis Duncker Lavalle-a master pianist who can speak both academic folk-music as Octavio Polar, Manuel Aguirre, David H. Molina, who spread his orchestral works with the Association of Arequipa and Aurelio Diaz Espinoza who was author of the Hymn of Arequipa. Also, with a more modernist highlights Carlos Sanchez Malaga. Later in the twentieth century include Roberto Ramirez-Ortiz Zevallos, Roberto Carpio Valdez, Juan Francisco Ballon Ballon, Armando Sanchez-Málaga and Benigno Ballón Farfán González, author of numerous yaravíes, sailors and popular waltz ''Melgar.''&lt;ref name=&quot;garayar65p&quot;&gt;{{harv|Garayar|p=65|2004|sp=sí}}&lt;/ref&gt;<br /> <br /> === Symbols ===<br /> <br /> ==== Coat of arms ====<br /> Nearly a year after the founding of the town, King [[Charles V, Holy Roman Emperor|Charles I of Spain]] elevated it to the rank of [[city]] by royal decree on 22 December 1540, awarding it a coat of arms on which a mythical animal carries a banner with the inscription ''Karlos V'' or ''Del Rey.''&lt;ref name=&quot;palma30p&quot; /&gt; Peruvian writer [[Ricardo Palma]] in his ''Peruvian Traditions,'' explains the position and meaning of some components in the shield based on the report of a chronicler with knowledge of heraldry. In Palma's tradition of ''&quot;The godson of providence&quot;'', it is explained:<br /> <br /> {{blockquote|«Such Democrat who writes this —understands nothing of Heraldry— Thus listen to the explanation of such allegory, that a chronicler gives: Says he, that the inscription of the flag; expresses the way in which the King took possession of Arequipa, that when he placed that One(flag)— not under the feet but in the hand of &quot;The Griffin&quot;— so wished the monarch to manifest his appreciation for the city; not stepping on her like a servant one, instead giving her a hand as a favored one. If there exists one who explains this better, his finger he may raise...(English translation)»|'''Ricardo Palma''', ''Tradiciones Peruanas''&lt;ref name=palma30p/&gt;}}<br /> <br /> ==== Flag ====<br /> The origin of the crimson flag of the city has been a subject of debate among historians. In 1940 various scientific publications such as those by historians Francisco Mostajo and Victor M. Barriga firmly confirmed the crimson color of the banner, as opposed to the blue banner proposed as the original by historian Victor Benavente. This matches the color used in sports activities in the city.&lt;ref name=&quot;galdos246p&quot;&gt;{{harv|Galdós Rodríguez|p=246|1997|sp=sí}}&lt;/ref&gt;&lt;nowiki&gt; On September 2, 1940, Francisco Mostajo sent a letter to the Mayor of the City to explain his views regarding the color of the Banner of Arequipa, basing his claims on the '&lt;/nowiki&gt;''Act of the oath of King Carlos III'' ''&quot; of'' 11 August 1788. On September 23 of the same year, Father Victor M. Barriga also published an important document in the Catholic newspaper ''El Deber'' that contains a description of the royal standard of Arequipa found in the ''&quot;Act of 3 September 1789&quot;.''&lt;ref name=&quot;neira354p&quot;&gt;{{harv|Neira|p=354|1990|sp=sí}}&lt;/ref&gt;<br /> <br /> Both of these documents state that the standard color is crimson and that its origins date back to the colonial flag of the city, which is described as cited:&lt;ref name=&quot;neira356p&quot;&gt;{{harv|Neira|p=356|1990|sp=sí}}&lt;/ref&gt;<br /> <br /> {{blockquote|«(For the Celebration of the Royal feasts of Proclamation and the Oath of the King Sir Carlos IV. The illustrious Council had mandated to make in advance —a new crimson velvet emblem with the Royal coat of arms and the city coat of arms adorned with gold overlay— which was fastened to an exquisitely carved mast, which culminated in a spear head; thereof hanged two crimson silk cords with tassels thus completing an exquisite ensemble. A canopy: with throne cloth panels, pillows and bench covers with both fringe and tassels of gold.) Para la celebración de las fiestas reales de proclamación y jura del rey don Carlos IV, había mandado el Ilustre Cabildo hacer con anticipación un nuevo estandarte de terciopelo carmesí, con los escudos de Arreas Reales y de la Ciudad, guarnecido de sobrepuesto de oro, el cual estaba asido de una asta primorosamente labrada, rematando ésta en una lengueta de espolón, desde cuya garganta pendían dos cordones de seda carmesí con sus borlas, que hacían primoroso juego. Un dosel, paños de sitial, cojines y sobrebancas con flecos y rapacejos de oro.»|''Juramento, proclamación y fiestas populares que hicieron celebrar en esta ciudad el Intendente D. Antonio Álvarez y Jiménez y el Alférez Real D. Manuel Flores del Campo en homenaje al Rey Carlos IV, con motivo de su exaltación al trono de España (Oath, Proclamation and Popular feasts whom mandated to celebrate in this city the Foreman D. Antonio Álvarez y Jiménez and the Royal Ensign D. Manuel Flores del Campo in homage to the King Carlos IV on the occasion of his exaltation to the throne of Spain) ''&lt;ref name=galdos245p&gt;{{harv|Galdós Rodríguez|p=245|1997|sp=sí}}&lt;/ref&gt;}}<br /> <br /> ==== Anthem ====<br /> The anthem of the city is called the ''Fourth Centenary Anthem.'' It was written by Emilio Pardo Valle with music by Aurelio Diaz Espinoza, who won a contest organized by the city council in 1939 for the creation of the music and lyrics of the anthem. The award was given in 1940 and the hymn has been sung ever since at all important civic events held in the city.&lt;ref name=&quot;himno&quot;&gt;{{cite book |url=http://books.google.com.pe/books?id=YDplAAAAMAAJ |title=Arequipa: su pasado, presente y futuro |accessdate=17 September 2009 |author=Adela Pardo Gamez de Belaunde |date=20 February 2002 |format=PDF |language=Spanish}}&lt;/ref&gt;<br /> <br /> ==== Names and Honorific Titles ====<br /> '''Very noble and very loyal'''<br /> Arequipa was one of the cities of the [[Viceroyalty of Peru]] that received frequent and intense praise for its weather and its loyalty&lt;ref name=&quot;historia&quot;&gt;[http://sisbib.unmsm.edu.pe/BibVirtual/libros/Literatura/melgar/en_arequipa.htm History and legend, Mariano Melgar]&lt;/ref&gt; Among the praises for the city found in the literature is a reference in the play &quot;[[La Galatea]]&quot; by classic Spanish writer Miguel de Cervantes Saavedra, who mentions that the Spanish poet Diego Rivera Martinez, having been to Arequipa, praised the city&lt;ref name=&quot;historia&quot; /&gt; with the phrase &quot;In Arequipa, eternal spring&quot;.&lt;ref&gt;Miguel de Cervantes Saavedra. La Galatea, The song of Calliope, Madrid (1585), the reference to Martinez de Ribera, in 66 and 67 octaves.&lt;/ref&gt;<br /> <br /> The city was also awarded various distinctions and titles by the Spanish Crown such as its Coat of Arms and the titles of Very Noble and Loyal, Faithful, and the treatment of Excellence.&lt;ref name=&quot;neira226p&quot;&gt;{{harv|Neira|p=226|1990|sp=sí}}&lt;/ref&gt;<br /> <br /> '''Most Faithful'''<br /> One aspect that distinguished Arequipa from other areas of Peru and Lima in particular is the explicit public commitment of the city to the Spanish crown and the close following of its directives. This phenomenon was called &quot;fidelism&quot; and had some notable defenders in Francisco de Paula Quiroz, Mariano de Rivero, Nicólas Fernández, and José Miguel de Aubrey. Since its Spanish foundation and over three centuries the city was mostly inhabited by families of Spanish origin. One reason that contributed to maintaining and strengthening fidelism was obviously the prevalence of Spanish people in high society and their representative organizations.&lt;ref name=&quot;caceres128p&quot;&gt;{{harv|Cáceres-Péfaur|2006|sp=sí|p=128}}&lt;/ref&gt; Another factor was geographical because given the city's location it was not likely to be influenced by regions with libertarian movements or by areas with large concentrations of indigenous people.&lt;ref name=&quot;caceres128p&quot; /&gt;<br /> <br /> The ruling classes and city leaders were always faithful and loyal to the Spanish crown during the sixteenth and seventeenth centuries. In the eighteenth century, upon the rise of movements and rebellions from the indigenous and mestizo population, Arequipa retained its political balance. During the Tupac Amaru II uprising the city assembled at its own expense a column of troops that helped destroy the siege of the city of La Paz.&lt;ref name=&quot;neira227p&quot;&gt;{{harv|Neira|p=227|1990|sp=sí}}&lt;/ref&gt; This earned the city the epithet of &quot;Restorative province of the Collao ». For these services the King Carlos IV also issued a royal decree in the city of San Lorenzo on 5 December 1805 in which he conferred the title and the name of &quot;Most Faithful&quot; to the city.&lt;ref name=&quot;neira228p&quot;&gt;{{harv|Neira|p=228|1990|sp=sí}}&lt;/ref&gt;<br /> <br /> '''Excellence '''The city received a treatment of &quot;excellence&quot; by a royal decree issued in the city of Madrid on 16 November 1818. This distinction was granted following reports submitted by Don Hipólito Unanue, deputy of the province of Arequipa and the Municipality of the city, of Arequipa's involvement in defending the royal cause in the uprising of the city of La Paz in 1809.&lt;ref name=&quot;neira228p&quot; /&gt;<br /> <br /> '''Heroic City of the Free'''<br /> In the republican era, a decree issued by General Orbegoso ordered that the department and its capital city be denominated &quot;Department of Law&quot; and &quot;heroic city of the free&quot;.&lt;ref name=&quot;neira438p&quot;&gt;{{harv|Neira|p=438|1990|sp=sí}}&lt;/ref&gt; General Orbegoso installed his government in Arequipa in 13 January 1835 and, as a consequence, General [[Felipe Santiago Salaverry]] named himself Supreme Chief of the Republic with the pretext that the country was leaderless, i.e. without President, as Orbegoso was outside the capital of Lima.&lt;ref name=&quot;congreso.gob.pe&quot;&gt;[http://www.congreso.gob.pe/museo/mensajes/a-Mensaje-1835-1.pdf Decree assuming command of the Republic General Felipe Santiago Salaverry, February 25, 1835] .&lt;/ref&gt;<br /> <br /> == Sports ==<br /> Among the scenarios that the city has for the practice of football we mention Virgen de Chapi Stadium (property of San Agustin National University), [[Estadio Mariano Melgar|Mariano Melgar Stadium]], Los Palitos Stadium and Umacollo Stadium.<br /> <br /> === Soccer ===<br /> Association football or Soccer is the most popular sport in Arequipa, with the most popular team being Melgar F.C. This team currently plays in the Peruvian [[Peruvian Primera División|First Division]] of association football, winning its first national championship in 1981.&lt;ref name=&quot;almanaque2002&quot;&gt;{{cite book |authorlink= http://www.inei.gob.pe |title=Almanaque de Arequipa 2002 |url= |editor=INEI |page=169}}&lt;!--|accessdate=3 August 2012--&gt;&lt;/ref&gt;<br /> <br /> == Law and Government ==<br /> Arequipa, as the capital of the [[Arequipa Province|province]], is governed by the Provincial Municipality of Arequipa that has jurisdiction over the entire territory of the province. The district municipalities within the province also have jurisdiction over matters relating to their own districts.<br /> <br /> The city, as the regional capital, is home to the ''Regional Government of Arequipa.'' It is also headquarters of the different regional offices of [[Council of Ministers of Peru|ministries]] that make up the Civil Government of Peru.<br /> <br /> === City administration ===<br /> <br /> The Provincial Municipality of Arequipa regulates important citywide, metropolitan and [[Arequipa Province|provincial]] issues like urban planning, [[transport]], municipal [[tax]] collection, management of road safety (jointly with the [[Municipal police (Spain)|local police]]), the maintenance of public roads and urban greenery, etc. It is also responsible for the construction of municipal facilities such as sports centers, libraries and social services centers.&lt;ref name=&quot;reglamento1p&quot;&gt;{{cite journal |author=Municipalidad Provincial de Arequipa |title=Reglamento Interno del Concejo de la Municipalidad Provincial de Arequipa |publisher=Información General de la Municipalidad Provincial de Arequipa |url=http://www.muniarequipa.gob.pe/transparencia/informacion_general/Reglamento%20Interno%20del%20Concejo.pdf |accessdate=19 August 2012 |language=Spanish}}&lt;/ref&gt;<br /> <br /> {| class=&quot;wikitable&quot; style=&quot;text-align:center; width:80%;&quot;<br /> |+<br /> &lt;nowiki&gt; &lt;/nowiki&gt;List of mayors of Arequipa in recent years<br /> !<br /> Period<br /> !<br /> Mayor<br /> !<br /> Political party<br /> |-<br /> |1994–1995<br /> |Fernando Sebastián Ramírez Alfaro<br /> |Neighborhood Unity Front&lt;ref&gt;{{cite web |url=http://www.infogob.com.pe/Localidad/ubigeoprocesodetalle.aspx?IdUbigeo=040100&amp;IdTab=0&amp;IdProceso=50 |title=Detalles del Proceso Electoral – Elecciones Municipales de 1993 |accessdate=27 August 2012 |authorlink=http://www.jne.gob.pe/ |editor=Observatorio de la Gobernabilidad |work=Jurado Nacional de Elecciones |language=Spanish}}&lt;/ref&gt;<br /> <br /> |-<br /> <br /> |1996–1998<br /> |Roger Luis Caceres Peréz<br /> |FRENATRACA&lt;ref&gt;{{cite web |url=http://www.infogob.com.pe/Localidad/ubigeoprocesodetalle.aspx?IdUbigeo=040100&amp;IdTab=1&amp;IdProceso=43 |title=Detalles del Proceso Electoral – Elecciones Municipales de 1995 |accessdate=27 August 2012 |authorlink=http://www.jne.gob.pe/ |editor=Observatorio de la Gobernabilidad |work=Jurado Nacional de Elecciones |language=Spanish}}&lt;/ref&gt;<br /> <br /> |-<br /> <br /> |1999–2002<br /> |Juan Manuel Guillen Benavides<br /> |Arequipa.Tradition and future&lt;ref&gt;{{cite web |url=http://www.infogob.com.pe/Localidad/ubigeoprocesodetalle.aspx?IdUbigeo=040100&amp;IdTab=1&amp;IdProceso=37 |title=Detalles del Proceso Electoral – Elecciones Municipales de 1998 |accessdate=27 August 2012 |authorlink=http://www.jne.gob.pe/ |editor=Observatorio de la Gobernabilidad |work=Jurado Nacional de Elecciones |language=Spanish}}&lt;/ref&gt;<br /> <br /> |-<br /> <br /> |2003–2006<br /> |Peyson Yamel Romero Peralta<br /> |APRA&lt;ref&gt;{{cite web |url=http://www.infogob.com.pe/Localidad/ubigeoprocesodetalle.aspx?IdUbigeo=040100&amp;IdTab=1&amp;IdProceso=03 |title=Detalles del Proceso Electoral – Elecciones Municipales de 2002 |accessdate=27 August 2012 |authorlink=http://www.jne.gob.pe/ |editor=Observatorio de la Gobernabilidad |work=Jurado Nacional de Elecciones |language=Spanish}}&lt;/ref&gt;<br /> <br /> |-<br /> <br /> |2007–2011<br /> |Simon Balbuena Marroquín<br /> |[[Peruvian Nationalist Party|PNP]]&lt;ref&gt;{{cite web |url=http://www.infogob.com.pe/Localidad/ubigeoprocesodetalle.aspx?IdUbigeo=040100&amp;IdTab=1&amp;IdProceso=19 |title=Detalles del Proceso Electoral – Elecciones Municipales de 2006 |accessdate=27 August 2012 |authorlink=http://www.jne.gob.pe/ |editor=Observatorio de la Gobernabilidad |work=Jurado Nacional de Elecciones |language=Spanish}}&lt;/ref&gt;<br /> <br /> |-<br /> <br /> |2011–2015<br /> |Zegarra Alfredo Tejada<br /> |Arequipa Reborn&lt;ref&gt;{{cite web |url=http://www.infogob.com.pe/Localidad/ubigeoprocesodetalle.aspx?IdUbigeo=040100&amp;IdTab=1&amp;IdProceso=93 |title=Detalles del Proceso Electoral – Elecciones Municipales de 2010 |accessdate=27 August 2012 |authorlink=http://www.jne.gob.pe/ |editor=Observatorio de la Gobernabilidad |work=Jurado Nacional de Elecciones |language=Spanish}}&lt;/ref&gt;<br /> <br /> |-<br /> |}<br /> <br /> === Seat of the Constitutional Court ===<br /> [[File:Grau Bridge, Zemanat, Arequipa.jpg|thumb|right|Grau Bridge View from the district of Selva Alegre]]<br /> {{main|Constitutional Court of Peru}}<br /> <br /> The Constitutional Court is the highest authority and control interpretation of the Constitution. It is autonomous and independent of other constitutional bodies. Subject only to the Constitution and the Organic Law. The court has seven judges elected by the Congress with the favorable vote of at least two thirds of the legal number of members for a period of five years.<br /> <br /> The city is the ''&quot;Legal Capital of Peru&quot;'' and ''&quot;Official Headquarters of the Constitutional Court&quot;,''&lt;ref name=&quot;coaguila4p&quot;&gt;{{harv|Coaguila Valdivia|p=4|2010|sp=sí}}&lt;/ref&gt; as a result of a project decentralist the first vice presidential candidate, Manuel Seoane Corrales, who proposed the initiative of the city of Arequipa was the headquarters of the Superior Court of Justice, which would make the city was the Legal Capital of Peru. Due to the military coup that began in Peru, the initiative was in the air, to be reborn after the election of the Constituent Assembly in 1978. This time, the initiative did not succeed due to the high opposition, but later concluded that Arequipa would host the then &quot;Constitutional Court&quot;, as stated in Article 304 º of the Constitution of Peru, 1979: ''&quot;The Constitutional Court is based in the city of Arequipa &quot;.''&lt;ref name=&quot;juridica04&quot;&gt;{{cite web |url= http://www.mariorommelarce.com/portal/la-tradicion-juridica-de-arequipa/ |title=La tradición jurídica de Arequipa |accessdate=3 August 2012 |last=Rommel Arce |first=Mario}}&lt;/ref&gt;<br /> <br /> Later, by the Constitution of 1993, created the &quot;Constitutional Court&quot;, which, according to its Charter, is based in Arequipa, although under Regulation Regulatory Constitutional Court.&lt;ref name=&quot;tribunal2p&quot;&gt;Regulation Regulatory Constitutional Court, p. 2.&lt;/ref&gt;<br /> <br /> === Administrative division ===<br /> The city is bounded by the district lines that comprise his constituency, the figure for the same population of the city is not adjusted to the total population of the districts that could be partially or fully recitals within the city, as RENIEC entities considered that the city is divided into 15 administrative districts, coordinated by the provincial municipality, which in turn are subdivided into [[district]]s,&lt;ref&gt;{{cite web |url=http://www.reniec.gob.pe/portal/html/estadistica/images/GG08_PobElec_Ciudad_Arequipa.pdf |title=Distritos de Arequipa |editor=RENIEC |accessdate=11 July 2012}}&lt;/ref&gt; however INEI uses other methodologies for the delimitation of the city.<br /> <br /> &lt;center&gt;<br /> {| class=&quot;wikitable sortable&quot; style=&quot;float:center;text-align:center;clear:all;margin-left:25%;font-size:84%&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; width=&quot;50%&quot;<br /> <br /> ! align=&quot;center&quot; width=&quot;20&quot; |<br /> &lt;nowiki&gt; &lt;/nowiki&gt;No.<br /> ! align=&quot;center&quot; width=&quot;150&quot; |<br /> &lt;nowiki&gt; &lt;/nowiki&gt;District<br /> ! align=&quot;center&quot; width=&quot;20&quot; |<br /> &lt;nowiki&gt; &lt;/nowiki&gt;No.<br /> ! align=&quot;center&quot; width=&quot;150&quot; |<br /> &lt;nowiki&gt; &lt;/nowiki&gt;District<br /> |-<br /> | align=&quot;center&quot; | 1<br /> | align=&quot;center&quot; | [[Arequipa District|Downtown]]<br /> | align=&quot;center&quot; | 7<br /> | align=&quot;center&quot; | Paucarpata<br /> |-<br /> | align=&quot;center&quot; | 2<br /> | align=&quot;center&quot; | Cayma<br /> | align=&quot;center&quot; | 8<br /> | align=&quot;center&quot; | James Hunter<br /> |-<br /> | align=&quot;center&quot; | 3<br /> | align=&quot;center&quot; | [[Cerro Colorado District|Cerro Colorado]]<br /> | align=&quot;center&quot; | 9<br /> | align=&quot;center&quot; | Miraflores<br /> |-<br /> | align=&quot;center&quot; | 4<br /> | align=&quot;center&quot; | Sachaca<br /> | align=&quot;center&quot; | 10<br /> | align=&quot;center&quot; | Tiabaya<br /> |-<br /> | align=&quot;center&quot; | 5<br /> | align=&quot;center&quot; | Yanahuara<br /> | align=&quot;center&quot; | 11<br /> | align=&quot;center&quot; | [[José Luis Bustamante District|JL Bustamante y Rivero]]<br /> |-<br /> | align=&quot;center&quot; | 6<br /> | align=&quot;center&quot; | Alto Selva Alegre<br /> | align=&quot;center&quot; | 12<br /> | align=&quot;center&quot; | [[Mariano Melgar District|Mariano Melgar]]<br /> |-<br /> | align=&quot;center&quot; | 7<br /> | align=&quot;center&quot; | Sabandía<br /> | align=&quot;center&quot; | 14<br /> | align=&quot;center&quot; | Socabaya<br /> |-<br /> ! colspan=&quot;5&quot; align=&quot;center&quot; | <br /> &lt;small&gt;Source: National Institute of Statistics and Informatics &lt;/small&gt;<br /> |}<br /> &lt;/center&gt;<br /> <br /> ==== Metropolitan area ====<br /> The metropolitan area is to head to the city and consists of 19 districts with metropolitan category,&lt;ref name=&quot;muni23p2012&quot;&gt;{{harv|García de los Reyes Arquitectos y Asociados|2012b|p=|sp=sí}}&lt;/ref&gt; extends over a surface of {{convert|305798|acres|0|abbr = off}} of which {{convert|10142|acres|0|abbr = on}} are distinctly urban.&lt;ref name=&quot;muni36p2012a&quot;&gt;{{harv|García de los Reyes Arquitectos y Asociados|2012a|p=36|sp=sí}}&lt;/ref&gt; A metropolitan level unemployment level reaches the level of 8%,&lt;ref name=&quot;muni23p2012&quot; /&gt; in contrast to 5% unemployment in the city.&lt;ref name=&quot;america2011&quot; /&gt;<br /> <br /> == Sights and attractions ==<br /> <br /> === The Old Town ===<br /> {{main|Historic Centre of Arequipa}}<br /> [[File:Centro Histórico de la ciudad de Arequipa (mapa).jpg|thumb|Map showing Arequipa]]<br /> In its 332 hectares&lt;ref name=&quot;compendio80p&quot;/&gt; has 5817 properties&lt;ref name=&quot;diagnostico39p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 39.&lt;/ref&gt; of which 500 are categorized as heritage properties, generally have been built in the nineteenth century, on the site of earlier colonial buildings destroyed by the earthquake of 1868. The houses, usually made in [[ashlar]], are characterized by semi-circular arches and vaulted ceilings. Ashlar structures always have thick walls: 1 to 1.5 meters for rooms, 2 meters for churches. Through the use of lime mortar, the walls are shown homogeneous image that is reinforced with brick vaults or ashlar that are justified in the rarity of the wood.&lt;ref name=&quot;diagnostico40p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 40.&lt;/ref&gt;<br /> <br /> In the city itself is a stylistic school called &quot;School Arequipa&quot; of crucial importance in the region and whose influence reached Potosi. This school is characterized by profuse decoration planiform textilográfica and the open spaces and the design and size of their covers, which differ in these aspects of Cuzco and Lima covers.&lt;ref name=&quot;cristobal16p&quot;&gt;{{harv|San Cristobal Sebastian|2009|p=16|sp=sí}}&lt;/ref&gt;<br /> <br /> The architecture in the historic center is characterized by the prominence of ashlar, the use of which begins in the last third of the s. XVI. This volcanic stone, white or pink exceptionally soft, lightweight, and weatherproof, emerged as a seismic structural solution. The ashlar was unable to take the early years, except for the covers of the main church and some houses. The original city was built with adobe, masonry, sticks and straw roofs or mud pie. Houses of this type were made until the nineteenth century and were common in the eighteenth century, some remain in the original district of San Lazaro. Later came the brick and tile houses with tile found in the Monastery of Santa Catalina. The cataclysm of 1582 settled these systems and raised the earthquake reconstruction. Then came the ashlar as prime structural solution.&lt;ref name=&quot;diagnostico18p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 18.&lt;/ref&gt;<br /> <br /> Major earthquakes which milestones in the formation of Arequipa architecture. You can mention five periods:<br /> {{Columns<br /> |col1=* Founding and village (1540–1582),<br /> * Splendor of Baroque (1582–1784),<br /> * Rococo and Neoclassical Reviews (1784–1868),<br /> |col2=* Empiricism and modernizing<br /> * Evocations neo colonial (1868–1960) and<br /> * Contemporary.<br /> }}<br /> [[File:Cafes, San Francisco, Arequipa.JPG|thumb|right|San Francisco Street is one of the main places where since the 50s settled nightclubs, gourmet restaurants and bars refined]]<br /> [[File:Iglesiacompañia.jpg|thumb|right|Church of the Jesuits]]<br /> <br /> ==== Religious Monuments ====<br /> [[File:Centro, Santa Catalina, Arequipa.jpg|thumb|right|Monasterio de Santa Catalina]]<br /> In historical existence is accounted for 14 churches or temples, four chapels, five convents and 3 monasteries,&lt;ref name=&quot;diagnostico65p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 65.&lt;/ref&gt; among the monuments of this type include:<br /> * [[Basilica Cathedral of Arequipa]]<br /> It is the most important neoclassical ediicio Peru, product reconstruction started in 1844 and finished three years later and led by architect Lucas Poblete.&lt;ref name=&quot;humanity&quot;&gt;UNESCO. History of Humanity, p. 221.&lt;/ref&gt; Its interior is faced with trs ships with one of the side walls of the main square which fills a side façade is divided by Corinthian columns.&lt;ref name=&quot;fergusson432p&quot;&gt;{{harv|Fergusson|p=432|sp=sí|}}&lt;/ref&gt;<br /> <br /> * Church of the Company<br /> It is the monument maximum Arequipeña School,&lt;ref name=&quot;benavides73p&quot;/&gt; is one of the most splendid creations of Peruvian Baroque and starting point of this school,&lt;ref name=&quot;arellano256p&quot;&gt;Arellano, p. 256.&lt;/ref&gt; in its façade has an inscription inscribed with the year 1698 which shows that the beginning of the eighteenth century this regional art had reached its peak, therein lies a more exaggerated baroque altar.&lt;ref name=&quot;benavides74p&quot;&gt;{{harv|Benavides|p=74|1990|sp=sí}}&lt;/ref&gt;<br /> <br /> * [[Santa Catalina Monastery|Convent of Santa Catalina]]<br /> <br /> ==== Civil-Public Monuments ====<br /> {{blockquote|«Pétrea ciudad adusta. Sólida trabazón de viviendas donde el sillar es símbolo de la psicología colectiva: roca y espuma; dureza y ductilidad. Amalgama de fuego, en que el aliento del volcán funde y anima las piedras y las almas»|José Luis Bustamente y Rivero (President of Perú 1945–1948)&lt;ref name=elogio&gt;José Luis Bustamante y Rivero ''Una visión del Perú. Elogio de Arequipa''. Ediciones P.L.V. Lima, 1972.&lt;/ref&gt;}}<br /> There are 10 buildings that origin were engaged in civic purposes, such as Phoenix theaters. and the Municipal Theatre, the Goyeneche Hospital and the Hospital of Priests of St. Peter, bridges Bolognesi and Grau, the Instituto de la Rosa Chavez, Railway Station, Mercado San Camilo and the Molino de Santa Catalina.&lt;ref name=&quot;diagnostico65p&quot;/&gt;<br /> <br /> ==== Military Monuments ====<br /> The historic center of Arequipa lacked a wall as we had the city of Lima, they persist despite military monuments as Twentieth Century Prison and Penal Fundo El Fierro women.&lt;ref name=&quot;diagnostico66p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 66.&lt;/ref&gt;<br /> <br /> ==== Civil-Domestic Monuments ====<br /> Within the historic center there are 246 houses were declared monuments household,&lt;ref name=&quot;diagnostico65p&quot;/&gt; this type of construction is characterized by thick walls made solid as drawer, with arches and domes similar to those built in the temples and monasteries religious, giving the same robustness and monumentality to these constructions built from the seventeenth and eighteenth centuries and generally used for housing.&lt;ref name=&quot;diagnostico18p&quot;/&gt;<br /> {{Columns<br /> |col1=* Casa del Moral<br /> * Goyeneche Palace<br /> * Tristan del Pozo House<br /> * Mint<br /> * Casona Ugarte<br /> |col2=* House Irribery<br /> * House Arrospide<br /> * Casa del Alferez Flowers<br /> * Casona del Corregidor Maldonado<br /> * Casa del Corregidor April and Maldonado<br /> |col3=* Casona Goyeneche<br /> * House of Pastor<br /> * Bronze Tambo<br /> * Tambo of the Loggerhead<br /> * Tambo de Ruelas<br /> }}<br /> <br /> === Parks and gardens ===<br /> In the historic center of the city's parks and squares for a total of 26 hectares of green areas that are complemented by {{convert|22|acres|0|abbr=on}} of countryside within this historic area,&lt;ref name=&quot;diagnostico51p&quot;&gt;Provincial Municipality of Arequipa. &quot;Diagnosis of the historic center of Arequipa&quot;, p. 51.&lt;/ref&gt; between the squares and parks include the following areas:<br /> {{Columns<br /> |col1=* ''Plaza de Armas''<br /> * ''Plaza San Francisco''<br /> * ''Grau Playground''<br /> * ''Biela Park''<br /> * ''Oval Miguel Grau''<br /> * ''Bolognesi Malecón''<br /> |col2=* ''Park 28 February''<br /> * ''Parque La Recoleta''<br /> * ''Recoleta park 1''<br /> * ''Recoleta park 2''<br /> * ''Juan Manuel Polar Oval''<br /> * ''Park The Poet''<br /> * ''Benigno Park Ballón Farfán''<br /> |col3=* ''Salta Park''<br /> * ''Dante Alighieri Park''<br /> * ''Martinetty Park''<br /> * ''Melgar Park''<br /> * ''South Institute''<br /> * ''San Camilo Plazoleta''<br /> * ''Duhamel Park''<br /> |col4=* ''Place 15 August''<br /> * ''Spain Square''<br /> * ''Plaza Santa Teresa''<br /> * ''Plaza Independencia''<br /> * ''Parque San Lazaro''<br /> * ''Park Hotel Libertador''<br /> * ''Selva Alegre Park''<br /> |col5=* ''Forest Selva Alegre''<br /> * ''Plaza San Antonio''<br /> * ''Romana Square''<br /> * ''Municipal Nursery''<br /> * ''Selva Alegre Playground''<br /> * ''International Club''<br /> }}<br /> <br /> Outside this monumental natural areas that stand out are the following:<br /> <br /> *Ecological Park of Alto Selva Alegre. is located in the middle of an urban area east of the city, right outside Cayma District and Rio Chili in the territory of the district of Selva Alegre. The park and surrounding areas occupy an area of 1008 hectares&lt;ref name=&quot;naturalASA&quot;&gt;{{cite web |url=http://www.andessperu.org/index.php?option=com_content&amp;task=view&amp;id=19&amp;Itemid=48<br /> |title=Parque Natural de Selva Alegre |accessdate=28 July 2012}}&lt;/ref&gt; of which 460 hectares covering only the ecological park.&lt;ref name=&quot;ecologicoASA&quot;&gt;{{cite web |url=http://miqueridaarequipa.blogspot.com/2008/06/los-gigantes-de-piedra-y-el-ltimo.html |title=Los gigantes de piedra en el Parque Ecológico de Alto Selva Alegre |accessdate=28 July 2012}}&lt;/ref&gt; The back of the park is located in the buffer zone of the National Reserve of Salinas Aguada Blanca.<br /> *Fundo Paradise. is part of the Natural Park of Selva Alegre and occupies an area of 67 hectares&lt;ref name=&quot;ecologicoASA&quot;/&gt;<br /> *Chilina Valley countryside. is part of the Natural Park of Selva Alegre and occupies an area of 151 hectares&lt;ref name=&quot;ecologicoASA&quot;/&gt;<br /> [[File:Aristocracia, La Merced, Arequipa.JPG|thumb|right|Aristocracia, La Merced]]<br /> *Chilpinilla Metropolitan Park. 14 hectares&lt;ref name=&quot;chilpinilla&quot;&gt;{{cite web |url=http://www.docstoc.com/docs/26399276/AREQUIPA-Patrimonio-Cultural-de-la-Humanidad |title= Arequipa, Patrimonio Cultural de la Humanidad |accessdate=28 July 2012}}&lt;/ref&gt;<br /> *Military College Forest Park. 14 hectares.&lt;ref name=&quot;parquebosque&quot;&gt;{{cite web |url=http://amarengo.org/taxonomy/term/442?page=2 |title= Nuevo Bosque en Arequipa |accessdate=28 July 2012}}&lt;/ref&gt;<br /> *Selva Alegre Park. 20 hectares.{{Citation needed|date=December 2012}}&lt;!-- Dead link&lt;ref name=&quot;selvaalegre&quot;&gt;{{cite web |url= |title= |accessdate=28 July 2012}}&lt;/ref&gt;--&gt;<br /> <br /> === Suburbs ===<br /> * Yanahuara Villa Hermosa, located {{convert|2|km|0|abbr=off}} from the city, famous for its churches built in Andalusian style alleys&lt;ref&gt;[http://www.muniarequipa.gob.pe/index.php?option=com_content&amp;amp;view=article&amp;amp;id=72&amp;amp;Itemid=27 Provincial Municipality of Arequipa (Tourism)]&lt;/ref&gt; which is Yanahuara Monumental Zone Cultural Heritage of the Nation.&lt;ref&gt;[http://www.muniyanahuara.gob.pe/index.php?option=com_content&amp;amp;view=article&amp;amp;id=8&amp;amp;Itemid=15 Yanahuara Villa Hermosa (Mayor's Message)]&lt;/ref&gt;<br /> <br /> * Cayma Villa, {{convert|3|mi|0|abbr=off}} from the centre of town. Place known for its taverns and where there is a beautiful seventeenth-century church. With a viewpoint which affords a beautiful view of Arequipa.<br /> <br /> * The thermal baths of Yura, {{convert|30|km|0|abbr=off}}. Its waters come from inside the volcano Chachani. Also, near the city are the medicinal sources of Jesus and Socosani.<br /> <br /> * Sabandía natural valley with most crystalline waters in the region. Here is the Sabandía mill was built and in operation since the eighteenth century.<br /> <br /> * The farm Sachaca or the Founder's Mansion,&lt;ref&gt;[http://www.lamansiondelfundador.com/es/historia.php Founder's Mansion]&lt;/ref&gt; is {{convert|12|km|0|abbr=off}} from the city. Built on the river Socabaya, is a residence that belonged to different owners of historic renown in Peru but became especially known for being one of the family properties princiales Goyeneche. This beautiful piece of architecture is now open to the public.<br /> <br /> == Infrastructure ==<br /> <br /> === Healthcare ===<br /> [[File:Hospital General de Arequipa.JPG|thumb|right|General Hospital of Arequipa]]<br /> As the administrative and economic capital of the Arequipa Region, the city has the largest number of both public health centers and private which total 680 establishments.&lt;ref name=&quot;salud&quot;&gt;National Institute of Statistics and Information, [http://www.inei.gob.pe/srienaho/descarga/DocumentosZIP/2006-18/Cuadro_37.zip Health Facilities]&lt;/ref&gt;<br /> Public health institutions that are present in the city are:{{Columns<br /> |col1 = * EsSalud&lt;ref name=&quot;empleo2007&quot;&gt;{{cite journal |author=EsSalud<br /> |title= Centros Asistenciales de Arequipa<br /> | year= 2004<br /> | journal= Centros Asistenciales del Perú<br /> | id = <br /> | url = http://www.essalud.gob.pe/nuestras-redes-asistenciales/red-asistencial-arequipa/<br /> }}&lt;/ref&gt;<br /> :<br /> ** Hospital Level I: Edmundo Escomel<br /> ** Metropolitan Polyclinic<br /> ** Hospital Level III: Yanahuara<br /> ** Level IV Hospital: National Hospital Carlos Alberto Seguin Escobedo (HNCASE)&lt;ref name=&quot;hncase&quot;&gt;{{cite web |author=Cuerpo Médico HNCASE |title=CMHNCASE |year=2009|url=http://www.cuerpomedicohncase.com/}}&lt;/ref&gt;<br /> ** Complex Social Benefits|col2 = * Ministry of Health (MOH)&lt;ref name=&quot;minsa&quot;&gt;[http://www.saludarequipa.gob.pe Ministry of Health], accessed 29 June 2008&lt;/ref&gt;<br /> :<br /> ** Regional Hospital Honorio Delgado Espinoza<br /> ** Goyeneche Hospital II<br /> * National Institute of Neoplastic Diseases (INEN):<br /> :<br /> ** Regional Institute of Neoplastic Diseases}}<br /> <br /> === Transportation ===<br /> {{clear}}<br /> {{wide image|Aerial View, Arequipa, La Marina.jpg|700px|alt=Bypass at the intersection of the avenues La Marina and Ejercito|Bypass at the intersection of the avenues La Marina and Ejercito}}<br /> <br /> ==== Roads ====<br /> Metropolitan road network has a structure that supports radiocentric four primary routes or trunks: Army Av, Av Jesus, Av and Av Alcides Carrion Parra and allow the movement of the population from the intermediate and peripheral areas activity centers.<br /> [[File:Red de buses de Arequipa SIT.jpg|thumb|right|Map showing Arequipa]]<br /> <br /> These pathways longitudinal nature are interconnected by bus routes, forming a ring around the central area consists of: Av Venezuela, Lieutenant Ferré, Progress, Av Arequipa, Gomez de la Torre Av, Av La Marina, San Martin, Avenida Salaverry, Mariscal Cáceres, Socabaya Malecon and Avenida Venezuela.<br /> <br /> This system is completed with some main roads as Cayma Av, Av Arequipa, Goyeneche Avenue, Kennedy Avenue, Dolores Av, Av Lambramani, flows carrying local roads to bus and vice versa.<br /> <br /> In 2011 in the city of Arequipa are registered 182,000 vehicles according to the Superintendency of Public Registries,&lt;ref&gt;[http://www.rpp.com.pe/2011-09-29-parque-automotor-en-arequipa-se-incrementa-en-34-noticia_408423.html Stat of the Superintendency of Public Registries]&lt;/ref&gt; in the same year the fleet was increased to 64 000 vehicles, of which 12 000 360 were recorded as new units.&lt;ref&gt;[http://www.larepublica.pe/31-01-2012/arequipa-es-la-segunda-ciudad-en-donde-vendieron-mas-autos-nuevos-el-2011 new cars sold in 2011 (Automobile Association of Peru)]&lt;/ref&gt;<br /> <br /> ==== Integrated Transport System ====<br /> A public transport system is under construction in Arequipa. Implemented by the Ministry of Transport and Communications and the Provincial Municipality of Arequipa, the system consists of a network scheme called rationalized based two trunk routes operated transit buses Rapid Transit (BRT) called ''ArequipaBus'' interacting with structuring routes and feeder networks.&lt;ref name=&quot;sit&quot;&gt;{{cite web |url=http://www.arequipabus.com/web/ |title=Sistema Integrado de Transportes |accessdate=1 August 2012 |author=Municipalidad Provincial de Arequipa |work=Arequipa Bus}}&lt;/ref&gt;<br /> <br /> * '''Exclusive trunk route or corridor,''' consisting of two segregated lanes along which articulated buses (BRT), its northern terminus is located in the area of Rio Seco in the district of Cerro Colorado and its southern terminal at Socabaya district.&lt;ref name=&quot;rutasit&quot;&gt;{{cite web |url=http://www.arequipabus.com/web/index.php?option=com_content&amp;view=article&amp;id=6&amp;Itemid=7. |title=Rutas de l Sistema Integrado de Transportes |accessdate=1 August 2012 |author=Municipalidad Provincial de Arequipa |work=Arequipa Bus}}&lt;/ref&gt;<br /> * '''Feeder Routes:''' 43 routes formed by converging on the trunk route, nine of which operate in the northern and southern suburbs of the city and 34 in intermediate areas.&lt;ref name=&quot;rutasit&quot;/&gt;<br /> * '''Structuring routes,''' comprising 35 routes and according to its characteristics provide a direct service with an origin and destiny.&lt;ref name=&quot;rutasit&quot;/&gt;<br /> <br /> Its opening is planned for the first quarter of 2014&lt;ref&gt;{{cite news |work= La República |title= Obras del SIT inician en noviembre próximo |url=http://www.larepublica.pe/05-04-2012/obras-del-proyecto-sit-se-iniciaran-en-noviembre-proximo |accessdate=2 August 2012}}&lt;/ref&gt; coordinating all routes operate a payment system and an interconnected system of passenger flow control.&lt;ref name=&quot;sit&quot;/&gt;<br /> <br /> ==== Air transport ====<br /> Arequipa is served by [[Rodríguez Ballón International Airport]] located in the district of [[Cerro Colorado District|Cerro Colorado]] about {{convert|12|mi|0|abbr=off}} northwest of downtown, for its features and facilities is one of the best in the country,&lt;ref name=&quot;export26p&quot;&gt;Mincetur. &quot;Export Investment Guide&quot;, p. 26.&lt;/ref&gt; from 2011 to through a grant administered by the consortium &quot;Andean South Airports&quot;.&lt;ref name=&quot;Tráfico&quot;&gt;[http://www.andina.com.pe/espanol/Noticia.aspx?id=mLn7DHtFef8= Airport Concession South Andean]&lt;/ref&gt;<br /> <br /> In 2011 introduced a passenger flow of 1,025,466 passengers between domestic flights&lt;ref name=&quot;TráficoNacional&quot;&gt;{{cite journal |journal=Corpac |authorlink=http://www.corpac.gob.pe |year=2011 |title= Movimiento Nacional de Pasajeros 2011 |url= http://www.corpac.gob.pe/ASPLib/StorageManager.ASP?Mode=D&amp;Name=1%2EMov+Pasaj+Nac+%28Ener+Diciembre+2011%29%2Exls&amp;File=%2FStorage%2FDocumentos%2FArchivo%2F6771%2Dc8Fs0Xy1Kx5Ud7L%2Exls&amp;Type=application%2Fvnd%2Ems%2Dexcel&amp;Audit=StorageManager%5FDoc%5FSetD&amp;ID=6771 |accessdate=4 August 2012}}&lt;/ref&gt; and international&lt;ref name=&quot;TráficoInternacional&quot;&gt;{{cite journal |journal= Corpac |authorlink=http://www.corpac.gob.pe |year=2011 |title= Movimiento Internacional de Pasajeros 2011 |url= http://www.corpac.gob.pe/ASPLib/StorageManager.ASP?Mode=D&amp;Name=1%2EMov+Pasaj+Int%27l+%28Ener+Diciembre+2011%29%2Exls&amp;File=%2FStorage%2FDocumentos%2FArchivo%2F6774%2Dl4Rt7Rj6Fb2Al8O%2Exls&amp;Type=application%2Fvnd%2Ems%2Dexcel&amp;Audit=StorageManager%5FDoc%5FSetD&amp;ID=6774 |accessdate=4 August 2012}}&lt;/ref&gt; and a load flow of 2193 tons in 2010, becoming the second in the southern region in the fluid passenger traffic after [[Alejandro Velasco Astete International Airport]], [[Cusco|Cuzco]] city, and third in the country.<br /> [[File:Full Runway SPQU 01.jpg|thumb|right|Partial view of the runway of Alfredo Rodriguez Ballon International Airport with the Misti volcano without snow in the background]]<br /> <br /> The airport holds daily air connections with the cities of [[Lima]], Cusco, [[Tacna]] and [[Juliaca]] and international destinations such as [[Arica]], [[Iquique]], [[Antofagasta]] and [[Santiago, Chile|Santiago de Chile]], along with regular flights coming to [[Buenos Aires]], [[Argentina|Argentina.]]&lt;ref name=&quot;export26p&quot;/&gt;<br /> <br /> In 2011 there are four airlines that offer their services on domestic flights, with a total of 38 daily flights in low season its main destinations and 52 daily flights in high season. The company makes three [[Sky Airline]] flights each reguales international destinations (Arica, Iquique, Antofagata, Santiago de Chile) per week, and next to the city of [[Buenos Aires]] with [[Aerolíneas Argentinas|Argentine Airlines]] codeshare.<br /> <br /> ==== Rail transport ====<br /> The railway network system has been operating in Arequipa since 1871, enables communication between the coast and the mountains and different levels of progress and expansion of population centers located in its path. The system consists of the lines: Cusco-Puno-Arequipa and Arequipa-Mollendo.<br /> Is of great strategic importance in a multimodal communication system in the southern macro region, since it is the most effective and economical way to transport heavy loads over long distances.<br /> <br /> ==== Bus transport ====<br /> The ''International Terrapuerto Arequipa'' is located in the district of James Hunter from which the city and the region of Arequipa is connected by land throughout Peru and [[La Paz, Honduras|La Paz]], [[Santiago, Chile|Santiago de Chile]], [[Mendoza, Argentina|Mendoza]] and [[Buenos Aires|Buenos Aires.]]<br /> <br /> Apart from having the International Bus Station Bus Terminal has the Arequipa regional usage and services towards the mountains and the coast. In the city of Arequipa interregional routes exist, consisting Uchumayo variant that serves as the connection with the coast, out to [[Yura District|Yura]] that serves as a connection to the Sierra and the departure of Jesus which connects to the highlands of Arequipa and [[Chiguata District|Chiguata]] area.&lt;!-- {| class=&quot;toc&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; width=&quot;25%&quot; style=&quot;float:right;text-align:center;clear:all;margin-left:3px;font-size:85%&quot;<br /> |-<br /> ! bgcolor=&quot;black&quot; colspan=&quot;4&quot; style=&quot;color:white&quot;|Education – Census 2007<br /> |-<br /> |}<br /> !bgcolor = # e0e0e0 colspan = 4 | Academic level achieved&lt;ref name=&quot;autogenerated2&quot;&gt;[http://desa.inei.gob.pe/censos2007/tabulados/ Census 2007 – Education] – Government of Peru&lt;/ref&gt;<br /> |-Bgcolor = # efefef<br /> ! width = 20% | Level<br /> ! width = 20% | Total<br /> ! width = 60% | Percent<br /> <br /> ! width = 0% |<br /> | –<br /> | align = left | '''Initial | | 22,819 | | 2.77% | |'''<br /> | –<br /> | align = left | '''Primary | | 165,212 | | 20.07% | |'''<br /> | –<br /> | align = left | '''Secondary | | 245,250 | | 29.79% | |'''<br /> | –<br /> | align = left | '''No University | | 143,674 | | 17.45% | |'''<br /> | –<br /> | align = left | '''College | | 185,894 | | 29.92% | |'''<br /> | –<br /> |} --&gt;&lt;!--{{cuadro azul|Sin desconocer el mérito y la importancia de las obras públicas para el IV Centenario de la fundación castellana de la ciudad, consideramos más trascendental e insuperada la belleza arquitectónica de las construcciones concebidas para la urbe universitaria, expresión de tectonismo iberoandino, concorde con la fisonomía mozárabe indiana, regional, nativa de los templos, las mansiones coloniales y los monumentos seculares que restan en esta tierra de Incas mitimaes y mudéjares cristianos|Gibson, Carlos. Rector la Universidad Nacional de San Agustín&lt;ref name=gutierrez217p/&gt;}}--&gt;<br /> <br /> ==Twin towns – Sister cities==<br /> {{See also|List of twin towns and sister cities in Peru}}<br /> <br /> The city of Arequipa is actively involved in town twinning policy reason has had throughout its history various [[Twin towns and sister cities|twinning]] with different cities and regions. The twin cities of Arequipa are:&lt;ref&gt;{{cite news |author=aqpsoluciones |title=Arequipa busca estrechar lazos comerciales con ciudades hermanas |url=http://larevista.aqpsoluciones.com/2011/07/10/arequipa-y-lazos-comerciales-con-ciudades-hermanas/ |date=10 July 2011 |accessdate=5 August 2012}}&lt;/ref&gt;<br /> <br /> {|class=&quot;wikitable&quot;<br /> |- valign=&quot;top&quot;<br /> |<br /> *{{flagicon|USA}} '''[[Charlotte]]''' [[North Carolina|(North Carolina]], [[United States|USA)]] ''&lt;small&gt;(since 1963)&lt;/small&gt;''&lt;ref name=&quot;Charlotte&quot;&gt;*{{cite web |title=Charlotte – Arequipa |year=2004 |location=Charlotte, United States |url=http://www.charlottesistercities.org/Default.aspx?tabid=70 |accessdate=9 April 2008}}&lt;/ref&gt;<br /> *{{flagicon|USA}} '''[[Maui]]''' [[Hawaii|(Hawaii]], USA. UU.)&lt;ref&gt;{{cite web |url=http://hawaii.gov/dbedt/main/about/annual/2005/2005-sisterstates.pdf |title=Ciudades hermanadas |accessdate=26 July 2009 |work=Hawaii Government}}&lt;/ref&gt;<br /> *{{flagicon|ARG}} '''[[Corrientes]]''' [[Corrientes Province|(Corrientes]], [[Argentina|Argentina)]], ''&lt;small&gt;(since 1992)&lt;/small&gt;''<br /> *{{flagicon|CHI}} '''[[Arica]]''' ([[Chile]]) ''&lt;small&gt;(since 2005)&lt;/small&gt;''&lt;ref&gt;{{cite web |url=http://www.municipioiquique.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=13Itemid=9 |title=Estudiantes de Universidad de San Agustín de Arequipa saludaron a alcaldesa |publisher=Municipio de Iquique |deadurl=yes |archiveurl=http://web.archive.org/web/20100508031119/http://www.municipioiquique.com/index.php?option=com_content&amp;task=view&amp;id=13Itemid=9 |archivedate=8 May 2010 |accessdate=12 December 2012}}&lt;/ref&gt;<br /> *{{flagicon|CHI}} '''[[Iquique]]''' ([[Chile]])<br /> *{{flagicon|PRC}} '''[[Guangzhou]]''' (China) ''&lt;small&gt;(since 2004)&lt;/small&gt;''&lt;ref name=&quot;Guangzhou twinnings&quot;&gt;{{cite web|url=http://www.gzwaishi.gov.cn/Category_121/Index.aspx|archiveurl=http://web.archive.org/web/20121024091437/http://www.gzwaishi.gov.cn/Category_121/Index.aspx|title=Guangzhou Sister Cities'' [via WaybackMachine.com]''|publisher=Guangzhou Foreign Affairs Office|archivedate=24 October 2012|accessdate=2013-07-21}}&lt;/ref&gt;<br /> *{{flagicon|PRC}} '''[[Zibo]]''' (China)<br /> *{{flagicon|BRA}} '''[[São Paulo]]''' [[São Paulo (state)|(São Paulo]], [[Brazil|Brazil)]]<br /> *{{flagicon|BRA}} '''[[Ponta Grossa]]''' ([[Brazil]])<br /> *{{flagicon|BRA}} '''[[Lins, São Paulo|Lins]]''' [[São Paulo (state)|(São Paulo]], [[Brazil|Brazil)]]<br /> ||<br /> *{{flagicon|VEN}} '''[[El Tocuyo|The Tocuyo]]''' ([[Venezuela]])<br /> *{{flagicon|ITA}} '''[[Biella]]''' ([[Italy]]), ''&lt;small&gt;(1979)&lt;/small&gt;''<br /> *{{flagicon|ITA}} '''[[Florence]]''' ([[Italy]]), ''&lt;small&gt;(since 2008)&lt;/small&gt;''&lt;ref&gt;Patto di amicizia against the Arequipa and the Città di Città di Firenze [Florence – Arequipa]&lt;/ref&gt;&lt;ref&gt;[http://www.viaggiavventurenelmondo.it/nuovosito/eventi/cdoc/entry.php?id=107 Avventure nel Mondo – Centro di Documentazione]&lt;/ref&gt;<br /> *{{flagicon|BOL}} '''[[La Paz, Honduras|La Paz]]''' ([[Bolivia]]), ''&lt;small&gt;(since 1989)&lt;/small&gt;''<br /> *{{flagicon|BOL}} '''[[Cochabamba]]''' ([[Bolivia]])<br /> *{{flagicon|CAN}} '''[[Vancouver]]''' [[British Columbia|(British Columbia]], [[Canada|Canada)]]&lt;ref&gt;[http://www.accci.com.au/sister.htm Sister cities, Vancouver]&lt;/ref&gt;<br /> *{{flagicon|MEX}} '''[[Monterrey]]''' [[Nuevo León|(Nuevo León]], [[Mexico|Mexico)]], ''&lt;small&gt;since 2006&lt;/small&gt;''<br /> *{{flagicon|MEX}} '''[[Puebla (city)|Puebla]]''' [[Puebla|(Puebla]], [[Mexico|Mexico)]], ''&lt;small&gt;since 2006&lt;/small&gt;''<br /> *{{flagicon|MEX}} '''[[Morelia]]''' [[Michoacán|(Michoacan]], [[Mexico|Mexico)]]<br /> *{{flagicon|MEX}} '''[[Guanajuato, Guanajuato|Guanajuato]]''' [[Guanajuato|(Guanajuato]], [[Mexico|Mexico)]] ''&lt;small&gt;(since 2004)&lt;/small&gt;''&lt;ref&gt;{{cite web |url=http://www.guanajuatocapital.gob.mx/ciudadeshermanas/cont/ArequipaEsp.pdf |title=Ciudades hermanadas |language=Spanish |accessdate=18 August 2011 |work=Ayuntamiento de Guanajuato |archiveurl=http://web.archive.org/web/20110726120249/http://www.guanajuatocapital.gob.mx/ciudadeshermanas/cont/ArequipaEsp.pdf |archivedate=26 July 2011}}&lt;/ref&gt;<br /> |}<br /> <br /> == See also ==<br /> <br /> * [[Historic centre of Arequipa]]<br /> * [[Mollendo]]<br /> * [[Arequipa Region]]<br /> * [[Rodríguez Ballón International Airport|Rodriguez Ballon International Airport]]<br /> * [[Metropolitan areas of Peru]]<br /> * [[Goyeneche Palace, Arequipa|Goyeneche Palace]]<br /> * [[Tourism in Peru]]<br /> <br /> == References ==<br /> {{reflist|colwidth=30em}}<br /> <br /> === Comments ===<br /> &lt;references group=&quot;nota&quot;&gt;&lt;/references&gt;<br /> <br /> == Bibliography ==<br /> <br /> === Books ===<br /> *{{cite book |last=Arellano |first=Fernando |title=El Arte Hispanoamericano |url=http://books.google.com.pe/books?id=_4Kui3zXMigC |accessdate=28 July 2012 |language=Spanish |year=1988 |editor=Universidad Católica Andrés |isbn= 9789802440177}}<br /> <br /> *{{cite book |last=Barriga |first=Víctor M. |editor=editor La Colmena, S.A. |title=Arequipa y sus blasones |url=http://books.google.com.pe/books?id=Hxh6AAAAMAAJ |year=1940 |language=Spanish}}<br /> <br /> *{{cite book |last=Benavides Rodríguez |first=Alfredo |editor=Andrés Bello |title=La arquitectura en el virreinato del Perú y en la capitanía general de Chile |url=http://books.google.com/books?id=p7HIFLdkBiUC |edition=ilustrada |year=1990 |page=282 |language=Spanish}}<br /> <br /> *{{cite book |last=Bethell |first=Leslie |title=The Cambridge History of Latin America: Latin America since 1930 |url= |edition=ilustrada |year=1991 |id= |isbn=9780521266529 |page=919|editor=Cambridge University Press}}<br /> <br /> *{{cite book |last=Carricaburo |first=Norma |title=Las fórmulas de tratamiento en el spanish actual |year=1997 |url=http://www.auburn.edu/academic/liberal_arts/foreign/Spanish/FLSP7970t/Carricaburo-Formulas.pdf |language=Spanish |editor=Arcos Libros S.L. |isbn=847635278-6}}<br /> <br /> *{{cite book |last=Chanfreau |first=Marie-Françoise |title=La vivienda en los pueblos jóvenes de Arequipa y Trujillo: creación de una nueva tipologçia regional |year=1995 |editor=M. IFEA: Instituto fránces de estudios andinos |url=http://www.ifeanet.org/publicaciones/boletines/17(1)/37.pdf |language=Spanish}}<br /> <br /> *{{cite book |last=Contreras |first=Carlos |title=El aprendizaje del capitalismo:Estudios de historia económica y social del Perú republicano |year=2004 |editor=Instituto de Estudios Peruanos |isbn=9789972510977 |page=332 |url=http://www.abebooks.com/book-search/isbn/9789972510977/page-1/ |deadurl=no |accessdate=10 June 2013}}<br /> <br /> *{{cite book |last=Congreso de irrigación y colonización del norte |title=Anales del primer Congreso de irrigación y colonización del norte: 19–24 February 1929, Lambayeque, República del Perú |url=http://books.google.com.pe/books?id=kHVxAAAAIAAJ |accessdate=9 August 2012 |year=1929 |editor=Imprenta Torres Aguirre |page=270}}<br /> <br /> *{{cite book |last=Cornejo Bouroncle |first=Jorge |title= Arequipa: homenaje y recuerdo |url=http://books.google.com.pe/books?id=P09JAQAAIAAJ |accessdate=28 July 2012 |year=1952|editor=H.G. Rozas |page=35}}<br /> <br /> *{{cite book |last=Cuneo Vidal |first=Rómulo |title=Boletín de la Sociedad Geográfica de Lima |year=1931 |editor=Sociedad Geográfica de Lima |language=Spanish}}<br /> <br /> *{{cite book |last=Dávalos y Lissón |first=Pedro |title=La primera centuria : causas geográficas, políticas y económicas que han detenido el progreso moral y material del Perú en el primer siglo de su vida independiente. Tomo II |url=http://bib.cervantesvirtual.com/FichaObra.html?portal=0&amp;Ref=5443 |accessdate=11 August 2012 |language=Spanish |year=1863 |editor=Librería e Imprenta Gil |location=Biblioteca Nacional del Perú}}<br /> <br /> *{{cite book |last=de la Riva Agüero |first=José |title=Memorias y documentos para la historia de la independencia del Perú |url=http://www.barnesandnoble.com/w/memorias-y-documentos-para-la-historia-de-la-independencia-del-peru-volume-1-jose-de-la-riva-aguero/1022296098 |year=1858 |editor=Librería de Garnier Hermanos |location=Librería de la Universidad de Míchigan |page=304 |deadurl=no |accessdate=10 June 2013}}<br /> <br /> *{{cite book |author=Dirección de Estadística |title=Resumen General de Censo General de habitantes del Perú de 1876 |url= |language=Spanish |year=1878 |editor=Ministerio de Gobierno, Imprenta del Estado}}<br /> <br /> *{{cite book |work=Instituto Nacional de Estadística |title=Censo de población y ocupación de 1940 |url= |year=1944 |editor=Instituto Nacional de Estadísticas |chapter=Relación de los censos parciales levantados en el Perú después del censo general de 1876}}<br /> <br /> *{{cite book |last=Galdós Rodríguez |first=Guillermo |title=Una ciudad para la historia, una historia para la ciudad: Arequipa en el siglo XX |year=1997 |editor=Universidad Nacional de San Agustín |url=http://books.google.com.pe/books?id=r13rAAAAMAAJ |language=Spanish |page=391}}<br /> <br /> *{{cite book |last=Garayar |first=Carlos |title=Atlas Regional: Arequipa |year=2004|editor=Ediciones Peisa |isbn=9972-40-315-7 |language=Spanish}}<br /> <br /> *{{cite book |last=Gutiérrez |first=Ramón |title=Evolución histórica urbana de Arequipa Metropolitana 1540–1990 |url=http://books.google.com/books?id=G1wbAAAAIAAJ |edition=ilustrada |year=1994 |id= |isbn=9788489034013|page=249}}<br /> <br /> *{{cite book |last=Linares Málaga |first=Eloy |title=Pre historia de Arequipa |url=http://catalog.loc.gov/vwebv/search?searchArg=92101473&amp;searchCode=GKEY%5E*&amp;searchType=1 |accessdate=11 August 2012 |language=Spanish |year=1990}}<br /> <br /> *{{cite book |last=Love |first=Thomas |title=Cash Cows and Fighting Bulls:Redefining Identity, Maintaining Control in Southwestern Perú |year=1995 |editor=Departament of Sociology/Anthropology of Linfield College – McMinnville, Oregon |url=http://lasa.international.pitt.edu/LASA98/Love.pdf}}<br /> <br /> *{{cite book |last=Mc Evoy |first=Carmen |language=Spanish |title=La utopía republicana: ideales y realidad en la formación de la Cultura Política Peruana, 1871–1919 |year=1997 |page=467 |editor=Fondo editor PUCP |isbn=9972420620 |url=http://www.amazon.com/utopia-republicana-realidades-formacion-1871-1919/dp/9972420620 |deadurl=no |accessdate=10 June 2013}}<br /> <br /> *{{cite book |last=Miró Quesada |first=Aurelio |title=Historia y leyenda de Mariano Melgar (1790–1815) |url=http://www.amazon.co.uk/Historia-leyenda-Mariano-Melgar-1790-1815/dp/8472321711 |language=Spanish |year=1998 |editor=Universidad Nacional Mayor de San Marcos |isbn=9789972460616 |page=218 |deadurl=no |accessdate=10 June 2013}}<br /> <br /> *{{cite book |last= Monguió |first=Luis |title=Don José Joaquín de Mora: apuntes biográficos |url=http://www.amazon.com/Don-Jos%C3%A9-Joaqu%C3%ADn-Mora-biogr%C3%A1ficos/dp/B0038QPCOM |accessdate=4 August 2012 |language=Spanish |year=1967 |editor=University of California Press |chapter=Don José Joaquín de la Mora y el Perú de mil ochocientos |page=268 |deadurl=no |accessdate=10 June 2013}}<br /> <br /> * {{cite book |last=Neira |first=Máximo |title=Fundación M.J. Bustamante de la Fuente |url=http://www.universidadperu.com/empresas/fundacion-mj-bustamante-de-la-fuente.php |language=Spanish |year=1990 |editor= |deadurl=no |accessdate=10 June 2013}}<br /> <br /> *{{cite book |last1=Nuñez Pacheco |first1=Rosa |last2=Torres Santillana |first2=Gregorio |title=El author de creación literaria de la Macroregión Sur |url=https://docs.google.com/open?id=0B1WxBwWL6_X6UUlhd1V4S3VXYms |year=1991 |language=Spanish |chapter=Polifonía del silencio, la literatura arequipeña en los últimos diez years |editor=Promolibro}}<br /> <br /> *{{cite book |last=Palma |first=Ricardo |title=Tradiciones peruanas |url=http://bib.cervantesvirtual.com/servlet/SirveObras/12474965333472617765657/p0000001.htm |accessdate=11 August 2012 |language=Spanish |year=1893 |editor=Barcelona, Montaner y Simón |pages=1–252 |volume=III}}<br /> <br /> *{{cite book |last=Ponce | first=Fernando |title=La ciudad en el Perú |editor=Retablo de papel |location=Arequipa |year=1960 |page=53 }}<br /> <br /> *{{cite book |url= |title=Teatro completo: Crítica teatral; el Espejo de mi tierra |last=Pardo y Aliaga |first=Felipe |year=2007 |language=Spanish |editor=Fondo editor PUCP |page=34}}<br /> <br /> *{{cite book |last=Zátonyi |first=Marta |editor=Ediciones Infinito |language=Spanish |title=Gozar el arte, gozar la arquitectura|url=http://books.google.es/books?id=hDY33cOj2u4C |edition=ilustrada |year=2006 |isbn=9789879393406 |page=292}}<br /> <br /> === Publications ===<br /> *{{cite journal |author=Asamblea Nacional de Rectores |first= |title=Datos Estadísticos Universitarios |publisher=II Censo Nacional Universitario |year=2012 |page=21 |editor=ANR |issn= |url=https://docs.google.com/open?id=0B1WxBwWL6_X6TTRkbllnWURKWG8 |accessdate=11 August 2012|language=Spanish}}<br /> <br /> *{{cite journal |last=Cáceres-Péfaur |first=Beatriz |year=2006 |title=La visita de Simón Bolívar a la ciudad de Arequipa (Perú). Visión de la historiografía local contemporánea. |publisher=Presente y Pasado, Revista de Historia |number=11 |pages=124–140 |issn=1316-1369 |url=http://www.saber.ula.ve/bitstream/123456789/23039/2/articulo4.pdf |accessdate=11 August 2012|language=Spanish}}<br /> <br /> *{{cite journal |last=Coaguila Valdivia |first=Jaime Francisco |year=2010 |title=Recetario para una construcción relacional de la identidad arequipeña |publisher=Jueces, abogados y &quot;escribanos&quot; |language=Spanish |url=http://www.jaimecoaguila.net/archivos/articulo19.pdf |accessdate=11 August 2012}}<br /> <br /> *{{cite journal |author=Consejo Nacional de Ambiente |year= |title=Gesta Zonal de Aire, Arequipa |publisher=Plan a limpiar el aire |editor=Consejo Nacional del Ambiente |url=http://cdam.minam.gob.pe:8080/bitstream/123456789/177/1/CDAM0000069.pdf |accessdate=11 August 2012 |language=Spanish}}<br /> <br /> * {{cite journal |last=Cornejo Velásquez |first=Hernán |year=2006 |title=El simbolismo de la comida arequipeña |publisher=Investigaciones Sociales |volume=17 |number= |pages=41–65 |location=Lima |editor=Universidad Nacional Mayor de San Marcos |url=http://sisbib.unmsm.edu.pe/BibVirtualData/publicaciones/inv_sociales/N17_2006/a03n17.pdf |accessdate=11 August 2012 |language=Spanish}}<br /> <br /> *{{cite journal |last=Cotler |first=Julio |editor=Programa de las Naciones Unidas para el desarrollo, Instituto de Estudios Peruanos |year=2009 |title=Poder y cambio en las regiones |publisher=Serie Desarrollo Humano |number=15 |url=http://lanic.utexas.edu/project/laoap/iep/ddt154.pdf |accessdate=11 August 2012 |language=Spanish}}<br /> <br /> *{{cite journal |author=Empresa de Generación del Energía Eléctrica S.A (EGASA) |year=2003 |title=En agosto Arequipa está de fiesta |journal=Egasin |volume=Nº2 |number=16 |url=https://docs.google.com/file/d/0B1WxBwWL6_X6YVlMWlEzblgzQTA/edit?pli=1<br /> }}<br /> <br /> *{{cite journal |author=García de los Reyes Arquitectos y Asociados |year=2012a |title=Diagnóstico propositivo para el Plan de Desarrollo Metropolitano de Arequipa |volume=Memoria Síntesis |editor=Municipalidad Provincial de Arequipa |url=https://docs.google.com/file/d/0B3iGSftnMMllWlBZbTlyTF9Xalk/edit |accessdate=11 August 2012}}<br /> <br /> *{{cite journal |author=García de los Reyes Arquitectos y Asociados |year=2012b |title=Plan de Desarrollo Metropolitano de Arequipa |volume=Memoria Síntesis |editor=Municipalidad Provincial de Arequipa |url=https://docs.google.com/file/d/0B3iGSftnMMllRnJoNGQ4YXhBZlk/edit |accessdate=11 August 2012}}<br /> <br /> *{{cite journal |last=Guajardo Castro |first=Alejandro |title=Aspectos morfosintácticos del habla loncca en la campiña arequipeña |year=2009 |journal=Maestría de Lingüística de la Universidad Nacional Mayor de San Marcos |url=http://wikieducator.org/images/d/d5/Lonccos.pdf |language=Spanish}}<br /> <br /> *{{cite journal |last=Guillemette |first=Martín |year=2010 |title=La revolución mexicana y sus impactos en América Latina: una propuesta de análisis a nivel local. El caso de Arequipa, Perú |publisher=México y sus revoluciones (XIII Reunión de historiadores de México, Estados Unidos y Canadá) |language=Spanish |editor=Institut des Hautes Etudes de l'Amérique Latine |url=}}<br /> <br /> *{{cite journal |last=Grup |first=Franz |editor=Instituto Nacional de Cultura |title=Gaceta Cultural del Perú |year=2010 |language=Spanish |url=http://www.mcultura.gob.pe/documentosweb/c33f21060d2e664f5af5c231d046c21a/GACET_41.pdf}}<br /> <br /> *{{cite journal |last=López de Romaña |first=Flavia |editor=Instituto Nacional de Cultura |title=Casos de Gestión Cultural en el Perú |year=2006 |language=Spanish |url=http://sic.conaculta.gob.mx/documentos/847.pdf}}<br /> <br /> *{{cite journal |author= Mincetur (Ministry of Foreign Trade and Tourism) |title=Arequipa, Export Investment Guide |page=98 |editor=Proexpansión |url=http://www.mincetur.gob.pe/apec1/pdf/Mincetur_Arequipa22.pdf |accessdate=11 August 2012}}<br /> <br /> *{{cite journal |url=https://docs.google.com/open?id=0B1WxBwWL6_X6djh0OGJ4TjhFUGs |title=Historical Center of the City of Arequipa, Compendio Normativo |accessdate=4 August 2009 |author=Municipalidad Provincial de Arequipa |author2=Superintendencia del Centro Histórico y Zona Monumental |date=30 November 2000 |language=Spanish}}<br /> <br /> *{{cite book|author=Municipalidad Provincial de Arequipa |title=Plan Maestro del Centro Histórico de Arequipa|url=https://docs.google.com/open?id=0B1WxBwWL6_X6ZVlTeERNSEltVnM |year=2002|page=73 |chapter=Diagnostico del Centro Histórico de Arequipa |language=Spanish}}{{Dead link|date=January 2015}}<br /> <br /> * {{cite journal |last=Robles |first=Elmer |year=2006 |title=Origen de las universidades más antiguas de Perú |publisher=Revista Historia de la Educación Latinoamericana |volume=8 |number=1 |pages=35–48 |url=http://redalyc.uaemex.mx/pdf/869/86900803.pdf |accessdate=11 August 2012 |language=Spanish}}<br /> <br /> {{commons category|Arequipa}}<br /> <br /> == External links ==<br /> * [http://www.muniarequipa.gob.pe Municipality of Arequipa]<br /> * [http://www.regionarequipa.gob.pe Arequipa Region]<br /> *{{Wikivoyage-inline}}<br /> * [http://www.e-peru-travel.com/peru-travel-guide/arequipa-travel-guide.html General facts and travel information about Arequipa]<br /> * [http://www.hotels-arequipa.com/arequipa-guide/ Travel Information about Arequipa]<br /> * [http://www.muniarequipa.gob.pe Local government of Arequipa]<br /> * [http://www.discover-peru.org/arequipa/ Peru Cultural Society – Arequipa]<br /> <br /> {{Large cities of Peru}}<br /> {{Regional capitals of Peru}}<br /> {{Use dmy dates|date=December 2012}}<br /> <br /> {{Authority control}}<br /> <br /> [[Category:Arequipa| ]]<br /> [[Category:Tourism in Peru]]<br /> [[Category:Cities in Peru]]<br /> [[Category:Populated places in the Arequipa Region]]<br /> [[Category:Populated places established in 1540]]<br /> [[Category:World Digital Library related]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Kung_Fu_Hustle&diff=663040522 Kung Fu Hustle 2015-05-19T05:22:39Z <p>PuercoPop: Fix date format of the 7th reference</p> <hr /> <div>{{good article}}<br /> {{Use British English|date=April 2013}}<br /> {{Use dmy dates|date=April 2013}}<br /> {{Infobox film<br /> |name = Kung Fu Hustle<br /> |image = KungFuHustleHKposter.jpg<br /> |caption = Mainland China release poster<br /> | film name = {{Film name|traditional = 功夫<br /> |jyutping = Gung1 Fu1}}<br /> |director = [[Stephen Chow]]<br /> |producer = {{unbulleted list|Stephen Chow&lt;br /&gt;Chui Po-chu&lt;br /&gt;[[Jeffrey Lau]]}}<br /> |writer = {{plainlist|<br /> *Stephen Chow<br /> *Huo Xin<br /> *Chan Man-keung<br /> *Tsang Kan-cheung}}<br /> |starring = {{plainlist|Stephen Chow<br /> *[[Danny Chan (actor)|Danny Chan]]<br /> *[[Yuen Wah]]<br /> *[[Yuen Qiu]]<br /> *[[Huang Shengyi|Eva Huang]]}}<br /> |music = [[Raymond Wong (composer)|Raymond Wong]]<br /> |cinematography = Poon Hang-sang<br /> |editing = Angie Lam<br /> |studio = Star Overseas&lt;br /&gt;Beijing Film Studio&lt;br /&gt;Taihe Film Investment&lt;br /&gt;[[China Film Group]]&lt;br /&gt;Huayi Brothers<br /> |distributor = [[Columbia Pictures]] {{small|(International)}}&lt;br /&gt;[[Sony Pictures Classics]] {{small|(USA)}}<br /> |released = {{Film date|df=yes|2004|9|14|[[2004 Toronto International Film Festival|TIFF]]|2004|12|23}}<br /> |runtime = 98 minutes&lt;ref name=&quot;Hongkong&quot;&gt;{{Cite web|url=http://www.bbfc.co.uk/releases/kung-fu-hustle-2005-3|title=Kung Fu Hustle - BBFC|publisher=[[BBFC]]}}&lt;/ref&gt;<br /> |country = Hong Kong&lt;br/&gt;China&lt;ref&gt;{{cite web|url=http://explore.bfi.org.uk/4ce2b8ab78dea|work=British Film Institute]]|title=Gong Fu|accessdate=12 July 2014}}&lt;/ref&gt;<br /> |language = [[Cantonese]]&lt;ref name=&quot;Hongkong&quot;/&gt;<br /> |budget = $20 million<br /> |gross = $100,914,445&lt;ref name=&quot;BOM&quot;&gt;{{cite web| title =Kung Fu Hustle| url =http://boxofficemojo.com/movies/?id=kungfuhustle.htm| publisher = [[Box Office Mojo]] | accessdate = 4 July 2013 }}&lt;/ref&gt;<br /> }}<br /> {{ChineseText}}<br /> '''''Kung Fu Hustle''''' is a 2004 [[Cinema of Hong Kong|Hong Kong]]-Chinese [[Action film|action]] [[comedy]] martial arts film. It was directed, co-written and co-produced by [[Stephen Chow]], who also stars in the lead role. The other producers were Chui Po-chu and [[Jeffrey Lau]], and the screenplay was co-written with Huo Xin, Chan Man-keung, and Tsang Kan-cheung. [[Yuen Wah]], [[Yuen Qiu]], [[Danny Chan (actor)|Danny Chan]], and [[Leung Siu-lung|Bruce Leung]] co-starred in prominent roles.<br /> <br /> After the commercial success of ''[[Shaolin Soccer]]'', its production company, Star Overseas, began to develop ''Kung Fu Hustle'' with [[Columbia Pictures]] Asia in 2002. The film features a number of retired actors famous for 1970s [[Hong Kong action cinema]], yet has been compared to contemporary and influential martial arts films such as ''[[Crouching Tiger, Hidden Dragon]]'' and ''[[Hero (2002 film)|Hero]].'' The [[Animated cartoon|cartoon]] style of the film, accompanied by traditional [[Music of China|Chinese music]], is often cited as its most striking feature.<br /> <br /> The film was released on 23 December 2004 in China and on 25 January 2005 in the United States. It received highly positive reviews, with [[Rotten Tomatoes]] giving it a 90% fresh rating and [[Metacritic]] 78 out of 100. The film was also a commercial success, grossing US$17 million in North America and US$84 million in other countries. ''Kung Fu Hustle'' was the highest-grossing film in the history of Hong Kong until it was surpassed by ''[[You Are the Apple of My Eye]]'' in 2011.<br /> <br /> The film was the all-time tenth highest-grossing foreign language film in the United States as well as the highest-grossing foreign language film in the country in 2005. ''Kung Fu Hustle'' won numerous awards, including six [[Hong Kong Film Award]]s and five [[Golden Horse Film Festival and Awards|Golden Horse Awards]].<br /> <br /> ==Plot==<br /> In [[Shanghai]] during the 1930s, Brother Sum, the leader of the [[The Axe Gang|Deadly Axe Gang]], exercises control over the city, openly killing anyone who gets in his way. One day, two troublemakers, Sing and Bone, come to Pig Sty Alley impersonating members of the Axe Gang to gain respect. Their plan fails, and Sing's antics attract the real gang to the scene. In the massive brawl that ensues, more than fifty gangsters are defeated by three tenants who are Coolie, a laborer, Fairy, the clothing retailer, and Donut, the noodle chef. Coolie, Fairy, and Donut turn out to be incognito martial arts masters.<br /> <br /> After the fight, Sing and Bone are apprehended by Brother Sum for publicly humiliating the Axe Gang. They are hung by their arms to be killed, but Sing uses his lock picking skills to escape and asks to join the gang. Sum is impressed by Sing's lock picking, so he tells them that if they kill a person they will be accepted into the gang. Asked to explain his escape skills, Sing describes his childhood: he bought a Buddhist Palm manual from a beggar and trained himself to be a martial artist, but when he tried to defend a mute girl from bullies, he was beaten up and humiliated.<br /> <br /> The next day, the duo return to Pig Sty Alley and attempt to murder the Landlady, but their efforts fail. The cantankerous Landlady chases Sing, who becomes badly injured in the process after being bitten on the lips by multiple snakes and hides in a traffic control pulpit, where his multiple injuries including comically swollen lips spontaneously heal, a surprise even to him. As he recovers, thrashing in pain from his injuries, he unconsciously throws his hands outward and violently dents the pulpit from the inside. These dents appear to be the result of kung-fu strikes.<br /> <br /> Meanwhile, Sum hires two mystical assassins to kill the three martial artists at Pig Sty Alley. That night, the Landlady, fearing retaliation from the Axe Gang, evicts the three martial artists. In the process of leaving, Coolie is murdered by the assassins, who use a magical [[guqin]] as their weapon, and Fairy and Donut attain fatal injuries during the fight. The assassins are defeated by the Landlady and Landlord, who are in fact martial arts masters in self-imposed retirement. They had sworn not to fight anymore due to their young son being killed years earlier in a fight. Moments after Fairy dies, a very weak Donut speaks to the Landlord and Landlady right before dying before their eyes. The dead three are surrounded by the grateful but saddened Pig Sty Alley denizens. Afterward, sensing an impending showdown with the Axe Gang, the Landlady and Landlord order all the citizens and tenants to evacuate Pig Sty Alley.<br /> <br /> A desperate Sing mugs an ice cream vendor only to realize she is the mute girl from his childhood. For helping her, the woman offers him the lollipop she had as a girl, but Sing refuses it and knocks it away, shattering it to pieces. Sing berates Bone for being unhelpful in their quest to become Axe members and forces him away. Sing is then picked up by the Axe Gang and in exchange for joining the gang, Sum orders him to break into a [[Psychiatric hospital|mental asylum]] to free a legendary fighter known as the Beast. Sing succeeds (although he experiences several moments of great foreboding during the job) and brings the Beast to Sum at his office. The Beast is initially flippant and his sloppy appearance bewilders Sum, who orders his men to torture the fighter. In response, the Beast stops a bullet with two fingers, and the Axe Gang bows in respect.<br /> <br /> The Beast then confronts the Landlady and Landlord at the casino and they fight, with the Beast having the advantage. The Landlady and Landlord manage to overpower him with a large temple bell through which the Landlady amplifies her [[lama (martial art)|lion's roar]] technique. Just before they finish him off, the Beast proclaims his awe at their abilities and claims to surrender. However, the moment the Landlady and Landlord let down their guard, the Beast treacherously stabs them both in the stomach with concealed daggers. The three end up intertwined, both sides immobilizing the other. Brother Sum orders Sing to hit the Landlord with a table leg. When Brother Sum's berating becomes too much, Sing angrily bashes Brother Sum in the head to get him to shut up. Sing, having reformed, rushes in to help them by hitting the Beast with the table leg. Unfortunately, the blow only incenses the Beast, who pummels Sing into the floor. Before the Beast can deliver the final blow, the Landlord and Landlady grab Sing and flee. Sum angrily berates the Beast for letting them escape, and the Beast casually murders Sum and takes over his men.<br /> <br /> At Pig Sty Alley, Sing undergoes a metamorphosis; the Beast's thrashing has inexplicably awoken his true potential as a kung-fu genius. He quickly recovers from his wounds, and suggests that the Landlord and Landlady rest. He easily defeats the Axe Gang before confronting the Beast. The two engage in a fierce brawl before the Beast uses his Toad Style techniques to send Sing rocketing into the sky. As he falls back to earth, Sing comes to terms with the Buddha and the techniques he learned from the manual as a child, and delivers the Buddhist Palm to defeat the Beast. After a final failed attack on Sing, the Beast accepts his defeat and appears to experience an epiphany. He begins to cry, and kneels before Sing, as if in supplication before his new master.<br /> <br /> Some time later, Sing and Bone open a candy store with the vendor's lollipop as the store sign. When the mute ice cream vendor walks by, Sing goes out to meet her. As they gaze upon one another, the camera spins around them as they transform into the children seen in the flashbacks. They smile, clasp hands and run into the candy store together. Various characters from the movie, who appear to have formed happy couples, walk through the square in front of the store. The beggar (suspected to be a magical traveller) who gave Sing the Buddhist Palm is then seen attempting to sell the Buddhist Palm manual to a young boy. The boy turns to leave until the beggar offers all of the manuals.<br /> <br /> ==Cast==<br /> <br /> *[[Stephen Chow]] as Sing, a loser in life who aspires to join the Axe Gang.<br /> *[[Danny Chan (actor)|Danny Chan]] as Brother Sum, leader of the Axe Gang.<br /> *[[Yuen Wah]] as the Landlord of Pig Sty Alley. He is also a master of [[Tai chi|taijiquan]].<br /> *[[Yuen Qiu]] as the Landlady of Pig Sty Alley. She is a master of the Lion's Roar technique.<br /> *[[Leung Siu-lung|Bruce Leung]] as the Beast, an old but incredibly strong kung fu master. He is rumoured to be the most dangerous person alive, though his skill is disguised by his unkempt appearance. <br /> *[[Xing Yu]] as the [[Coolie]], a kung fu specialist specialising in [[Tán Tuǐ|Twelve Kicks]] of the Tam School.<br /> *[[Chiu Chi-ling]] as Fairy, the Tailor of Pig Sty Alley. He specialises in the art of [[Hung Ga]] Iron Fist Kung fu, and he fights with iron rings on his arms.<br /> *Dong Zhihua as Donut, a baker in Pig Sty Alley. He specialises in the [[Baguazhang|Eight Trigram]] [[Gun (staff)|Staff]].<br /> *[[Lam Chi-chung]] as Bone, Sing's sidekick.<br /> *[[Huang Shengyi|Eva Huang]] as Fong, Sing's mute love interest and childhood acquaintance.<br /> *[[Tin Kai-Man]] as Brother Sum's adviser.<br /> *Gar Hong-hay and Fung Hak-on as the Harpists, two killers hired by the Axe Gang. Their instrument is the [[guqin]], or &quot;Chinese harp&quot;.<br /> *[[Lam Suet]] and Liang Hsiao as high-ranking members of the Axe Gang.<br /> *[[Yuen Cheung-yan]] as the Beggar, the man who sold Sing the Buddhist Palm manual.<br /> *[[Feng Xiaogang]] as the leader of the Crocodile Gang. He is killed by the Axe Gang at the start of the film.<br /> * [[Min-hun Fung]] as 4 eyed clerk<br /> <br /> ==Production==<br /> <br /> ===Development===<br /> [[File:Pig Sty Alley.jpg|thumb|An early sketch of the Pig Sty Alley|left]]<br /> ''Kung Fu Hustle'' is a co-production of the Beijing Film Studio and Hong Kong's Star Overseas.&lt;ref name=Szeto&gt;{{cite web|last = Szeto|first = Kin-Yan|title = The politics of historiography in Stephen Chow's Kung Fu Hustle|publisher = Jump Cut|url = http://www.ejumpcut.org/currentissue/Szeto/index.html|accessdate = 2007-05-05 |archiveurl = http://web.archive.org/web/20070925122214/http://www.ejumpcut.org/currentissue/Szeto/index.html &lt;!-- Bot retrieved archive --&gt; |archivedate = 25 September 2007}}&lt;/ref&gt; After the success of his 2001 film, ''[[Shaolin Soccer]]'', Chow was approached in 2002 by Columbia Pictures Film Production Asia, offering to collaborate with him on a project. Chow accepted the offer, and the project eventually became ''Kung Fu Hustle''.&lt;ref name=&quot;Production Notes&quot;&gt;{{cite web|title=Kung Fu Hustle Production Notes|url=http://www.sensasian.com/view/catalog.cgi/EN/1030{{!}}accessdate|publisher=sensasain.com|accessdate=7 October 2012|archiveurl=http://web.archive.org/web/20051222103730/http://www.sensasian.com/view/catalog.cgi/EN/1030|archivedate=22 December 2005}}&lt;/ref&gt; ''Kung Fu Hustle'' was produced with a budget of US$20 million.&lt;ref&gt;{{cite web|title = Kung Fu Hustle general information|publisher = Box Office Mojo|url = http://www.boxofficemojo.com/movies/?id=kungfuhustle.htm|accessdate = 2007-05-13 }}&lt;/ref&gt;<br /> <br /> Chow was inspired to create the film by the martial arts films he watched as a child and by his childhood ambition to become a martial artist.&lt;ref name=interview&gt;{{cite AV media|people = Stephen Chow|title =Kung Fu Hustle - Interview with Director Stephen Chow|url = http://www.spike.com/video-clips/ps5bg5/kung-fu-hustle-interview-with-director-stephen-chow|medium = Online video|publisher = iFilm|location = Hong Kong|date = 29 July 2005}}&lt;/ref&gt; A senior Hollywood executive said Chow was &quot;forced to grind through four successive scripts&quot; and &quot;found it very laborious&quot;.&lt;ref&gt;{{cite news|url=http://www.nytimes.com/2008/09/15/business/media/15moguls.html |title=China's Media Moguls Tutored by Masters of Hollywood |date=14 September 2008 |author=Michael Cieply |work=The New York Times}}&lt;/ref&gt;<br /> <br /> Chow's first priority was to design the main location of the film, &quot;Pig Sty Alley&quot;. Later in an interview Chow remarked that he had created the location from his childhood, basing the design on the crowded apartment complexes of Hong Kong where he had lived.&lt;ref&gt;{{cite web|last=Hwang|first=Ange|title=An Interview Sidebar with Stephen Chow|url=http://www.amamedia.org/news/interview_stephenchow.shtml|publisher=Asia Media Access|accessdate=4 July 2013}}&lt;/ref&gt;&lt;ref name=inter&gt;{{cite web|last = Roman|first = Julian|title = Stephen Chow talks Kung Fu Hustle|publisher = [[MovieWeb]]|date = 4 April 2005|url = http://www.movieweb.com/news/director-stephen-chow-talks-kung-fu-hustle|accessdate = 2012-09-14 }}&lt;/ref&gt; The 1973 [[Shaw Brothers Studio]] film, ''[[The House of 72 Tenants]]'', was another inspiration for Pig Sty Alley.&lt;ref name=Synoptique&gt;{{cite web|last = Xu|first = Gary|title = The Gongfu of Kung Fu Hustle|publisher = Synoptique|url = http://www.synoptique.ca/core/en/articles/xu_gongfu/|accessdate = 2007-05-05 }}&lt;/ref&gt; Designing the Alley began in January 2003 and took four months to complete. Many of the props and furniture in the apartments were antiques from all over China.&lt;ref&gt;{{cite AV media|people = Stephen Chow|title = Kung Fu Hustle Production Design|url = http://www.movieweb.com/movie/kung-fu-hustle/production-design|medium = Online video|publisher = MovieWeb|location = Hong Kong|date = 29 July 2005 }}&lt;/ref&gt;<br /> <br /> ===Casting===<br /> ''Kung Fu Hustle'' features several prolific Hong Kong action cinema actors from the 1970s. [[Yuen Wah]], a former student of the China Drama Academy [[Peking Opera School]] who appeared in over a hundred Hong Kong films and was a [[stunt double]] for [[Bruce Lee]], played the Landlord of Pig Sty Alley. Wah considered starring in ''Kung Fu Hustle'' to be the peak of his career. In spite of the film's success, he worried that nowadays fewer people practice martial arts.&lt;ref name=&quot;:0&quot;&gt;{{cite news<br /> |last = Zhang<br /> |first = Xiaomin<br /> |title = 从李小龙替身到影帝 元华:担忧中国功夫后继无人 (From a Bruce Lee impersonator to a movie star: Yuen Wah worries that Chinese martial arts may lack a successor)<br /> |language = Chinese<br /> |publisher = Eastern Sports Daily<br /> |url = http://www.donnieyen.net/htm/kungfustar/185410374.htm<br /> |accessdate = 2007-05-17 |archiveurl=http://web.archive.org/web/20060901133245/http://www.donnieyen.net/htm/kungfustar/185410374.htm<br /> |archivedate=1 September 2006}}&lt;/ref&gt;<br /> <br /> Auditions for the role of the Landlady began in March 2003, [[Yuen Qiu]] who did not audition, was spotted, during her friend's screen test smoking a cigarette with a sarcastic expression on her face, which won her the part.&lt;ref name=&quot;DVD extras&quot;/&gt; Qiu, a student of [[Yu Jim-yuen]], ''[[sifu]]'' of the China Drama Academy, had appeared in the 1974 [[James Bond]] film ''[[The Man with the Golden Gun (film)|The Man with the Golden Gun]]'' at the age of 18.&lt;ref name=&quot;YuenQiu&quot;&gt;{{cite web|title = 元秋:演007时我才十几岁 现在不担心形象 (Yuen Qiu: I was only 18 when I appeared in a Bond Film, I don't worry about my image now)|publisher = Sina Corp|date = 17 December 2004|url = http://ent.sina.com.cn/2004-12-17/1853602893.html|accessdate=2007-05-16|language = Chinese}}&lt;/ref&gt; After a number of other small roles, she retired from films in the 1980s. ''Kung Fu Hustle'' was her first role in nineteen years. Qiu, in order to fulfill Chow's vision for the role, gained weight for the role by eating midnight snacks everyday.&lt;ref name=&quot;YuenQiu&quot; /&gt;<br /> <br /> [[Leung Siu-lung|Bruce Leung]], who played the Beast, was Stephen Chow's childhood martial arts hero.&lt;ref name=inter/&gt; Leung Siu Lung was a famous action film director and actor in the 1970s and 1980s, known as the &quot;Third Dragon&quot; after Bruce Lee and [[Jackie Chan]]. After becoming unpopular in the Taiwanese film market in the late 1980s following a visit to China, he switched to a career in business. ''Kung Fu Hustle'' was his return to the film industry after a fifteen-year hiatus. He regarded Chow as a flexible director with high standards, and was particularly impressed by the first scene involving the Beast, which had to be reshot 28 times.&lt;ref&gt;{{cite news<br /> |last = Li<br /> |first = Yijun<br /> |title =《功夫》配角都有功夫 (The supporting characters of Kung Fu Hustle know kung fu)|language = Chinese<br /> |publisher = Zaobao<br /> |date = 24 December 2004<br /> |url = http://stars.zaobao.com/pages1/stephen241204.html|accessdate = 2007-05-17 |archiveurl=http://web.archive.org/web/20041230162842/http://stars.zaobao.com/pages1/stephen241204.html<br /> |archivedate=30 December 2004}}&lt;/ref&gt;<br /> <br /> In addition to famous martial artists, ''Kung Fu Hustle'' features legends of [[Cinema of China|Chinese cinema]]. Two famous Chinese directors appear in the film: [[Zhang Yibai]], who plays Inspector Chan at the beginning of the film, and [[Feng Xiaogang]], who plays the boss of the Crocodile Gang.&lt;ref name=Geo&gt;{{cite web|last = Kin-Wah|first = Szeto|title = Geopolitical imaginary: Hong Kong, the Mainland and Hollywood|publisher = Jump Cut|url = http://www.ejumpcut.org/currentissue/Szeto/2.html|accessdate = 2007-05-11 |archiveurl = http://web.archive.org/web/20070927181930/http://www.ejumpcut.org/currentissue/Szeto/2.html &lt;!-- Bot retrieved archive --&gt; |archivedate = 27 September 2007}}&lt;/ref&gt;<br /> <br /> In casting Sing's love interest Fong, Chow stated that he wanted an innocent looking girl for the role. Television actress [[Huang Shengyi|Eva Huang]], in her film debut, was chosen from over 8,000 girls. When asked about his decision in casting her Chow said that he &quot;just had a feeling about her&quot; and said that he enjoyed working with new actors. She chose to have no dialogue in the film so that she could stand out only with her body gestures.&lt;ref name=&quot;DVD extras&quot;&gt;{{cite DVD notes |title=Kung Fu Hustle |origyear=2005 |others=Stephen Chow |type=TV Special - Behind the Scenes of KUNG FU HUSTLE Featurette |publisher= |location= |id= |year= |language= }}<br /> &lt;/ref&gt;&lt;ref&gt;{{cite news|title = 《功夫》明星说功夫 梁小龙演反派感觉很陌生 (Kung Fu Hustle actors comment on the film)|language = Chinese|publisher = Sina Corp|date = 15 December 2007|url = http://ent.sina.com.cn/m/c/2004-12-15/1150599985.html|accessdate = 2007-05-17 }}&lt;/ref&gt;<br /> <br /> ===Filming===<br /> [[File:Buddhist palm construction.jpg|thumb|CGI construction of the Buddhist Palm|right]]<br /> Filming took place in Shanghai from June 2003 to November 2003.&lt;ref name=CGI&gt;{{cite news|last = Zu|first = Blackcat|title = An Interview with the Production Team (Centro Digital Pictures Ltd.)|page = 1|language = Chinese|publisher = CGVisual|date = 31 December 2004|url = http://www.cgvisual.com/headlines/Centro_kungFu/CGVheadlines_kungFu.htm|accessdate = 2007-05-17 }}&lt;/ref&gt; Two-thirds of the time was spent shooting the fight sequences.&lt;ref name=interview/&gt; Those scenes were initially choreographed by [[Sammo Hung]], who quit after two months due to illness, tough outdoor conditions, interest in another project and arguments with the production crew.&lt;ref&gt;{{cite news|last = Zhu|first = Rongbin|title = 洪金寶走人袁和平救場 《功夫》緊急走馬換將 (Sammo Hung quits and is replaced by Yuen Woo-Ping)|language = Chinese|publisher = Eastern News|date = 20 August 2003|url = http://news.eastday.com/epublish/big5/paper148/20030820/class014800007/hwz999348.htm|accessdate = 2007-05-17 }}&lt;/ref&gt; Hung was replaced by [[Yuen Woo-ping]], an action choreographer with experience ranging from 1960s [[Hong Kong action cinema]] to more recent films like ''[[Crouching Tiger, Hidden Dragon]]'' and ''[[The Matrix]]''. Yuen promptly accepted the offer.&lt;ref name=&quot;Production Notes&quot;/&gt; Yuen drew on seemingly outdated [[wuxia]] fighting styles like the Deadly Melody and Buddhist Palm.&lt;ref&gt;{{cite news|last = Zhang|first = Wenbo|script-title=zh:绝世功夫之技术篇--想像力的最高境界|language = Chinese|publisher = The Beijing News|date = 27 December 2004|url = http://ent.sina.com.cn/r/m/2004-12-27/1345611519.html|accessdate = 2007-05-17 }}&lt;/ref&gt; He remarked that despite the comedic nature of the film, the shooting process was a serious matter due to the tight schedule.&lt;ref name=&quot;:0&quot; /&gt;<br /> <br /> Most of the special effects in the film, created by Hong Kong computer graphics company [[Centro Digital Pictures Limited]], which had previously worked on films such as ''Shaolin Soccer'' and ''[[Kill Bill]]'', included a combination of [[computer-generated imagery]] and [[Wire fu|wire work]]. Centro Digital performed extensive tests on CGI scenes before filming started, and treatment of the preliminary shots began immediately afterwards. The CGI crew edited out wire effects and applied special effects in high resolution. Legendary martial arts mentioned in wuxia novels were depicted and exaggerated through CGI, but actual people were used for the final fight between Chow's character and hundreds of axe-wielding gangsters.&lt;ref name=Szeto/&gt; After a final calibration of colour, data of the processed scenes was sent to the US for the production of the final version. A group of six people followed the production crew throughout the shooting.&lt;ref name=CGI/&gt;<br /> <br /> ===Music===<br /> {{Main|Kung Fu Hustle (soundtrack)}}<br /> The majority of the film's original score was composed by [[Raymond Wong (composer)|Raymond Wong]] and performed by the [[Hong Kong Chinese Orchestra]].&lt;ref name=&quot;HKCO&quot;&gt;{{cite web | title = About the Hong Kong Chinese Orchestra | publisher = Hong Kong Chinese Orchestra | url = http://www.hkco.org/Eng/about_hkco_eng.asp | accessdate = 2007-05-13 |archiveurl = http://web.archive.org/web/20070618110155/http://www.hkco.org/Eng/about_hkco_eng.asp &lt;!-- Bot retrieved archive --&gt; |archivedate = 18 June 2007}}&lt;/ref&gt; The score imitates traditional Chinese music used in 1940s swordplay films.&lt;ref&gt;{{cite web|last = Pollard|first = Mark|title = Kung Fu Hustle review|publisher = Kung Fu Cinema|url = http://www.kungfucinema.com/reviews/kungfuhustle_082205.htm|accessdate = 2007-05-18 |archiveurl = http://web.archive.org/web/20070502050543/http://www.kungfucinema.com/reviews/kungfuhustle_082205.htm &lt;!-- Bot retrieved archive --&gt; |archivedate = 2 May 2007}}&lt;/ref&gt; One of Wong's works, ''Nothing Ventured, Nothing Gained'', provides a stark contrast between the villainous Axe Gang and the peaceful neighbourhood of Pig Sty Alley, depicted by a Chinese folk song, ''Fisherman's Song of the East China Sea''.&lt;ref name=Geo/&gt; Along with Wong's compositions and various traditional Chinese songs, classical compositions are featured in the score, including excerpts from ''[[Zigeunerweisen]]'' by [[Pablo de Sarasate]] and ''[[Sabre Dance]]'' by [[Aram Khachaturian]].&lt;ref name=Kozo&gt;{{cite web|last = Sung|first = Mark|title = Kung Fu Hustle review|year = 2004|url = http://www.lovehkfilm.com/reviews_2/kung_fu_hustle.htm|accessdate = 2007-05-12 }}&lt;/ref&gt; The song, ''Zhiyao Weini Huo Yitian'' (只要為你活一天; ''Only Want to Live One Day for You''), is sung in the background by Eva Huang at the end of the film. Written by [[Liu Chia-chang]] (劉家昌) in the 1970s, it tells of a girl's memories of a loved one, and her desire to live for him again.&lt;ref&gt;{{cite web|title = Kung Fu Hustle production notes|work = Rotten Tomatoes|url = http://www.rottentomatoes.com/m/kung_fu_hustle/about.php|accessdate = 2 July 2013|publisher=[[Flixster]] }}&lt;/ref&gt; ''Kung Fu Hustle'' was nominated for Best Original Film Score at the 24th [[Hong Kong Film Award]]s.&lt;ref&gt;{{cite web|last = Anon|first = Kozo|title = Kung Fu Hustle review|date = 14 March 2005|url = http://soundtracks.monstersandcritics.com/news/article_5180.php/Kung_Fu_Hustle_Soundtrack_Artwork_&amp;_Details|accessdate = 2007-05-12 }}&lt;/ref&gt;<br /> <br /> Asian and American versions of the soundtrack were released. The Asian version of the soundtrack was released on 17 December 2004 by [[Sony Music Entertainment]] and has 33 tracks.&lt;ref&gt;{{cite web|title = Soundtrack Details of Kung Fu Hustle|date = 17 December 2004|url = http://www.soundtrackcollector.com/catalog/soundtrackdetail.php?movieid=70817|accessdate = 2007-05-12 }}&lt;/ref&gt; The American version of the soundtrack was released on 29 March 2005 by [[Varèse Sarabande]] and has 19 tracks but has 14 tracks missing from the Asian release.&lt;ref&gt;{{cite web|title = Kung Fu Hustle soundtrack information|date = 29 March 2005|url = http://www.vh1.com/movies/movie/263855/879108/soundtrack_info.jhtml|accessdate = 2007-05-12 }}&lt;/ref&gt;<br /> <br /> The soundtrack for the trailer was mastered at Epiphany Music and Recording, Inc. in Santa Rosa, California.<br /> <br /> ==References to other works==<br /> &lt;!--Please only add content that is related to what the characters said in the Cantonese language version of the film. The English dubbing isn't consistent and should not be considered the &quot;right&quot; version.--&gt;<br /> ''Kung Fu Hustle'' makes references to a wide range of films, [[animated cartoon]]s, [[wuxia]] novels and other sources. Sing and Bone resemble George Milton and Lennie Small from the 1992 film [[Of Mice and Men (1992 film)|''Of Mice and Men'']].&lt;ref name=&quot;Parodies and references&quot;&gt;Kung Fu Hustle {{cite web |title=Movie Classic – Kung Fu Hustle (2004)|url=http://www.stuff.tv/news/life-etc/movie-classics/movie-classic-kung-fu-hustle-2004 |publisher= stuff.tv|accessdate=13 March 2013}}&lt;/ref&gt; The housing arrangement of the Pig Sty Alley is similar to that of a 1973 Hong Kong film, ''[[The House of 72 Tenants]]''. There are two references to Chow's previous film, ''Shaolin Soccer. ''When Sing arrives at Pig Sty Alley, he plays skillfully with a soccer ball, then says, &quot;You're still playing football?&quot;. The second reference is the scene in which a clerk beats Sing up on a bus. The clerk also appeared in ''Shaolin Soccer'' as the leader of an opposing team who used hidden weapons to beat up the Shaolin soccer team. When Sing challenges a boy in the Pig Sty Alley, Sing calls him &quot;The Karate Kid&quot;, a reference to [[The Karate Kid (1984 film)|the 1984 film of the same name]]. During the altercation between Sing and the hairdresser, the hairdresser states, &quot;Even if you kill me, there will be thousands more of me!&quot;. This is a reference to a famous quote made by [[Lu Haodong]], a Chinese revolutionary in the late [[Qing Dynasty]].&lt;ref name=&quot;Ru Lai Shen Zhang&quot;&gt;{{cite web|title = 從金剛腿到如來神掌—論《功夫》(From the Steel Leg to Ru Lai Shen Zhang, Kung Fu Hustle)|publisher = Department of Chinese Literature, Sun-Yat-Sen university|date = 21 April 2005|url = http://www.chinese.nsysu.edu.tw/932chp/article/f04.htm|accessdate = 2007-05-04 |archiveurl = http://web.archive.org/web/20070529141707/http://www.chinese.nsysu.edu.tw/932chp/article/f04.htm &lt;!-- Bot retrieved archive --&gt;|archivedate = 29 May 2007|language=zh}}&lt;/ref&gt; The scene in which Sing is chased by the Landlady as he flees from the Alley is a homage to [[Wile E. Coyote and Road Runner]], characters in the ''[[Looney Tunes]]'' cartoons, even including the pursuer's (the Landlady's) ill fate. In the scene in which Sing robs the ice cream vendor, a poster for the 1935 film ''[[Top Hat]]'' is in the background. As Sing arrives at the door to the Beast's cell in the mental asylum, he hallucinates a large wave of blood rushing from the cell door, similar to a scene in ''[[The Shining (film)|The Shining]]''.&lt;ref&gt;<br /> {{cite web|last = Glaze|first = Violet|title = Review: Kung Fu Hustle|work = Citypaper Film|date = 20 April 2005|url = http://citypaper.com/film/review.asp?rid=8708|accessdate = 2007-07-10 }}&lt;/ref&gt;<br /> <br /> A major element of the plot is based on the wuxia film series ''Palm of Ru Lai'' (如來神掌), released in 1964.&lt;ref name=&quot;Palm of Ru Lai&quot;&gt;Kung Fu Hustle {{cite web |title=Navigating Netflix: Kung Fu Hustle|url=http://www.spectatortribune.com/article/navigating-netflix-kung-fu-hustle/ |publisher= pectatortribune.com|accessdate=13 March 2013}}&lt;/ref&gt; Sing studied the fighting style used in ''Palm of Ru Lai'' (&quot;[[Fut Gar|Buddhist Palm style]]&quot;), from a young age and used it at the end of ''Kung Fu Hustle''. In reality, the Buddhist Palm fighting style does not leave palm-shaped craters and holes on impact. Instead, the user delivers powerful punches using his palm. The Beast's name in Chinese, ''Huoyun Xieshen'' (火雲邪神; Evil Deity of the Fiery Cloud), and the fight with the Landlady and her husband are also references to the ''Palm of Ru Lai,'' in which a mortally wounded master strikes the patterns of his art's final techniques into a bell so that his apprentice can learn from it.&lt;ref&gt;{{cite web|title = Plot summary of Ru Lai Shen Zhang|publisher = Pearlcity|url = http://www.pearlcity.com.hk/f4.htm|accessdate = 2007-05-17 |language=zh}}&lt;/ref&gt; ''Kung Fu Hustle'' also contains direct references to characters from [[Jin Yong|Louis Cha]]'s wuxia novels. For example, the landlord and landlady refer to themselves as [[Yang Guo]] and [[Xiaolongnü]], the names of characters in Cha's ''[[The Return of the Condor Heroes]]'', when they met the Beast.&lt;ref&gt;{{cite web|title = 神鵰俠侶‧人物介紹 (Character introduction of The Return of the Condor Heroes)|publisher = [[Television Broadcasts Limited|TVB]]|url = http://tvcity.tvb.com/drama/the_saviour_of_the_soul/cast/index.html|accessdate = 2007-05-04 |language=zh}}&lt;/ref&gt;<br /> <br /> [[File:Kung fu hustle matrix parody.jpg|thumb|An aerial shot of Sing fighting the Axe Gang. The fight is reminiscent of ''[[The Matrix Reloaded]]''.|225px|right]]<br /> References to gangster films are also present. The boss of the Axe Gang, Brother Sum (琛哥) is named after Hon Sam / Hon Sum (韓琛), the triad boss played by [[Eric Tsang]] in ''[[Infernal Affairs]]''.&lt;ref&gt;{{cite web|title = Infernal Affairs Summary|publisher = Star Boulevard|url = http://movie.starblvd.net/cgi-bin/movie/euccns?/film/2002/InfernalAffairs/InfernalAffairs.html|accessdate = 2007-05-14 |archiveurl = http://web.archive.org/web/20070503100807/http://movie.starblvd.net/cgi-bin/movie/euccns?/film/2002/InfernalAffairs/InfernalAffairs.html &lt;!-- Bot retrieved archive --&gt; |archivedate = 3 May 2007|language=zh}}&lt;/ref&gt; The Harpists imitate ''[[The Blues Brothers (film)|The Blues Brothers]]'', wearing similar hats and sunglasses at all times.&lt;ref name=&quot;Parodies and references 3&quot;&gt;Kung Fu Hustle {{cite web |title=CHOW, STEPHEN – KUNG FU HUSTLE|url=http://www.urbancinefile.com.au/home/view.asp?a=10653|publisher= urbancinefile.com.au|accessdate=13 March 2013}}&lt;/ref&gt; When they are flattered by the Axe Gang advisor, one of them answers &quot;Strictly speaking we're just musicians&quot;, similar to a line by Elwood Blues.&lt;ref&gt;{{cite AV media|people = Dan Aykroyd|title = The Blues Brothers|medium = DVD|publisher = Universal Pictures|location = Chicago|year = 1980 }}&lt;/ref&gt;<br /> <br /> When Donut dies, he says, &quot;In great power lies great responsibility&quot;, a reference to ''[[Spider-Man (2002 film)|Spider-Man]]'', said by [[Uncle Ben]] before his death.&lt;ref name=&quot;Ru Lai Shen Zhang&quot;/&gt; Afterwards, with his dying breath, Donut gets up, grabs the Landlord by the shirt and utters in English, &quot;What are you prepared to do?&quot;, a nod to [[Sean Connery]]'s character Jim Malone in [[Brian De Palma]]'s 1987 film ''[[The Untouchables (film)|The Untouchables]].''&lt;ref name=&quot;Parodies and references&quot; /&gt;&lt;ref&gt;{{cite AV media|people = Sean Connery|title = The Untouchables|medium = DVD|publisher = Paramount Pictures|location = Chicago|year = 1987 }}&lt;/ref&gt;<br /> <br /> The dialogue that the Beast says while negotiating with the Axe Gang for killing the Landlady and Landlord – &quot;...then young friend, I will make an offer you cannot refuse&quot;, is a reference of the dialogue from the movie 'The Godfather'.&lt;ref name=&quot;Parodies and references&quot; /&gt; Also, the Landlady's comment to Brother Sum – &quot;We brought a gift you cannot refuse&quot; is an obvious parody of [[The Godfather#American Film Institute|the same]], to which Sum replies (in the dubbed version of the film), &quot;Ha! With the Beast on our side, we shall see for whom the bell tolls&quot;, a reference to [[For Whom the Bell Tolls (film)|the 1943 film]].&lt;ref&gt;{{cite AV media|people = |title = For Whom the Bell Tolls|medium = DVD|publisher = Universal Pictures|location = |year = 1943 }}&lt;/ref&gt;<br /> <br /> The final fight between Sing (who has been reborn into &quot;the one&quot;, which pays homage to Bruce Lee by wearing his costume in ''Enter the Dragon'' and using his fighting style) and the hundreds of gangsters imitates the fight between [[Neo (The Matrix)|Neo]] and hundreds of [[Agent Smith]]s in ''[[The Matrix Reloaded]]''.&lt;ref name=Szeto/&gt;&lt;ref name=&quot;Ru Lai Shen Zhang&quot;/&gt; The scene in which the Beast prompts an axe member to punch him harder is reminiscent of a similar scene in ''[[Raging Bull]]'', with [[Robert De Niro]]'s character prompting [[Joe Pesci]]'s character.&lt;ref name=&quot;Parodies and references&quot; /&gt;<br /> <br /> The last scene, in which the beggar tries to sell martial arts manuals, refers directly to the greatest skills in Louis Cha's ''[[Condor Trilogy]]'' (''[[Jiuyang Zhenjing|Nine Yang Manual]]'', &quot;Yiyang Finger&quot;, and &quot;[[Beggars' Sect|Eighteen Dragon Subduing Palms]]&quot;), &quot;Thousand Hand Divine Fist&quot;, and ''[[The Smiling, Proud Wanderer]]'' (&quot;[[Dugu Qiubai|Nine Swords of Dugu]]&quot;). The scene in which the landlady confronts Brother Sum in the back of his car is a homage to Bruce Lee in ''[[Way of the Dragon]]'', where he cracks his knuckles and gives a quick upper nod to the mafia boss, telling him to back off.&lt;ref name=&quot;Parodies and references 2&quot;&gt;Kung Fu Hustle {{cite web |title=GOING TO THE SOURCE: KUNG FU HUSTLE AND ITS CINEMATIC ROOTS AT THE 29TH HKIFF|url=http://www.hkcinemagic.com/en/page.asp?aid=135&amp;page=7 |publisher= stuff.tv|accessdate=13 March 2013}}&lt;/ref&gt;<br /> <br /> ==Releases==<br /> ''Kung Fu Hustle'' premiered at the [[2004 Toronto International Film Festival]].&lt;ref&gt;{{cite web|title=Kung Fu Hustle Premieres in Toronto|url=http://www.china.org.cn/english/features/film/107258.htm|publisher=[[China Internet Information Center]]|accessdate=4 July 2013}}&lt;/ref&gt; It was later released across East Asia including China, Hong Kong and Malaysia in December 2004.&lt;ref&gt;{{cite web |last= Kay |first= Jeremy |coauthors= |title=Kung Fu Hustle Smashes Asian Records Through SPRI |url=http://www.screendaily.com/kung-fu-hustle-smashes-asian-records-through-spri/4021447.article |date=27 December 2004 |work= |publisher=[[Screen International]] |accessdate=4 July 2013}}&lt;/ref&gt; The film was first shown in the US at the [[Sundance Film Festival]] in January 2005,&lt;ref&gt;{{cite news|last=Booth|first=William|title=A Way With the Punch Line|accessdate=4 July 2013|newspaper=[[The Washington Post]]|date=21 April 2005}}&lt;/ref&gt; and then opened in a general release on 22 April 2005 after being shown in Los Angeles and New York for two weeks.&lt;ref&gt;{{cite news|last=Kehr|first=Dave|title=Excuse Me While I Kiss the Buddha in the Sky|url=http://www.nytimes.com/2005/04/03/movies/03kehr.html?_r=0|accessdate=4 July 2013|newspaper=[[The New York Times]]|date=3 April 2005}}&lt;/ref&gt;<br /> <br /> The North American DVD release was on 8 August 2005.&lt;ref name = &quot;Rotten Tomatoes&quot;/&gt; A [[Blu-ray Disc|Blu-ray]] version of the DVD was released on 12 December 2006 by Sony Pictures. A UMD version of the film was released for the PlayStation Portable.&lt;ref&gt;{{cite web|url=http://www.allmovie.com/movie/kung-fu-hustle-v314244/releases|work=Allmovie|publisher=[[Rovi Corporation]]|title=Kung Fu Hustle (2004) - Releases|accessdate= 2 July 2013}}&lt;/ref&gt; The United States DVD releases was censored and cut in a number of scenes that featured a lot of blood or human excrement, a later release saw these edits removed.&lt;ref&gt;{{cite web|title=Comparison of the cut US cinema version (R-rated) and the uncut Hong kong version|url=http://www.movie-censorship.com/report.php?ID=858212|publisher=movie-censorship.com|accessdate=8 July 2013}}&lt;/ref&gt;&lt;ref&gt;{{cite web|title=Kung Fu Hustle Region One Cuts (US - )|url=http://www.dvdactive.com/editorial/articles/kung-fu-hustle-region-1-cuts.html|publisher=dvdactive.com|accessdate=8 July 2013}}&lt;/ref&gt;<br /> <br /> In the United Kingdom the standard DVD was released 24 October 2005, the same day a special edition was released with collect item which included playing cards, keyring, sweat band and an inflatable axe.&lt;ref&gt;{{cite web|title=Kung Fu Hustle DVD 2005|url=http://www.amazon.co.uk/Kung-Hustle-DVD-Stephen-Chow/dp/B000AAVDGA|publisher=amazon.co.uk|accessdate=8 July 2013}}&lt;/ref&gt;&lt;ref&gt;{{cite web|title=Kung Fu Hustle DVD Special Edition|url=http://www.amazon.co.uk/Kung-Hustle-DVD-Stephen-Chow/dp/B000B6F8YG|publisher=amazon.co.uk|accessdate=8 July 2013}}&lt;/ref&gt; On 8 April 2007 Sony Pictures Home Entertainment release a Blu-ray version.&lt;ref&gt;{{cite web|title=Kung Fu Hustle Blu-ray 2007|url=http://www.amazon.co.uk/Kung-Hustle-Blu-ray-Region-Free/dp/B000IHYBTG|publisher=amazon.co.uk|accessdate=8 July 2013}}&lt;/ref&gt;<br /> <br /> The [[Portuguese language|Portuguese]] title of the film is ''Kungfusão'', which sounds like Kung Fu and ''Confusão'' (confusion).&lt;ref&gt;{{cite web|title = Filme – Kung-fusão (Kung Fu Hustle)|publisher = CinePop|url = http://www.cinepop.com.br/filmes/kungfusao.htm|accessdate = 2007-05-06 |language=pt}}&lt;/ref&gt; In the same way as ''Kungfusão'', the Italian and Spanish titles were ''Kung-fusion'' and ''Kung-fusión'', puns of &quot;confusion&quot;.&lt;ref&gt;{{cite web<br /> |title = Official site of Kung-fusion<br /> |publisher = Sony Pictures Releasing International<br /> |url = http://www.kung-fusion.it/|accessdate = 2007-05-06 |archiveurl=http://web.archive.org/web/20060506211501/http://www.kung-fusion.it/<br /> |archivedate=6 May 2006}}&lt;/ref&gt;&lt;ref&gt;{{cite web|title = Spanish review of Kung-fusión|publisher = Fotograma|url = http://fotograma.com/notas/reviews/3724.shtml|accessdate = 2007-05-06 |language=es}}&lt;/ref&gt; In France, the film is known as ''Crazy Kung Fu'', and the [[Hungarian language|Hungarian]] title is ''A Pofonok Földje'', meaning ''The Land of Punches''.&lt;ref&gt;{{cite web|title = Crazy kung-fu|publisher = Allocine|date = 8 June 2005|url = http://www.allocine.fr/film/fichefilm_gen_cfilm=57959.html|accessdate = 2007-05-14 |language=fr}}&lt;/ref&gt;&lt;ref&gt;{{cite web|last = Viktor|first = Szekeres|title = A pofonok földje – Stephen Chow megmutatja|publisher = SG.hu|date = 9 July 2005|url = http://www.sg.hu/cikkek/38013/a_pofonok_foldje_stephen_chow_megmutatja|accessdate = 2007-05-14 |language=hu}}&lt;/ref&gt;<br /> <br /> In Korea a Limited Collector's Edition DVD was released which included a leather wallet, Stephen Chow's Palm Figure with his signature, a photo album and Special Kung Fu's Booklet with a Certificate of authenticity.&lt;ref&gt;{{cite web|title=Kung Fu Hustle Limited Edition (Korean Version) DVD Region 3|url=http://www.yesasia.com/global/kung-fu-hustle-limited-edition-korean-version/1003974352-0-0-0-en/info.html|publisher=yesasia.com|accessdate=6 July 2013}}&lt;/ref&gt;<br /> <br /> ==Reception==<br /> The film was generally well received by critics, earning the score of 90% fresh on [[Rotten Tomatoes]] based on a total of 166 reviews.&lt;ref name = &quot;Rotten Tomatoes&quot;&gt;{{cite web|title = Kung Fu Hustle|work = Rotten Tomatoes|url = http://www.rottentomatoes.com/m/kung_fu_hustle/|accessdate = 2 July 2013|publisher=Flixster }}&lt;/ref&gt; Hong Kong director and film critic Gabriel Wong praised the film for its [[black comedy]], special effects and nostalgia, citing the return of many retired kung fu actors from the 1970s.&lt;ref&gt;{{cite web|last = Wong|first = Gabriel|script-title=zh:周星驰显大将风范|language = Chinese|agency = Xinhua News Agency|date = 28 December 2004|url = http://news.xinhuanet.com/ent/2004-12/28/content_2387471.htm|accessdate = 2009-04-14 }}&lt;/ref&gt; Film critic [[Roger Ebert]] description of the film (&quot;like Jackie Chan and Buster Keaton meet Quentin Tarantino and Bugs Bunny&quot;), was printed on the promotion posters for Kung Fu Hustle in the US.&lt;ref&gt;{{cite news|last = Ebert|first = Roger|title = Kung Fu Hustle Review|publisher = Roger Ebert|date = 21 April 2005|url = http://www.rogerebert.com/reviews/kung-fu-hustle-2005|accessdate = 2013-07-01 }}&lt;/ref&gt;&lt;ref&gt;{{cite news|title = Kung Fu Hustle promotional poster in the United States|date = 22 April 2005|url = http://rogerebert.suntimes.com/apps/pbcs.dll/article?AID=/20050422/REVIEWS/50411001/1023|accessdate = 2007-05-13|work=Chicago Sun-Times}}&lt;/ref&gt;&lt;ref&gt;{{cite web|title = Kung Fu Hustle|publisher = [[MovieWeb]]|url = http://www.movieweb.com/movies/film/78/2678/poster1.php|accessdate = 2007-05-13 |archiveurl = http://web.archive.org/web/20070930204701/http://www.movieweb.com/movies/film/78/2678/poster1.php &lt;!-- Bot retrieved archive --&gt; |archivedate = 30 September 2007}}&lt;/ref&gt; Other critics described it as a comedic version of ''Crouching Tiger, Hidden Dragon''.&lt;ref&gt;{{cite web|last = Douglas|first = Michael|title = Kung Fu Hustle Review|publisher = Comingsoon.net|url = http://www.comingsoon.net/news/reviewsnews.php?id=9049|accessdate = 2007-05-28 }}&lt;/ref&gt; Positive reviews generally gave credit to the elements of [[mo lei tau]] comedy present in the film.&lt;ref&gt;{{cite web|url=http://www.radiotimes.com/film/vhsj/kung-fu-hustle-(2004)|title=Kung Fu Hustle|work=Radio Times|accessdate=2013-06-01}}&lt;/ref&gt; A number of reviewers viewed it as a computer-enhanced Looney Tunes punch-up.&lt;ref name = &quot;Rotten Tomatoes&quot;/&gt;&lt;ref&gt;{{cite web|url=http://www.bbc.co.uk/films/2005/05/23/kung_fu_hustle_2005_review.shtml|author=Arendt, Paul|publisher=BBC|date=24 June 2005|title=Kung Fu Hustle (2005)|accessdate=2009-06-05}}&lt;/ref&gt; In a 2010 ''[[GQ]]'' interview, actor [[Bill Murray]] called ''Kung Fu Hustle'' &quot;the supreme achievement of the modern age in terms of comedy&quot;.&lt;ref&gt;{{cite web|last=Fierman|first=Dan|title=Bill Murray Is Ready To See You Now|url=http://www.gq.com/entertainment/celebrities/201008/bill-murray-dan-fierman-gq-interview?currentPage=2|work=GQ|accessdate=2 October 2011}}&lt;/ref&gt;<br /> <br /> Much of the criticism for the film was directed at its lack of character development and a coherent plot. ''Las Vegas Weekly'', for instance, criticised the film for not enough of a central protagonist and character depth.&lt;ref&gt;{{cite web|last = Bell|first = Josh|title = Screen: Kung Fu Hustle|publisher = Las Vegas Weekly|date = 21 April 2005|url = http://www.lasvegasweekly.com/2005/04/21/screen2.html|accessdate = 2007-05-04 |archiveurl = http://web.archive.org/web/20070421013406/http://www.lasvegasweekly.com/2005/04/21/screen2.html &lt;!-- Bot retrieved archive --&gt;|archivedate = 21 April 2007}}&lt;/ref&gt; Criticisms were also directed at the film's cartoonish and childish humour.&lt;ref&gt;{{cite web|first = Scott|author = Patrick|title = Kung Fu Hustle movie review|publisher = Threemoviebuffs|date = 24 April 2005|url = http://www.threemoviebuffs.com/review.php?movieID=kungfuhustle|accessdate = 2007-05-04 }}&lt;/ref&gt; [[Richard Roeper]] gave it a negative review, saying he had &quot;never been a fan of that over the top slapstick stuff&quot;.&lt;ref&gt;{{cite web|last = Holtreman|first = Vic|title = Ebert and *cough* Roeper: Anyone Still Watch This Show?|publisher = Screen Rant|date = 19 April 2005|url = http://screenrant.com/ebert-and-cough-roeper-anyone-still-watch-this-show-vic-322/|accessdate = 2008-08-08 }}&lt;/ref&gt;<br /> <br /> ===Box office===<br /> ''Kung Fu Hustle'' opened in Hong Kong on 23 December 2004, and earned [[HK$]]4,990,000 on its opening day. It stayed at the top of the box office for the rest of 2004 and for much of early 2005, eventually grossing HK$61.27 million. Its box office tally made it the highest-grossing film in Hong Kong history,&lt;ref name=&quot;variety-apple&quot;&gt;{{cite web|url=http://variety.com/2012/film/news/borders-in-disorder-1118049322/|work=[[Variety (magazine)|Variety]]|title=Borders in disorder|accessdate=2 July 2013|date=14 February 2012|author=Coonan, Clifford}}&lt;/ref&gt; until it was beaten by ''[[You Are the Apple of My Eye]]'' in 2011.&lt;ref name=&quot;variety-apple&quot; /&gt;<br /> <br /> ''Kung Fu Hustle'' began a limited two-week theatrical run in New York City and Los Angeles on 8 April 2005 before being widely released across North America on 22 April. In its first week of limited release in seven cinemas, it grossed US$269,225 (US$38,461 per screen).&lt;ref&gt;{{cite web|last = Strowbridge|first = C.S.|title = Hustle and Bustle|publisher = The Numbers|date = 12 April 2005|url = http://www.the-numbers.com/interactive/newsStory.php?newsID=1203|accessdate = 2007-05-03 }}&lt;/ref&gt; When it was expanded to a wide release in 2,503 cinemas, the largest number of cinemas ever for a foreign language film, it made a modest US$6,749,572 (US$2,696 per screen), eventually grossing a total of US$17,108,591 in 129 days. In total, ''Kung Fu Hustle'' had a worldwide gross of US$101,104,669.&lt;ref&gt;{{cite web|title = Kung Fu Hustle Box Office Data|publisher = The Numbers|url = http://www.the-numbers.com/movies/2005/KFHUS.php|accessdate = 2007-05-03 }}&lt;/ref&gt; While not a blockbuster, ''Kung Fu Hustle'' managed to become the highest-grossing foreign language film in North America in 2005&lt;ref&gt;{{cite web |title=Highest Grossing Foreign Language Films |url=http://boxofficemojo.com/genres/chart/?id=foreign.htm |work=[[Box Office Mojo]] |accessdate=29 July 2009|publisher=Internet Movie Database}}&lt;/ref&gt; and went on to gain a [[cult following]] on DVD.&lt;ref name=USbox&gt;{{cite web | last = Scheidt | first = Jason | title = Do the Hustle | publisher = iMedia Connection | url = http://www.imediaconnection.com/content/6581.asp | accessdate = 2 July 2013 }}&lt;/ref&gt;<br /> <br /> ===Awards and nominations===<br /> The film was nominated for sixteen [[Hong Kong Film Awards]], out of which winning: Best Picture, Best Action Choreography, Best Film Editing, Best Sound Effects, Best Supporting Actor and Best Visual Effects.&lt;ref name=&quot;HKFA&quot;/&gt; Five more awards were later picked up at the [[Golden Horse Awards]] including an award for Best Director for Stephen Chow.&lt;ref name=&quot;Golden Horse&quot;/&gt; In the United States ''Kung Fu Hustle'' was well received by various film critic associations winning awards for Best Foreign Language Film<br /> from [[Boston Society of Film Critics Awards|Boston]], [[Chicago Film Critics Association Awards|Chicago]], Las Vagas and Phoenix based critics.&lt;ref name=&quot;NYT Awards&quot;/&gt; it was later nominated for six [[Satellite Awards]]&lt;ref name=&quot;Satellite Awards&quot;/&gt; and one [[MTV Movie Award]] for best fight scene.&lt;ref name=&quot;MTV Movie Awards&quot;/&gt; In the United Kingdom at [[59th British Academy Film Awards]] the film was nominated for a [[BAFTA]].&lt;ref name=&quot;BAFTA&quot;/&gt;<br /> <br /> In 2011, the [[Taipei Golden Horse Film Festival]] listed ''Kung Fu Hustle'' at number 48 in their list of &quot;100 Greatest Chinese-Language Films&quot;.&lt;ref name=&quot;fba-horse&quot;&gt;{{cite web|url=http://www.filmbiz.asia/news/horse-announces-greatest-chinese-films|work=Film Business Asia|title=Horse announces greatest Chinese films|accessdate=17 July 2013|author=Cremin, Stephen|date=27 January 2011}}&lt;/ref&gt; The majority of the voters originated from Taiwan, and included film scholars, festival programmers, film directors, actors and producers.&lt;ref name=&quot;fba-horse&quot; /&gt; In 2014, ''[[Time Out (magazine)|Time Out]]'' polled several film critics, directors, actors and stunt actors to list their top action films.&lt;ref&gt;{{cite web|url=http://www.timeout.com/newyork/film/best-action-movies|work=[[Time Out (magazine)|Time Out]]|title=The 100 best action movies|accessdate=7 November 2014}}&lt;/ref&gt; ''Kung Fu Hustle'' was listed at 50th place on this list.&lt;ref&gt;{{cite web|url=http://www.timeout.com/newyork/film/the-100-best-action-movies-50-41|work=Time Out|accessdate=7 November 2014|date=3 November 2014|title=The 100 best action movies: 50-41}}&lt;/ref&gt;<br /> <br /> {| class=&quot;collapsible collapsed&quot; style=&quot;width:100%; border:1px solid #cedff2; background:#F5FAFF&quot;<br /> |-<br /> <br /> ! style=&quot;text-align:left;&quot;| List of awards and nominations<br /> |-<br /> | &lt;!-- PLACE EXTRA AWARDS BELOW IN ALPHABETICAL ORDER --&gt;<br /> <br /> {| class=&quot;wikitable&quot; style=&quot;font-size:90% width=100%;&quot;<br /> |-<br /> ! style= width=&quot;28%&quot;| Award / Film Festival<br /> ! style= width=&quot;26%&quot;|Category<br /> ! style= width=&quot;36%&quot;|Recipient(s)<br /> ! style= width=&quot;10%&quot;|Result<br /> |-<br /> |rowspan=&quot;1&quot;|[[Imagine Film Festival|Amsterdam Fantastic Film Festival]]&lt;ref&gt;{{cite web|title=Awards|url=http://www.imaginefilmfestival.nl/over-het-festival/awards|publisher=Imagine Film Festiva|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Stephen Chow<br /> |<br /> |{{Won}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[BAFTA Awards]]&lt;ref name=&quot;BAFTA&quot;&gt;{{cite web|title=Film not in the English Language in 2006|url=http://awards.bafta.org/award/2006/film/film-not-in-the-english-language|publisher=[[BAFTA]]|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Film not in the English Language<br /> |Stephen Chow &lt;br&gt;Bo-Chu Chui&lt;br&gt;Jeffrey Lau<br /> |{{Nom}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Boston Society of Film Critics Awards]]&lt;ref&gt;{{cite web|title=Past Award Winners|url=http://www.bostonfilmcritics.org/content/past-award-winners|publisher=[[Boston Society of Film Critics Awards]]|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Foreign Language Film China/Hong Kong<br /> |<br /> |{{Won}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Broadcast Film Critics Association Awards]]&lt;ref name=&quot;NYT Awards&quot;&gt;{{cite web|title=Kung Fu Hustle (2004)|url=http://movies.nytimes.com/movie/314244/Kung-Fu-Hustle/awards|publisher=[[New York Times]]|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Foreign-Language Film<br /> |<br /> |{{Won}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Chicago Film Critics Association Awards]]&lt;ref name=&quot;NYT Awards&quot;/&gt;<br /> |Best Foreign Language Film China/Hong Kong.<br /> |<br /> |{{Nom}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Florida Film Critics Circle Awards]]&lt;ref&gt;{{cite web|title=FFCC Award Winners|url=http://floridafilmcriticscircle.webs.com/awards.htm|publisher=[[Florida Film Critics Circle]]|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Foreign Film<br /> |<br /> |{{Won}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Golden Globe Award]] (USA)&lt;ref&gt;{{cite web|title=Awards Search|url=http://www.goldenglobes.org/browse/?param=/film/26015|publisher=[[Golden Globe Award]]|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Foreign Language FilmChina.<br /> |<br /> |{{Nom}}<br /> |-<br /> |rowspan=&quot;10&quot;|[[Golden Horse Awards]]&lt;ref name=&quot;Golden Horse&quot;&gt;{{cite web|title=Award Archive|url=http://www.goldenhorse.org.tw/ui/index.php?class=ghac&amp;func=archive&amp;search_regist_year=2005&amp;nwlist_type=award|publisher=[[Golden Horse Film Festival and Awards]]|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Director<br /> |Stephen Chow<br /> |{{Won}}<br /> |-<br /> |Best Film<br /> |<br /> |{{Won}}<br /> |-<br /> |Best Make Up &amp; Costume Design<br /> |Shirley Chan<br /> |{{Won}}<br /> |-<br /> |Best Supporting Actress<br /> |Qiu Yuen<br /> |{{Won}}<br /> |-<br /> |Best Visual Effect<br /> |Frankie Chung &lt;br&gt;Don Ma Tam &lt;br&gt;Kai Kwan &lt;br&gt; Hung Franco<br /> |{{Won}}<br /> |-<br /> |Best Action Choreography<br /> |Woo-ping Yuen<br /> |{{nom}}<br /> |-<br /> |Best Art Direction<br /> |Oliver Wong<br /> |{{nom}}<br /> |-<br /> |Best Editing<br /> |Angie Lam<br /> |{{nom}}<br /> |-<br /> |Best Sound Effects<br /> |Steve Burgess &lt;br&gt;Steven Ticknor &lt;br&gt;Robert Mackenzie&lt;br&gt; Paul Pirola<br /> |{{nom}}<br /> |-<br /> |Best Supporting Actor<br /> |Wah Yuen<br /> |{{nom}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Golden Trailer Awards]]&lt;ref&gt;{{cite web|title=6th Annual Golden Trailer Award Winner and Nominees|url=http://www.goldentrailer.com/awards.gta6.php|publisher=[[Golden Trailer Awards]]|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Foreign<br /> |(Winston Davis &amp; Associates).<br /> |{{nom}}<br /> |-<br /> |rowspan=&quot;16&quot;|[[Hong Kong Film Awards]]&lt;ref name=&quot;HKFA&quot;&gt;{{cite web|title=List of Award Winner of The 24th Hong Kong Film Awards|url=http://www.hkfaa.com/winnerlist24.html|publisher=[[Hong Kong Film Awards]]|accessdate=5 July 2013|language=Traditional Chinese/English}}&lt;/ref&gt;<br /> |Best Action Choreography<br /> |Woo-ping Yuen<br /> |{{Won}}<br /> |-<br /> |Best Film Editing<br /> |Angie Lam<br /> |{{Won}}<br /> |-<br /> |Best Picture<br /> |<br /> |{{Won}}<br /> |-<br /> |Best Sound Effects<br /> |Steven &lt;br&gt; Ticknor &lt;br&gt;Steve Burgess &lt;br&gt;Robert Mackenzie&lt;br&gt; Paul Pirola<br /> |{{Won}}<br /> |-<br /> |Best Supporting Actor<br /> |Wah Yuen<br /> |{{Won}}<br /> |-<br /> |Best Visual Effects<br /> |Frankie Chung Ma&lt;br&gt; Wing-On Tam&lt;br&gt; Kai-Kwun Hung&lt;br&gt; Lau-Leung<br /> |{{Won}}<br /> |-<br /> |Best Actor<br /> |Stephen Chow<br /> |{{Nom}}<br /> |-<br /> |Best Actress<br /> |Qiu Yuen<br /> |{{Nom}}<br /> |-<br /> |Best Art Direction<br /> |Oliver Wong<br /> |{{Nom}}<br /> |-<br /> |Best Cinematography<br /> |Hang-Sang Poon<br /> |{{Nom}}<br /> |-<br /> |Best Costume Design and Make Up<br /> |Shirley Chan<br /> |{{Nom}}<br /> |-<br /> |Best Director<br /> |Stephen Chow<br /> |{{Nom}}<br /> |-<br /> |Best New Artist<br /> |Shengyi Huang<br /> |{{Nom}}<br /> |-<br /> |Best Original Film Score<br /> |Ying-Wah Wong<br /> |{{Nom}}<br /> |-<br /> |Best Screenplay<br /> |Stephen Chow &lt;br&gt;Kan-Cheung Tsang &lt;br&gt;KXin Huo &lt;br&gt;KMan Keung Chan<br /> |{{Nom}}<br /> |-<br /> |Best Supporting Actor<br /> |Kwok-Kwan Chan<br /> |{{Nom}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Hong Kong Film Critics Society Awards]]&lt;ref&gt;{{cite web|script-title=zh:第十一屆香港電影評論學會大獎頒獎禮|url=http://www.filmcritics.org.hk/taxonomy/term/5/40|publisher=[[Hong Kong Film Critics Society]]|accessdate=5 July 2013|language=Chinese}}&lt;/ref&gt;<br /> |Film of Merit<br /> | <br /> |{{Won}}<br /> |-<br /> |rowspan=&quot;6&quot;|[[Hundred Flowers Awards]]&lt;ref&gt;{{cite web|title=Hundred Flowers Movie Awards Presented|url=http://www.china.org.cn/english/entertainment/186799.htm|publisher=[[China Internet Information Center]]|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Supporting Actress<br /> |Qiu Yuen<br /> |{{Won}}<br /> |-<br /> |Best Actor<br /> |Stephen Chow<br /> |{{Nom}}<br /> |-<br /> |Best Director<br /> |Stephen Chow<br /> |{{Nom}}<br /> |-<br /> |Best Film<br /> |<br /> |{{Nom}}<br /> |-<br /> |Best Newcomer<br /> |Shengyi Huang<br /> |{{Nom}}<br /> |-<br /> |Best Supporting Actor<br /> |Wah Yuen<br /> |{{Nom}}<br /> |-<br /> |rowspan=&quot;1&quot;|Las Vegas Film Critics Society Awards&lt;ref name=&quot;NYT Awards&quot;/&gt;<br /> |Best Foreign Film<br /> |<br /> |{{Won}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[MTV Movie Awards]]&lt;ref name=&quot;MTV Movie Awards&quot;&gt;{{cite web|title=2006 Movie Awards Winners|url=http://www.mtv.com/ontv/movieawards/2006/|publisher=[[MTV Movie Awards]]|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Fight<br /> |<br /> |{{Nom}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Motion Picture Sound Editors]] (USA)&lt;ref&gt;{{cite web|title=Kung Fu Hustle (2004) Awards|url=http://www.whosdatedwho.com/tpx_633497/kung-fu-hustle/awards|publisher=whosdatedwho.com|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Sound Editing in Feature Film - Foreign<br /> |Steve Burgess (supervising sound editor) &lt;br&gt;<br /> Chris Goodes (sound editor)&lt;br&gt;<br /> Vic Kaspar (sound editor) &lt;br&gt;<br /> Jo Mion (sound editor) &lt;br&gt;<br /> Andrew Neil (sound editor) &lt;br&gt;<br /> Paul Pirola (sound design) &lt;br&gt;<br /> Steven Ticknor (sound design) &lt;br&gt;<br /> Mario Vaccaro (foley artist) &lt;br&gt;<br /> |{{Nom}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Online Film Critics Society Awards]]&lt;ref&gt;{{cite web|title=2005 Awards (9th Annual)|url=http://www.ofcs.org/awards/2005-awards-9th-annual/|publisher=[[Online Film Critics Society]]|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Foreign Language Film<br /> |<br /> |{{Nom}}<br /> |-<br /> |rowspan=&quot;1&quot;|Phoenix Film Critics Society Awards&lt;ref name=&quot;NYT Awards&quot;/&gt;<br /> |Best Foreign Language Film<br /> |Stephen Chow<br /> |{{Won}}<br /> |-<br /> |rowspan=&quot;6&quot;|[[Satellite Awards]]&lt;ref name=&quot;Satellite Awards&quot;&gt;{{cite web|title=10th Anniversary Satellite Awards|url=http://web.archive.org/web/20060507220009/http://www.pressacademy.com/satawards/forms/pdf/ipasat10th-PR-Noms.pdf|publisher=Press Academy|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Outstanding Actress in a Supporting Role, Comedy or Musical<br /> |Qiu Yuen<br /> |{{Nom}}<br /> |-<br /> |Outstanding Cinematography<br /> |Hang-Sang Poon<br /> |{{Nom}}<br /> |-<br /> |Outstanding Film Editing<br /> |Angie Lam<br /> |{{Nom}}<br /> |-<br /> |Outstanding Motion Picture, Comedy or Musical<br /> |<br /> |{{Nom}}<br /> |-<br /> |Outstanding Sound (Mixing &amp; Editing)<br /> |Paul Pirola<br /> |{{Nom}}<br /> |-<br /> |Outstanding Visual Effects<br /> |Frankie Chung<br /> |{{Nom}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Shanghai Film Critics Awards]]&lt;ref&gt;{{cite web|script-title=zh:上海国际电影节:&quot;上海影评人奖&quot;揭晓|url=http://www.china.com.cn/chinese/news/890803.htm|publisher=[[China Internet Information Center]]|accessdate=5 July 2013|language=Chinese}}&lt;/ref&gt;<br /> |Top 10 Films<br /> | <br /> |{{Won}}<br /> |-<br /> |rowspan=&quot;1&quot;|[[Southeastern Film Critics Association Awards]]&lt;ref&gt;{{cite web|title=The Southeastern Film Critics Association 2005|url=http://moviecitynews.com/2006/01/southeastern-film-critics-awards-2005/|publisher=MCN|accessdate=5 July 2013}}&lt;/ref&gt;<br /> |Best Foreign Language Film China/Hong Kong.<br /> |<br /> |{{Nom}}&lt;br&gt; (Runner-up)<br /> |}<br /> &lt;!-- PLACE EXTRA AWARDS ABOVE --&gt;<br /> |}<br /> <br /> ==Sequel==<br /> In 2005, Chow announced that there would be a sequel to ''Kung Fu Hustle'', although he had not settled on a female lead. &quot;There will be a lot of new characters in the movie. We'll need a lot of new actors. It's possible that we'll look for people abroad besides casting locals&quot;.&lt;ref name=&quot;Kung Fu Hustle Rotten Tomatoes&quot;&gt;{{cite web|title = Stephen Chow Talks 'Kung Fu Hustle' Sequel|publisher = Rotten Tomatoes|url = http://www.rottentomatoes.com/news/1645682/stephen_chow_talks_quotkung_fu_hustlequot_sequel/|date = 31 August 2005|accessdate = 2007-06-27}}&lt;/ref&gt; In January 2013 during an interview Chow admitted that plans for making ''Kung Fu Hustle 2'' have been put on hold. &quot;I was indeed in the midst of making the movie, but it is currently put on hold in view of other incoming projects&quot;.&lt;ref&gt;{{cite web|title=&quot;Kung Fu Hustle 2&quot; no go|url=http://my.news.yahoo.com/kung-fu-hustle-2-no-042400930.html|publisher=Cinema Online}}&lt;/ref&gt; Production of ''Kung Fu Hustle 2'' was delayed while Chow filmed the science fiction adventure film ''[[CJ7]]''. As a result, ''Kung Fu Hustle 2'' is slated for a 2014 release.&lt;ref name=&quot;Kung Fu Hustle timeout&quot;&gt;{{cite web|title=Stephen Chow offers 'A Hope'|url=http://www.timeout.com/film/news/1284.html|publisher=[[Time Out New York]]|accessdate=7 March 2013|archiveurl=http://web.archive.org/web/20071012190728/http://www.timeout.com/film/news/1284/|archivedate=7 March 2013|date=18 July 2006}}&lt;/ref&gt; As of 2015, there has yet to be any confirmed news of the sequel and Stephen is slated to complete another movie, Mermaid, before completing this one.<br /> <br /> ==Games==<br /> <br /> ===Online and mobile games===<br /> In 2004 a promotional [[flash games]] was released by [[Sony Pictures Entertainment]] on their Japanese website.&lt;ref&gt;{{cite web|script-title=ja:カンフーハッスル|url=http://bd-dvd.sonypictures.jp/kungfuhustle/site/|publisher=[[Sony Pictures Entertainment]]|accessdate=6 July 2013|language=Japanese}}&lt;/ref&gt; The game were created by Japanese game developer ''Point Zero'' and plays as a [[point and click]] [[beat 'em up]].&lt;ref&gt;{{cite web|title=Kung Fu Hustle|url=http://www.kibagames.com/Game/Kung_Fu_Hustle|publisher=Kiba Games|accessdate=6 July 2013}}&lt;/ref&gt; A [[Side-scrolling video game|side scrolling]] game designed for mobile phones was later released in 2006 by developer ''Tracebit''.&lt;ref&gt;{{cite web|title=Tracebit Catalog|url=http://www.tracebit.com/Tracebit_catalog.pdf|publisher=Tracebit|accessdate=6 July 2013|page=7}}&lt;/ref&gt;<br /> <br /> ===MMO===<br /> In 2007 Sony Online Entertainment announced that a [[Massively multiplayer online game|massively multiplayer online]] 2D [[Side-scrolling video game|side-scrolling]] [[Beat 'em up|fighter game]] based on the film was under development for the Chinese market. Two years later a preview of the game was featured at [[Electronic Entertainment Expo|E3]] were it received mixed reviews from critics with many comparing it to similar MMO games such as ''[[Guild Wars]]'' and ''[[Phantasy Star Online]]''.&lt;ref name=&quot;GameSpot&quot;&gt;{{cite web|last=Calvert|first=Justin|title=Kung Fu Hustle Hands-On|url=http://uk.gamespot.com/kung-fu-hustle/previews/kung-fu-hustle-hands-on-6211561/|publisher=[[Game Spot]]|accessdate=6 July 2013}}&lt;/ref&gt;<br /> <br /> A North American release for [[Personal computer|PC]] and [[PS3]] was planned for late 2009&lt;ref name=&quot;GameSpot&quot;/&gt; however as of July 2013 the game has not been released and is only available in Asia.&lt;ref&gt;{{cite web|title=Kung Fu Hustle|url=http://uk.ign.com/games/kung-fu-hustle-905752/pc-905728|publisher=[[IGN]]|accessdate=6 July 2013}}&lt;/ref&gt;<br /> <br /> ==See also==<br /> {{Portal|Film}}<br /> *[[Cinema of Hong Kong]]<br /> *[[Cinema of China]]<br /> * [[Chandni Chowk to China]] - A [[Bollywood]] film inspired by the same.&lt;ref&gt;[http://movies.ndtv.com/movie-reviews/chandni-chowk-to-china-370 Chandni Chowk To China]. [[Anupama Chopra]]. [[NDTV]]. 16 January 2009&lt;/ref&gt;<br /> <br /> ==References==<br /> {{reflist|2}}<br /> <br /> ==External links==<br /> {{wikiquote}}<br /> *{{official website|http://www.sonyclassics.com/kungfuhustle/splash/stephen/}}<br /> *{{IMDb title|id=0373074}}<br /> *{{rotten-tomatoes|id=kung_fu_hustle}}<br /> *''[http://www.lovehkfilm.com/reviews_2/kung_fu_hustle.htm Kung Fu Hustle]'' at LoveHKFilm.com<br /> *{{Amg movie|314244}}<br /> *{{metacritic film|id=kung-fu-hustle}}<br /> *[http://www.yesasia.com/us/yumcha/0-0-0-arid.21-en/featured-article.html The Six Degrees of Stephen Chow and ''Kung Fu Hustle'']<br /> <br /> {{Stephen Chow}}<br /> {{Broadcast Film Critics Association Award for Best Foreign Language Film}}<br /> {{Best Film HKFA}}<br /> {{GoldenHorseAwardBestFilm}}<br /> <br /> [[Category:2004 films]]<br /> [[Category:2000s martial arts films]]<br /> [[Category:2000s comedy films]]<br /> [[Category:Triad films]]<br /> [[Category:Best Film HKFA]]<br /> [[Category:Cantonese-language films]]<br /> [[Category:Hong Kong films]]<br /> [[Category:Hong Kong action comedy films]]<br /> [[Category:Hong Kong martial arts films]]<br /> [[Category:Chinese films]]<br /> [[Category:Chinese action films]]<br /> [[Category:Kung fu films]]<br /> [[Category:Films set in the 1940s]]<br /> [[Category:Sony Pictures Classics films]]<br /> [[Category:Films set in Shanghai]]<br /> [[Category:Parody films]]<br /> [[Category:Satirical films]]<br /> [[Category:Films directed by Stephen Chow]]<br /> [[Category:Martial arts comedy films]]<br /> [[Category:Martial arts fantasy films]]<br /> [[Category:Films whose director won the Best Director Golden Horse Award]]<br /> [[Category:Slapstick films]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Active_record_pattern&diff=661796271 Active record pattern 2015-05-11T05:00:37Z <p>PuercoPop: /* Testability */ citations needed</p> <hr /> <div>In [[software engineering]], the '''active record pattern''' is an [[Architectural pattern (computer science)|architectural pattern]] found in software that stores in-memory object data in [[relational database]]s. It was named by [[Martin Fowler]] in his 2003 book ''Patterns of Enterprise Application Architecture''.&lt;ref&gt;{{cite book |last=Fowler |first=Martin |title=Patterns of enterprise application architecture |publisher=Addison-Wesley |year=2003 |isbn=978-0-321-12742-6 |url=http://books.google.com/books?id=FyWZt5DdvFkC&amp;lpg=PA1&amp;dq=Patterns%20of%20Enterprise%20Application%20Architecture%20by%20Martin%20Fowler&amp;pg=PT187#v=onepage&amp;q=active%20record&amp;f=false }}&lt;/ref&gt; The interface of an object conforming to this pattern would include functions such as Insert, Update, and Delete, plus properties that correspond more or less directly to the columns in the underlying database table.<br /> <br /> The active record pattern is an approach to accessing data in a [[database]]. A [[database table]] or [[View (database)|view]] is wrapped into a [[class (computer science)|class]]. Thus, an [[object (computer science)|object]] instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded gets its information from the database. When an object is updated the corresponding row in the table is also updated. The wrapper class implements [[accessor]] [[Method (computer programming)|methods]] or properties for each column in the table or view.<br /> <br /> This pattern is commonly used by object persistence tools, and in [[object-relational mapping]] (ORM). Typically, [[foreign key]] relationships will be exposed as an object instance of the appropriate type via a property.<br /> <br /> == Implementations ==<br /> Implementations of the concept can be found in various [[Software framework|framework]]s for many programming environments. For example, if in a database there is a table &lt;code&gt;parts&lt;/code&gt; with columns &lt;code&gt;name&lt;/code&gt; (string type) and &lt;code&gt;price&lt;/code&gt; (number type), and the Active Record pattern is implemented in the class &lt;code&gt;Part&lt;/code&gt;, the pseudo-code<br /> <br /> part = new Part()<br /> part.name = &quot;Sample part&quot;<br /> part.price = 123.45<br /> part.save()<br /> <br /> will create a new row in the &lt;code&gt;parts&lt;/code&gt; table with the given values, and is roughly equivalent to the [[SQL]] command<br /> <br /> &lt;source lang=&quot;sql&quot;&gt;<br /> INSERT INTO parts (name, price) VALUES ('Sample part', 123.45);<br /> &lt;/source&gt;<br /> <br /> Conversely, the class can be used to query the database:<br /> <br /> b = Part.find_first(&quot;name&quot;, &quot;gearbox&quot;)<br /> <br /> This will find a new &lt;code&gt;Part&lt;/code&gt; object based on the first matching row from the &lt;code&gt;parts&lt;/code&gt; table whose &lt;code&gt;name&lt;/code&gt; column has the value &quot;gearbox&quot;. The SQL command used might be similar to the following, depending on the SQL implementation details of the database:<br /> <br /> &lt;source lang=&quot;sql&quot;&gt;<br /> SELECT * FROM parts WHERE name = 'gearbox' LIMIT 1; -- MySQL or PostgreSQL<br /> &lt;/source&gt;<br /> <br /> === ColdFusion ===<br /> [[ColdFusion]] has an open source implementation of the Active Record pattern.<br /> <br /> The [[ColdFusion on Wheels]] framework has an implementation of the Active Record pattern. It is open source and has the added advantage of requiring no complex configuration.<br /> <br /> === PHP ===<br /> <br /> PHP ActiveRecord is one [[open-source]] library designed to fulfill the active record pattern.&lt;ref&gt;{{cite web|title=PHP ActiveRecord|url=http://www.phpactiverecord.org/}}&lt;/ref&gt;<br /> <br /> Several open-source [[PHP]] frameworks also bundle their own [[Object-relational mapping|ORM]] implementing the active record pattern. Most implementations support relationships, behaviors, [[input validation|validation]], [[serialization]] and support for multiple data sources.<br /> <br /> * [[Boiler MVC|Boiler]], an [[MVC model|MVC]] framework for PHP, contains a set of tools for auto-generation of active record models.&lt;ref&gt;{{cite web|title=Boiler Documentation: Models|url=http://www.bluelightstudios.co.uk/tutorial-4-models/}}&lt;/ref&gt; The project, designed for data-centered projects, aims to automate as much of the development process as possible,&lt;ref&gt;{{cite web|title=YouTube demonstration of automation tools|url=https://www.youtube.com/watch?v=M7PG2rTYDGA}}&lt;/ref&gt; using [[Apache Ant]]. Although a new addition to Open Source market,&lt;ref&gt;{{cite web|title=Open Source Code, hosted on Github|url=https://github.com/ivebeenlinuxed/Boiler}}&lt;/ref&gt; the project is already in use in many live applications, both commercially and open. The framework currently only supports [[MySQL]] though the developers have reported some commercial work in Postgres.<br /> <br /> * [[Cygnite PHP Framework]]'s default database layer implements Active Record pattern which closely resemble with [[Ruby on Rails]].&lt;ref&gt;{{cite web|title=Cygnite Framework Documentation: Active Record|url=http://www.cygniteframework.com/2014/06/active-record.html}}&lt;/ref&gt;<br /> <br /> * [[Laravel]] contains an ORM called 'Eloquent' which implements the active record pattern, closely resembling that of [[Ruby on Rails]] &lt;ref&gt;{{cite web|title=Laravel Documentation: Eloquent ORM|url=http://laravel.com/docs/eloquent}}&lt;/ref&gt;<br /> * [[CakePHP]]'s ORM implements the active record pattern,&lt;ref&gt;{{cite web|title=CakePHP (most popular PHP framework)|url=http://stanford.wikia.com/wiki/CakePHP_(most_popular_PHP_framework)|work=Stanford University Wiki}}&lt;/ref&gt; but as of version 2.x queries return arrays of data, with levels of '''related data''' as required. Version 3.0 (still in development as of 2014) will use objects.<br /> * [[Lithium (PHP framework)|Lithium]]'s ORM implements active record.<br /> * [[Symfony]]'s default database layer and ORM &quot;[[Doctrine (PHP)|Doctrine]]&quot; does not implement active record but rather a data mapper approach.<br /> <br /> * &lt;span id=&quot;codeigniter&quot;&gt;[[EllisLab#CodeIgniter|CodeIgniter]]&lt;/span&gt; has a query builder it calls &quot;ActiveRecord&quot;, but which does not implement the Active Record pattern. Instead, it implements what the user guide refers to as a modified version of the pattern. The Active Record functionality in CodeIgniter can be achieved by using either CodeIgniter DataMapper library or CodeIgniter Gas ORM library.<br /> * [[PHPixie]]'s ORM implements active record.<br /> <br /> * [[Yii]]'s ORM also implements the active record pattern.&lt;ref&gt;{{cite web|title=The Definitive Guide to Yii: Active Record|url=http://www.yiiframework.com/doc/guide/1.1/en/database.ar}}&lt;/ref&gt;<br /> * [[Propel_(PHP)|Propel]] also implements the active record pattern.&lt;ref&gt;{{cite web|title=Propel: Active Record Reference|url=http://propelorm.org/documentation/reference/active-record.html}}&lt;/ref&gt;<br /> * Paris is A lightweight Active Record implementation for PHP5, built on top of Idiorm. &lt;ref&gt;{{cite web|title=Github: j4mie/paris|url=https://github.com/j4mie/paris}}&lt;/ref&gt;<br /> <br /> === Ruby ===<br /> The [[Ruby (programming language)|Ruby]] library ActiveRecord implements ORM. It creates a [[Persistence (computer science)|persistable]] domain model from business objects and database tables, where logic and data are presented as a unified package. ActiveRecord adds [[Inheritance (computer science)|inheritance]] and [[Association (object-oriented programming)|associations]] to the pattern above, solving two substantial limitations of that pattern. A set of macros acts as a domain language for the latter, and the [[Single Table Inheritance]] pattern is integrated for the former; thus, ActiveRecord increases the functionality of the active record pattern approach to database interaction. ActiveRecord is the default ‘model’ component of the [[model-view-controller]] web-application framework [[Ruby on Rails]], and is also a stand-alone ORM package for other Ruby applications. In both forms, it was conceived of by [[David Heinemeier Hansson]], and has been improved upon by a number of contributors.&lt;ref&gt;{{cite web|url=https://github.com/rails/rails/tree/master/activerecord|title=Ruby Active Record|accessdate=2013-04-12}}&lt;/ref&gt;<br /> <br /> Other, less popular ORMs have been released since ActiveRecord first took the stage. For example, [[DataMapper (Ruby)|DataMapper]] and [[Sequel (Ruby)|Sequel]] show major improvements over the original ActiveRecord framework.{{POV-statement|date=May 2012}} As a response to their release and adoption by the Rails community, Ruby on Rails v3.0 is independent of an ORM system, so Rails users can easily plug in DataMapper or Sequel to use as their ORM of choice.<br /> <br /> === Java ===<br /> The [[Java (programming language)|Java language]] implements the Active Record pattern via the [[ActiveJDBC]] library. ActiveJDBC is an implementation of Active Record design pattern inspired by [[Ruby on Rails]] ActiveRecord. ActiveJDBC is lightweight, fast, small and does not require any configuration.<br /> <br /> [[ActiveJPA]] and [[Java Object Oriented Querying|jOOQ (for Java Object Oriented Querying)]] implements the Active record pattern, combining active records with [[Automatic programming|source code generation]] and a querying DSL similar to [[SQL]] allowing for retrieving active records using complex SQL statements.<br /> <br /> The [[Play framework]] is a Java web framework which implements the Active Record pattern, using ideas from [[Ruby on Rails]].<br /> <br /> === Other languages ===<br /> There are several open source implementations of the Active Record pattern in other languages, including [[JavaScript]] (e.g., [[ActiveJS]]'s Active Record&lt;ref name=&quot;ActiveJS&quot;&gt;{{cite web|url=http://www.activejs.org/activerecord/ActiveRecord/index.html|title=ActiveJS Active Record|accessdate=2011-07-28}}&lt;/ref&gt;), [[Perl]] ([[DBIx::Class]]), [[ActionScript]], [[Python (programming language)|Python]], [[Haxe]] (SPOD&lt;ref name=&quot;HaxeSPOD&quot;&gt;{{cite web|url=http://haxe.org/manual/spod|title=SPOD Macros|accessdate=2013-01-09}}&lt;/ref&gt;), [[C Sharp (programming language)|C#]],&lt;ref name=&quot;CastleActiveRecord&quot;&gt;{{cite web|title=Castle ActiveRecord|url=http://www.castleproject.org/projects/activerecord/|accessdate=14 January 2014}}&lt;/ref&gt; [[Objective-C]]&lt;ref&gt;{{cite web|title=Objective Record|url=https://github.com/mneorr/Objective-Record|accessdate=14 January 2013}}&lt;/ref&gt; and [[Scala (programming language)|Scala]].&lt;ref&gt;{{cite web|title=Scala Active Record|url=https://github.com/aselab/scala-activerecord|accessdate=4 December 2013}}&lt;/ref&gt;<br /> <br /> == Criticism ==<br /> <br /> === Testability ===<br /> Due to the coupling of database interaction and application logic when using the active record pattern, unit testing an active record object without a database becomes difficult{{ citation needed }}. The negative effects on testability in the active record pattern can be minimized by using [[mock object|mocking]] or [[dependency injection]] frameworks to substitute the real data tier with a simulated one {{ citation needed }}.<br /> <br /> == See also ==<br /> * [[Business object]]<br /> * [[Create, read, update and delete|CRUD]]<br /> * [[Data mapper pattern]]<br /> * [[Object-relational mapping]]<br /> <br /> == References ==<br /> {{Reflist|colwidth=35em}}<br /> <br /> == External links ==<br /> * [https://github.com/rails/rails/tree/master/activerecord Ruby implementation]<br /> * [https://metacpan.org/module/DBIx::Class DBIx::Class Perl Implementation]<br /> * [http://www.phpactiverecord.org/ PHP implementation]<br /> * [http://www.castleproject.org/projects/activerecord/ .NET implementation]<br /> * [http://code.google.com/p/air-activerecord/ AIR Active Record project home]<br /> * [https://github.com/scandio/troba/blob/master/doc/active-record-extension.md troba Active record extension]<br /> <br /> {{Design Patterns Patterns}}<br /> <br /> {{DEFAULTSORT:Active Record Pattern}}<br /> [[Category:Software design patterns]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Saint_Seiya:_Soul_of_Gold&diff=661351629 Saint Seiya: Soul of Gold 2015-05-08T03:13:16Z <p>PuercoPop: /* Gold Saints */ remove spurious '.'</p> <hr /> <div>{{Infobox animanga/Header<br /> |name = Saint Seiya - Soul of Gold<br /> |image = [[File:saint-seiya-soul.png|230px]]<br /> |caption = Promotional image for Saint Seiya - Soul of Gold<br /> |ja_kanji = 聖闘士星矢 - 黄金魂<br /> |ja_romaji = Seinto Seiya - Soul of Gold<br /> |genre = [[Martial arts (genre)|Martial arts]], [[Mythic fiction]], [[Drama (genre)|Drama]]<br /> }}<br /> {{Infobox animanga/Video<br /> |type = ona<br /> |title = Saint Seiya: Soul of Gold<br /> |director = Takeshi Furuta<br /> |writer = Toshimitsu Takeuchi<br /> |music = Toshihiko Sahashi<br /> |studio = [[Toei Animation]]<br /> |first = April 11, 2015<br /> |last = <br /> |runtime = <br /> |episodes = 13<br /> |network = [[Bandai Channel]], [[Daisuki]] <br /> |episode_list = <br /> }}<br /> {{Infobox animanga/Other<br /> |title = Related works<br /> |content = <br /> * ''[[List of Saint Seiya films]]''<br /> * ''[[Saint Seiya Episode.G|Saint Seiya: Episode.G]]''<br /> * ''[[Saint Seiya: Next Dimension]]''<br /> * ''[[Saint Seiya: The Lost Canvas]] ([[List of Saint Seiya: The Lost Canvas chapters#Anecdotes chapters|Anecdotes]])''<br /> * ''[[Saint Seiya Omega]]''<br /> * ''[[Saint Seiya - Saintia Shō|Saint Seiya: Saintia Shō]]''<br /> }}<br /> {{Infobox animanga/Footer}}<br /> <br /> {{nihongo|'''''Saint Seiya: Soul of Gold'''''|聖闘士星矢 - 黄金魂 Soul of Gold|Seinto Seiya - Ōgonkon}} is an ongoing [[original net animation|ONA]] [[anime]] series, a spinoff from the classic anime ''[[Saint Seiya]]'', the animated adaptation of [[Masami Kurumada]]'s [[manga]] of the same name.&lt;ref&gt;http://tamashii.jp/special/seiya_sog/ Official website for the series&lt;/ref&gt;&lt;ref&gt;{{cite web |url= http://www.animenewsnetwork.com/news/2015-02-03/saint-seiya-soul-of-gold-anime-cast-staff-streaming-unveiled/.84027|title= Saint Seiya: Soul of Gold Anime's Cast, Staff, Streaming Unveiled|date= February 3, 2015|accessdate= February 3, 2015|work= [[Anime News Network]]}}&lt;/ref&gt;<br /> <br /> The series was announced on October 29th at the 2014 Tamashii Nation Figure Expo in Japan, revealing it will focus on the deceased Gold Saints in the aftermath of Athena's battle against Hades in the 20th century.<br /> <br /> It was also revealed that the series approach will be an original anime story, as it won't be an adaptation of any of the arcs contained in Kurumada's manga or other related spinoffs in the franchise.<br /> <br /> An official event was to be held on October 31, 2014, at the Tamashii Nation 2014 Expo in Japan, to further introduce the series to the specialized media and to the public.&lt;ref&gt;http://tamashii.jp/special/seiya_sog/ Date for the event&lt;/ref&gt; ''Saint Seiya: Soul of Gold'' is scheduled for release on April 11, 2015.&lt;ref&gt;http://tamashii.jp/special/seiya_sog/ Scheduled release date according to official website&lt;/ref&gt; ''Soul of Gold'' is part of the projects that commemorate the fortieth anniversary of Kurumada as a manga artist.&lt;ref&gt;http://img4.hostingpics.net/pics/263450vlcsnap2014110206h18m11s29.png&lt;/ref&gt;<br /> <br /> ==Plot==<br /> After giving their lives in order to destroy the Wall of Grief and thus help Seiya and his friends reach Hades to protect Athena, all twelve Gold Saints reappear in Asgard, after being mysteriously revived. While looking for answers about why they were brought back to life and by whom, the Gold Saints must fight a new enemy that threatens Asgard with their new, enhanced Cloths.<br /> <br /> ==Cast and Characters==<br /> ==Gold Saints==<br /> *[[Hideyuki Tanaka]] as [[List of Athena's Saints#Leo Aiolia|Leo Aioria]]<br /> The Leo Gold Saint who is the guardian of the Leo Temple in the Sanctuary as well as the main protagonist. Having been revived along with the other Gold Saints after their sacrifice to destroy the Wall of Grief, and with no knowledge of why, Aioria allies himself with Lyfia after some persuasion and later engage their new enemy in battle as he challenge the God Warrior Frodi. Aioria wears a medallion which was given to him by Aioros a long time ago, before the events from the original Saint Seiya occured. Being encouraged by Aioros and hearing Lyfia's prayers, Aioria decides to uncover the answers of the Gold Saints' revival as well as defeat Andreas Lise and destroy Yggdrasil. For some unknown reason, Aioria has been branded with the mark of the Einherjar, the legion of the dead, like his fellow Gold Saints.<br /> *[[Yuusaku Yara]] as [[List of Athena's Saints#Sagittarius Aiolos|Sagittarius Aiolos]]<br /> Aioria's older brother, the Sagittarius Gold Saint and guardian of the Sagittarius Temple in the Sanctuary who died while defending Athena in the original Saint Seiya series. Having been revived along with the other Gold Saints, he encourage Aioria to find out why they have revived by travelling to Yggdrasil.<br /> *[[Takumi Yamazaki]] as [[List of Athena's Saints#Aries Mu|Aries Mu]]<br /> The Aries Gold Saint and guardian of the Aries Temple in the Sanctuary. Having been revived along with the other Gold Saints after their sacrifice to destroy the Wall of Grief, Mu arrives in an abandoned village, finding a young boy who was all alone. Meeting Lyfia, Mu is informed of a God Warrior he noticed earlier and ventures to deal with the new enemy. For some unknown reason, Mu has been branded with the mark of the Einherjar, the legion of the dead, like his fellow Gold Saints.<br /> *[[Toshihiko Seki]] as [[List of Athena's Saints#Scorpio Milo|Scorpio Milo]]<br /> The Scorpio Gold Saint and the guardian of the Scorpio Temple in the Sanctuary.<br /> *[[Tesshô Genda]] as [[List of Athena's Saints#Taurus Aldebaran|Taurus Aldebaran]]<br /> The Taurus Gold Saint and the guardian of the Taurus Temple in the Sanctuary. Having been revived along with the other Gold Saints after their sacrifice to destroy the Wall of Grief, Aldebaran arrives at an arena in Asgard where he regroups with Dohko, discussing their mysterious revival after their sacrifice. Aldebaran's Cloth still retains its broken horn from his battle against Bronze Saint Pegasus Seiya from the original Saint Seiya story. Having once suffered a crushing defeat against Mizar Zeta Syd and an attack from behind unleashed by Zeta Alcor Bud, Aldebaran is given the opportunity by Dohko to avenge that defeat as Tanngsnir Hercules challenge the Gold Saints' powers. During that battle, Aldebaran's broken horn regrows as he burns his Cosmo into a more divine golden color. For some unknown reason, Aldebaran has been branded with the mark of the Einherjar, the legion of the dead, like his fellow Gold Saints.<br /> *[[Nobutoshi Canna]] as [[List of Athena's Saints#Aquarius Camus|Aquarius Camus]]<br /> The Aquarius Gold Saint, the guardian of the Aquarius Temple in the Sanctuary and master of Bronze Saint Cygnus Hyoga.<br /> *[[Yuji Mitsuya]] as [[List of Athena's Saints#Virgo Shaka|Virgo Shaka]]<br /> The Virgo Gold Saint considered the closest man to god and guardian of the Virgo Temple in the Sanctuary.<br /> *[[Takeshi Kusao]] as [[List of Athena's Saints#Capricorn Shura|Capricorn Shura]]<br /> The Capricorn Gold Saint and guardian of the Capricorn Temple in the Sanctuary.<br /> *[[Ryouichi Tanaka]] as [[List of Athena's Saints#Cancer Deathmask|Cancer Deathmask]]<br /> The Cancer Gold Saint and guardian of the Cancer Temple in the Sanctuary.<br /> *[[Keiichi Nanba]] as [[List of Athena's Saints#Pisces Aphrodite|Pisces Aphrodite]]<br /> The Pisces Gold Saint and guardian of the Pisces Temple in the Sanctuary.<br /> *[[Kenyuu Horiuchi]] as [[List of Athena's Saints#Libra Dohko|Libra Dohko]]<br /> The Libra Gold Saint, guardian of the Libra Temple in the Sanctuary and master of Bronze Saint Dragon Shiryu. One of the only survivors from the Holy War from the Lost Canvas series, Dohko is the oldest and considered the wisest among the Gold Saints. Having been revived along with the other Gold Saints after their sacrifice in order to destroy the Wall of Grief, Dohko rendezvous with Aldebaran and they discuss their revival as they share a drink. Shortly after though, Hercules arrives to challenge them, and Dohko accepts the challenge before sending Aldebaran to fight instead, reminding him of his previous defeat.<br /> *[[Ryotaro Okiayu]] as [[List of Athena's Saints#Gemini Saga|Gemini Saga]]<br /> The Gemini Gold Saint and guardian of the Gemini Temple in the Sanctuary<br /> <br /> ==Episode List==<br /> {| class = &quot;wikitable&quot; width = &quot;98%&quot;<br /> |-<br /> ! style=&quot;background: #444444; color:#FFFFFF;&quot; width=&quot;3%&quot; | #<br /> ! style=&quot;background: #444444; color:#FFFFFF;&quot; | Title<br /> ! style=&quot;background: #444444; color:#FFFFFF;&quot; width=&quot;15%&quot; | Original release date<br /> {{Japanese episode list<br /> |EpisodeNumber = 01<br /> |RomajiTitle = Yomigaere! Ogon densetsu<br /> |KanjiTitle = 蘇れ!黄金伝説<br /> |EnglishTitle = Gold Legend, Revive!<br /> |OriginalAirDate = April 11, 2015<br /> |ShortSummary = Shortly after the destruction of the Wall of Grief, Aioria is suddenly revived in a snowy land, remembering everything that happened as the Gold Saints sacrificed themselves. Recovering in a prison, he meets Lyfia who informs him that he is in Asgard. A maid serving Hilda, Lyfia is rebelling against the rule of Andreas Lise who has become the new representative after Hilda who has fallen under an illness. Lyfia informs him that Andreas is manipulating the people of Asgard and that Hilda entrusted her to stop Andreas.<br /> <br /> At first refusing to aid Lyfia due to his own battle against Hades along his companions, Aioria returns to aid Lyfia as the God Warrior Frodi ambush her. Donning his Leo Cloth, Aioria duels the God Warrior Gullinbursti Frodi armed with the Sieg Schwert which easily deflects Aioria's attack. Standing up, he notices a strange mark on his body, which Frodi points out that its a mark belonging to deceased warriors known as Einherjar according to Asgardian legends. Aioria is unable to rival him due to Yggdrasil increasing the God Warrior's power. Seeming defeated, Aioria hears Aioros' voice which encourage him to find out why the Gold Saints have revived and in Asgard. <br /> <br /> Burning his Cosmo to the maximum, Aioria's Cloth changes form and becomes far more powerful. Once more clashing with Frodi, Aioria is able to repel the God Warrior's sword before falling unconcsious as his Cloth returns to normal. As Frodi is being carried by some Asgardian soldiers, he notices a slight change in Lyfia's appearance and attitude as she cradles Aioria. Meanwhile, Mu appears in another part of Asgard and hides from another God Warrior with an evil grin.<br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 02<br /> |RomajiTitle = Abake! Yugudorashiru no Himitsu<br /> |KanjiTitle = 暴け!ユグドラシルの秘密<br /> |EnglishTitle = The Secret of Yggdrasil Revealed!<br /> |OriginalAirDate = April 24, 2015<br /> |ShortSummary = Leaving Aioria to rest after his battle, Lyfia ventures out to find water or food, eventually falling unconcsious in the snow. As she recovers in an empty village, she meets a young boy who gives her something to drink. Shortly after, Mu arrives and informs her that he arrived a few days ago in the village which seemed like everyone had disappeared. Discussing a God Warrior with a dragon-shaped God Robe known as Nidhogg Fafner, Mu asks Lyfia to remain in the village and recover while he dealt with Fafner. Mu ambush the God Warrior and is easily defeated by his whip before being taken for experimenting by Fafner who binds him to the roots of Yggdrasil. Realizing that Yggdrasil is the source of evil, Mu easily breaks free from the roots and retaliates against Fafner before regrouping with Aioria and Lyfia, with Fafner escaping.<br /> <br /> Meanwhile, at an arena, Aldebaran finds Dohko fighting several Asgardian soldiers for sport and awaiting someone familiar to find him. As they rendezvous at a bar, the Gold Saints discuss their revival in Asgard and that someone is playing with their lives. Before they have time for further talk, the God Warrior Tanngsnir Hercules confronts them and challenge them. Leaving him to Aldebaran due to his previous loss during the last battle between Athena's Saints and Asgard, Dohko watches from the tribune as Aldebaran dons his Taurus Cloth. As Hercules attacks Aldebaran, the Gold Saint does not make a move which infuriates the God Warrior. Launching an attack at the civilians instead, Aldebaran moves in the way and deflects the attack. Remembering that he would usually leave the thinking part to his other comrades, Aldebaran burns his Cosmo and regrows his broken horn much to Dohko's surprise, overpowering Hercules for a brief moment before he retreats.<br /> <br /> During their battles, both Mu and Aldebaran are affected by the same Einherjar mark as Aioria prievously gained during his battle against Frodi. Finally, they all decide to journey to Yggdrasil and destroy it. In another part of Asgard, Milo tortures an Asgardian soldier for information about the God Warriors. He is shocked as the soldier mentions the sight of a Gold Saint.<br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 03<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = Gold vs. Gold: Clash of the Saints!<br /> |OriginalAirDate = May 8, 2015<br /> |ShortSummary = <br /> }}&lt;!--<br /> {{Japanese episode list<br /> |EpisodeNumber = 04<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = <br /> |OriginalAirDate = 2015<br /> |ShortSummary = <br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 05<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = <br /> |OriginalAirDate = 2015<br /> |ShortSummary = <br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 06<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = <br /> |OriginalAirDate = 2015<br /> |ShortSummary = <br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 07<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = <br /> |OriginalAirDate = 2015<br /> |ShortSummary = <br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 08<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = <br /> |OriginalAirDate = 2015<br /> |ShortSummary = <br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 09<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = <br /> |OriginalAirDate = 2015<br /> |ShortSummary = <br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 10<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = <br /> |OriginalAirDate = 2015<br /> |ShortSummary = <br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 11<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = <br /> |OriginalAirDate = 2015<br /> |ShortSummary = <br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 12<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = <br /> |OriginalAirDate = 2015<br /> |ShortSummary = <br /> }}<br /> {{Japanese episode list<br /> |EpisodeNumber = 13<br /> |RomajiTitle = <br /> |KanjiTitle = <br /> |EnglishTitle = <br /> |OriginalAirDate = 2015<br /> |ShortSummary = <br /> }}--&gt;<br /> |}<br /> <br /> ==Release==<br /> <br /> This new series will begin streaming on April 11, 2015. [[Bandai Channel]] will stream the series in Japan, while [[Daisuki (website)|Daisuki]] will stream it for the rest of the world. The latter will offer subtitles in different languages, including English, Spanish and Portuguese. Episodes will be released in single format biweekly on Saturdays.&lt;ref&gt;http://shinobinews.com/2015/03/saint-seiya-soul-of-gold-nuevo-trailer-y-fecha-de-estreno/ (In Spanish) &lt;/ref&gt;<br /> <br /> ==References==<br /> {{reflist}}<br /> <br /> ==External links==<br /> * http://tamashii.jp/special/seiya_sog/ Official website<br /> * {{Official website|http://saintseiya-gold.com/}} {{ja icon}}<br /> <br /> {{Saint Seiya}}<br /> {{Masami Kurumada}}<br /> <br /> [[Category:2015 anime]]<br /> [[Category:2015 web series debuts]]<br /> [[Category:Anime ONAs]]<br /> [[Category:Saint Seiya]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Neural_network_(machine_learning)&diff=654528461 Neural network (machine learning) 2015-04-01T18:40:43Z <p>PuercoPop: disambiguate function wikilink</p> <hr /> <div>{{Redirect|Neural network|networks of living neurons|Biological neural network|the journal|Neural Networks (journal)|the evolutionary concept|Neutral network (evolution)}}<br /> {{Machine learning bar}}<br /> {{Use dmy dates|date=June 2013}}<br /> <br /> [[File:Colored neural network.svg|thumb|300px|An artificial neural network is an interconnected group of nodes, akin to the vast network of [[neuron]]s in a [[brain]]. Here, each circular node represents an artificial neuron and an arrow represents a connection from the output of one neuron to the input of another.]]<br /> <br /> In [[machine learning]] and [[cognitive science]], '''artificial neural networks''' ('''ANNs''') are a family of statistical learning algorithms inspired by [[biological neural network]]s (the [[central nervous system]]s of animals, in particular the [[brain]]) and are used to estimate or [[Universal approximation theorem|approximate]] [[Function (mathematics)|functions]] that can depend on a large number of [[Argument of a function|inputs]] and are generally unknown. Artificial neural networks are generally presented as systems of interconnected &quot;[[artificial neuron|neuron]]s&quot; which can compute values from inputs, and are capable of [[machine learning]] as well as [[pattern recognition]] thanks to their adaptive nature.<br /> <br /> For example, a neural network for [[handwriting recognition]] is defined by a set of input neurons which may be activated by the pixels of an input image. After being weighted and transformed by a [[Function (mathematics)|function]] (determined by the network's designer), the activations of these neurons are then passed on to other neurons. This process is repeated until finally, an output neuron is activated. This determines which character was read.<br /> <br /> Like other machine learning methods - systems that learn from data - neural networks have been used to solve a wide variety of tasks that are hard to solve using ordinary [[rule-based programming]], including [[computer vision]] and [[speech recognition]].<br /> <br /> ==Background==<br /> Examinations of the human's [[central nervous system]] inspired the concept of neural networks. In an Artificial Neural Network, simple artificial [[Node (neural networks)|nodes]], known as &quot;[[artificial neuron|neurons]]&quot;, &quot;neurodes&quot;, &quot;processing elements&quot; or &quot;units&quot;, are connected together to form a network which mimics a biological neural network.<br /> <br /> There is no single formal definition of what an artificial neural network is. However, a class of statistical models may commonly be called &quot;Neural&quot; if they possess the following characteristics:<br /> # consist of sets of [[adaptive systems|adaptive]] weights, i.e. numerical parameters that are tuned by a learning [[algorithm]], and<br /> # are capable of [[approximation theory|approximating]] non-linear functions of their inputs.<br /> The adaptive weights are conceptually connection strengths between neurons, which are activated during training and prediction.<br /> <br /> Neural networks are similar to biological neural networks in performing functions collectively and in parallel by the units, rather than there being a clear delineation of subtasks to which various units are assigned. The term &quot;neural network&quot; usually refers to models employed in [[statistics]], [[cognitive psychology]] and [[artificial intelligence]]. Neural network models which emulate the central nervous system are part of [[theoretical neuroscience]] and [[computational neuroscience]].<br /> <br /> In modern [[Neural network software|software implementations]] of artificial neural networks, the approach inspired by biology has been largely abandoned for a more practical approach based on statistics and signal processing. In some of these systems, neural networks or parts of neural networks (like artificial neurons) form components in larger systems that combine both adaptive and non-adaptive elements. While the more general approach of such systems is more suitable for real-world problem solving, it has little to do with the traditional artificial intelligence connectionist models. What they do have in common, however, is the principle of non-linear, distributed, parallel and local processing and adaptation. Historically, the use of neural networks models marked a paradigm shift in the late eighties from high-level (symbolic) [[artificial intelligence]], characterized by [[expert system]]s with knowledge embodied in ''if-then'' rules, to low-level (sub-symbolic) [[machine learning]], characterized by knowledge embodied in the parameters of a [[Cognitive Model#Dynamical systems|dynamical system]].<br /> <br /> ==History==<br /> [[Warren McCulloch]] and [[Walter Pitts]]&lt;ref&gt;{{cite journal|last=McCulloch|first=Warren|author2=Walter Pitts|title=A Logical Calculus of Ideas Immanent in Nervous Activity|journal=Bulletin of Mathematical Biophysics|year=1943|volume=5|pages=115–133|doi=10.1007/BF02478259|issue=4}}&lt;/ref&gt; (1943) created a computational model for neural networks based on [[mathematics]] and algorithms. They called this model [[threshold logic]]. The model paved the way for neural network research to split into two distinct approaches. One approach focused on biological processes in the brain and the other focused on the application of neural networks to artificial intelligence.<br /> <br /> In the late 1940s psychologist [[Donald Hebb]]&lt;ref&gt;{{cite book|last=Hebb|first=Donald|title=The Organization of Behavior|year=1949|publisher=Wiley|location=New York}}&lt;/ref&gt; created a hypothesis of learning based on the mechanism of neural plasticity that is now known as [[Hebbian learning]]. Hebbian learning is considered to be a 'typical' [[unsupervised learning]] rule and its later variants were early models for [[long term potentiation]]. These ideas started being applied to computational models in 1948 with [[unorganized machine|Turing's B-type machines]].<br /> <br /> Farley and [[Wesley A. Clark]]&lt;ref&gt;{{cite journal|last=Farley|first=B.G.|author2=W.A. Clark|title=Simulation of Self-Organizing Systems by Digital Computer|journal=IRE Transactions on Information Theory|year=1954|volume=4|pages=76–84|doi=10.1109/TIT.1954.1057468|issue=4}}&lt;/ref&gt; (1954) first used computational machines, then called calculators, to simulate a Hebbian network at MIT. Other neural network computational machines were created by Rochester, Holland, Habit, and Duda&lt;ref&gt;{{cite journal|last=Rochester|first=N.|coauthors=J.H. Holland, L.H. Habit, and W.L. Duda|title=Tests on a cell assembly theory of the action of the brain, using a large digital computer|journal=IRE Transactions on Information Theory|year=1956|volume=2|pages=80–93|doi=10.1109/TIT.1956.1056810|issue=3}}&lt;/ref&gt; (1956).<br /> <br /> [[Frank Rosenblatt]]&lt;ref&gt;{{cite journal|last=Rosenblatt|first=F.|title=The Perceptron: A Probabilistic Model For Information Storage And Organization In The Brain|journal=Psychological Review|year=1958|volume=65|pages=386–408|doi=10.1037/h0042519|pmid=13602029|issue=6}}&lt;/ref&gt; (1958) created the [[perceptron]], an algorithm for pattern recognition based on a two-layer learning computer network using simple addition and subtraction. With mathematical notation, Rosenblatt also described circuitry not in the basic perceptron, such as the [[exclusive-or]] circuit, a circuit whose mathematical computation could not be processed until after the [[backpropagation]] algorithm was created by [[Paul Werbos]]&lt;ref name=&quot;Werbos 1975&quot;&gt;{{cite book|last=Werbos|first=P.J.|title=Beyond Regression: New Tools for Prediction and Analysis in the Behavioral Sciences|year=1975}}&lt;/ref&gt; (1975).<br /> <br /> Neural network research stagnated after the publication of machine learning research by [[Marvin Minsky]] and [[Seymour Papert]]&lt;ref&gt;{{cite book|last=Minsky|first=M.|title=An Introduction to Computational Geometry|year=1969|publisher=MIT Press|isbn=0-262-63022-2|author2=S. Papert}}&lt;/ref&gt; (1969). They discovered two key issues with the computational machines that processed neural networks. The first issue was that single-layer neural networks were incapable of processing the exclusive-or circuit. The second significant issue was that computers were not sophisticated enough to effectively handle the long run time required by large neural networks. Neural network research slowed until computers achieved greater processing power. Also key later advances was the [[backpropagation]] algorithm which effectively solved the exclusive-or problem (Werbos 1975).&lt;ref name=&quot;Werbos 1975&quot;/&gt;<br /> <br /> The [[connectionism|parallel distributed processing]] of the mid-1980s became popular under the name [[connectionism]]. The text by [[David E. Rumelhart]] and [[James McClelland (psychologist)|James McClelland]]&lt;ref&gt;{{cite book|last=Rumelhart|first=D.E|title=Parallel Distributed Processing: Explorations in the Microstructure of Cognition|year=1986|publisher=MIT Press|location=Cambridge|author2=James McClelland}}&lt;/ref&gt; (1986) provided a full exposition on the use of connectionism in computers to simulate neural processes.<br /> <br /> Neural networks, as used in artificial intelligence, have traditionally been viewed as simplified models of [[neural processing]] in the brain, even though the relation between this model and brain biological architecture is debated, as it is not clear to what degree artificial neural networks mirror brain function.&lt;ref&gt;{{cite web|last= Russell|first= Ingrid|title= Neural Networks Module|url= http://uhaweb.hartford.edu/compsci/neural-networks-definition.html|accessdate= 2012}}&lt;/ref&gt;<br /> <br /> Neural networks were gradually overtaken in popularity in machine learning by [[support vector machine]]s and other, much simpler methods such as [[linear classifier]]s. Renewed interest in neural nets was sparked in the late 2000s by the advent of [[deep learning]].<br /> <br /> ===Improvements since 2006===<br /> Computational devices have been created in [[CMOS]], for both biophysical simulation and [[neuromorphic computing]]. More recent efforts show promise for creating [[nanodevice]]s&lt;ref&gt;Yang, J. J.; Pickett, M. D.; Li, X. M.; Ohlberg, D. A. A.; Stewart, D. R.; Williams, R. S. Nat. Nanotechnol. 2008, 3, 429–433.&lt;/ref&gt; for very large scale [[principal component]]s analyses and [[convolution]]. If successful, these efforts could usher in a new era of [[neural computing]]&lt;ref&gt;Strukov, D. B.; Snider, G. S.; Stewart, D. R.; Williams, R. S. ''Nature'' 2008, 453, 80–83.&lt;/ref&gt; that is a step beyond digital computing, because it depends on [[learning]] rather than [[programming language|programming]] and because it is fundamentally [[Analog signal|analog]] rather than [[Digital data|digital]] even though the first instantiations may in fact be with CMOS digital devices.<br /> <br /> Between 2009 and 2012, the [[recurrent neural network]]s and deep feedforward neural networks developed in the research group of [[Jürgen Schmidhuber]] at the [[IDSIA|Swiss AI Lab IDSIA]] have won eight international competitions in [[pattern recognition]] and [[machine learning]].&lt;ref&gt;[http://www.kurzweilai.net/how-bio-inspired-deep-learning-keeps-winning-competitions 2012 Kurzweil AI Interview] with [[Jürgen Schmidhuber]] on the eight competitions won by his Deep Learning team 2009–2012&lt;/ref&gt;&lt;ref&gt;http://www.kurzweilai.net/how-bio-inspired-deep-learning-keeps-winning-competitions 2012 Kurzweil AI Interview with [[Jürgen Schmidhuber]] on the eight competitions won by his Deep Learning team 2009–2012&lt;/ref&gt; For example, the bi-directional and [[multi-dimensional]] [[long short term memory]] (LSTM)&lt;ref&gt;Graves, Alex; and Schmidhuber, Jürgen; ''[http://www.idsia.ch/~juergen/nips2009.pdf Offline Handwriting Recognition with Multidimensional Recurrent Neural Networks]'', in Bengio, Yoshua; Schuurmans, Dale; Lafferty, John; Williams, Chris K. I.; and Culotta, Aron (eds.), ''Advances in Neural Information Processing Systems 22 (NIPS'22), 7–10 December 2009, Vancouver, BC'', Neural Information Processing Systems (NIPS) Foundation, 2009, pp. 545–552.<br /> &lt;/ref&gt;&lt;ref&gt;A. Graves, M. Liwicki, S. Fernandez, R. Bertolami, H. Bunke, [[Jürgen Schmidhuber|J. Schmidhuber]]. [http://www.idsia.ch/~juergen/tpami_2008.pdf A Novel Connectionist System for Improved Unconstrained Handwriting Recognition]. IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 31, no. 5, 2009.<br /> &lt;/ref&gt;&lt;ref&gt;Graves, Alex; and Schmidhuber, Jürgen; ''Offline Handwriting Recognition with Multidimensional Recurrent Neural Networks'', in Bengio, Yoshua; Schuurmans, Dale; Lafferty, John; Williams, Chris K. I.; and Culotta, Aron (eds.), ''Advances in Neural Information Processing Systems 22 (NIPS'22), December 7th–10th, 2009, Vancouver, BC'', Neural Information Processing Systems (NIPS) Foundation, 2009, pp. 545–552&lt;/ref&gt;&lt;ref&gt;A. Graves, M. Liwicki, S. Fernandez, R. Bertolami, H. Bunke, J. Schmidhuber. A Novel Connectionist System for Improved Unconstrained Handwriting Recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 31, no. 5, 2009.&lt;/ref&gt; of Alex Graves et al. won three competitions in connected handwriting recognition at the 2009 International Conference on Document Analysis and Recognition (ICDAR), without any prior knowledge about the three different languages to be learned.<br /> <br /> Fast [[GPU]]-based implementations of this approach by Dan Ciresan and colleagues at [[IDSIA]] have won several pattern recognition contests, including the IJCNN 2011 Traffic Sign Recognition Competition,&lt;ref&gt;D. C. Ciresan, U. Meier, J. Masci, [[Jürgen Schmidhuber|J. Schmidhuber]]. Multi-Column Deep Neural Network for Traffic Sign Classification. Neural Networks, 2012.<br /> &lt;/ref&gt;&lt;ref&gt;D. C. Ciresan, U. Meier, J. Masci, J. Schmidhuber. Multi-Column Deep Neural Network for Traffic Sign Classification. Neural Networks, 2012.&lt;/ref&gt; the ISBI 2012 Segmentation of Neuronal Structures in Electron Microscopy Stacks challenge,&lt;ref name=&quot;D. Ciresan, A. Giusti 2012&quot;&gt;D. Ciresan, A. Giusti, L. Gambardella, J. Schmidhuber. Deep Neural Networks Segment Neuronal Membranes in Electron Microscopy Images. In Advances in Neural Information Processing Systems (NIPS 2012), Lake Tahoe, 2012.&lt;/ref&gt; and others. Their neural networks also were the first artificial pattern recognizers to achieve human-competitive or even superhuman performance&lt;ref name=&quot;C. Ciresan, U. Meier 2012&quot;&gt;D. C. Ciresan, U. Meier, [[Jürgen Schmidhuber|J. Schmidhuber]]. Multi-column Deep Neural Networks for Image Classification. IEEE Conf. on Computer Vision and Pattern Recognition CVPR 2012.&lt;/ref&gt;<br /> on important benchmarks such as traffic sign recognition (IJCNN 2012), or the [[MNIST database|MNIST handwritten digits problem]] of [[Yann LeCun]] at [[NYU]].<br /> <br /> Deep, highly nonlinear neural architectures similar to the 1980 [[neocognitron]] by [[Kunihiko Fukushima]]&lt;ref name=&quot;K. Fukushima. Neocognitron 1980&quot;&gt;{{cite journal| author = Fukushima, K. | year = 1980 | title = Neocognitron: A self-organizing neural network model for a mechanism of pattern recognition unaffected by shift in position | journal = Biological Cybernetics | volume=36 | issue=4 | pages=93–202 | doi = 10.1007/BF00344251 | pmid=7370364}} &lt;!-- K. Fukushima. Neocognitron: A self-organizing neural network model for a mechanism of pattern recognition unaffected by shift in position. Biological Cybernetics, 36(4): 93-202, 1980.--&gt;&lt;/ref&gt;<br /> and the &quot;standard architecture of vision&quot;,&lt;ref name=&quot;M Riesenhuber, 1999&quot;&gt;M Riesenhuber, [[Tomaso Poggio|T Poggio]]. Hierarchical models of object recognition in cortex. Nature neuroscience, 1999.&lt;/ref&gt; inspired by the simple and complex cells identified by [[David H. Hubel]] and [[Torsten Wiesel]] in the primary [[visual cortex]], can also be pre-trained by unsupervised methods&lt;ref&gt;[http://www.scholarpedia.org/article/Deep_belief_networks Deep belief networks] at Scholarpedia.<br /> &lt;/ref&gt;&lt;ref&gt;{{cite doi|10.1162/neco.2006.18.7.1527}}&lt;/ref&gt;<br /> of [[Geoff Hinton]]'s lab at [[University of Toronto]].&lt;ref&gt;http://www.scholarpedia.org/article/Deep_belief_networks /&lt;/ref&gt;&lt;ref&gt;{{cite journal<br /> |doi = 10.1162/neco.2006.18.7.1527<br /> |last1 = Hinton <br /> |first1 = G. E. <br /> |authorlink1 = Geoffrey Hinton<br /> |last2 = Osindero <br /> |first2 = S.<br /> |last3 = Teh <br /> |first3 = Y.<br /> |year = 2006<br /> |title = A fast learning algorithm for deep belief nets<br /> |journal = [[Neural Computation]]<br /> |volume = 18<br /> |issue = 7 <br /> |pages = 1527–1554<br /> |url = http://www.cs.toronto.edu/~hinton/absps/fastnc.pdf<br /> |pmid = 16764513<br /> }}&lt;/ref&gt; A team from this lab won a 2012 contest sponsored by [[Merck &amp; Co.|Merck]] to design software to help find molecules that might lead to new drugs.&lt;ref&gt;{{cite news |url=http://www.nytimes.com/2012/11/24/science/scientists-see-advances-in-deep-learning-a-part-of-artificial-intelligence.html |author=John Markoff |newspaper=New York Times |date=November 23, 2012 |title=Scientists See Promise in Deep-Learning Programs}}&lt;/ref&gt;<br /> <br /> ==Models==<br /> Neural network models in artificial intelligence are usually referred to as artificial neural networks (ANNs); these are essentially simple mathematical models defining a function &lt;math&gt;\textstyle f : X \rightarrow Y &lt;/math&gt; or a distribution over &lt;math&gt;\textstyle X&lt;/math&gt; or both &lt;math&gt;\textstyle X&lt;/math&gt; and &lt;math&gt;\textstyle Y&lt;/math&gt;, but sometimes models are also intimately associated with a particular learning algorithm or learning rule. A common use of the phrase ANN model really means the definition of a ''class'' of such functions (where members of the class are obtained by varying parameters, connection weights, or specifics of the architecture such as the number of neurons or their connectivity).<br /> <br /> ===Network function===<br /> {{See also|Graphical models}}<br /> <br /> The word ''network'' in the term 'artificial neural network' refers to the inter–connections between the neurons in the different layers of each system. An example system has three layers. The first layer has input neurons which send data via synapses to the second layer of neurons, and then via more synapses to the third layer of output neurons. More complex systems will have more layers of neurons with some having increased layers of input neurons and output neurons. The synapses store parameters called &quot;weights&quot; that manipulate the data in the calculations.<br /> <br /> An ANN is typically defined by three types of parameters:<br /> <br /> # The interconnection pattern between the different layers of neurons<br /> # The learning process for updating the weights of the interconnections<br /> # The activation function that converts a neuron's weighted input to its output activation.<br /> <br /> Mathematically, a neuron's network function &lt;math&gt;\textstyle f(x)&lt;/math&gt; is defined as a composition of other functions &lt;math&gt;\textstyle g_i(x)&lt;/math&gt;, which can further be defined as a composition of other functions. This can be conveniently represented as a network structure, with arrows depicting the dependencies between variables. A widely used type of composition is the ''nonlinear weighted sum'', where &lt;math&gt;\textstyle f (x) = K \left(\sum_i w_i g_i(x)\right) &lt;/math&gt;, where &lt;math&gt;\textstyle K&lt;/math&gt; (commonly referred to as the [[activation function]]&lt;ref&gt;{{cite web|url=http://www.cse.unsw.edu.au/~billw/mldict.html#activnfn|title=The Machine Learning Dictionary}}&lt;/ref&gt;) is some predefined function, such as the [[hyperbolic tangent]]. It will be convenient for the following to refer to a collection of functions &lt;math&gt;\textstyle g_i&lt;/math&gt; as simply a vector &lt;math&gt;\textstyle g = (g_1, g_2, \ldots, g_n)&lt;/math&gt;.<br /> <br /> [[File:Ann dependency (graph).svg|thumb|150px|ANN dependency graph]]<br /> <br /> This figure depicts such a decomposition of &lt;math&gt;\textstyle f&lt;/math&gt;, with dependencies between variables indicated by arrows. These can be interpreted in two ways.<br /> <br /> The first view is the functional view: the input &lt;math&gt;\textstyle x&lt;/math&gt; is transformed into a 3-dimensional vector &lt;math&gt;\textstyle h&lt;/math&gt;, which is then transformed into a 2-dimensional vector &lt;math&gt;\textstyle g&lt;/math&gt;, which is finally transformed into &lt;math&gt;\textstyle f&lt;/math&gt;. This view is most commonly encountered in the context of [[Mathematical optimization|optimization]].<br /> <br /> The second view is the probabilistic view: the [[random variable]] &lt;math&gt;\textstyle F = f(G) &lt;/math&gt; depends upon the random variable &lt;math&gt;\textstyle G = g(H)&lt;/math&gt;, which depends upon &lt;math&gt;\textstyle H=h(X)&lt;/math&gt;, which depends upon the random variable &lt;math&gt;\textstyle X&lt;/math&gt;. This view is most commonly encountered in the context of [[graphical models]].<br /> <br /> The two views are largely equivalent. In either case, for this particular network architecture, the components of individual layers are independent of each other (e.g., the components of &lt;math&gt;\textstyle g&lt;/math&gt; are independent of each other given their input &lt;math&gt;\textstyle h&lt;/math&gt;). This naturally enables a degree of parallelism in the implementation.<br /> <br /> [[File:Recurrent ann dependency graph.png|thumb|120px| Two separate depictions of the recurrent ANN dependency graph]]<br /> <br /> Networks such as the previous one are commonly called [[feedforward neural network|feedforward]], because their graph is a [[directed acyclic graph]]. Networks with [[path (graph theory)|cycles]] are commonly called [[Recurrent neural network|recurrent]]. Such networks are commonly depicted in the manner shown at the top of the figure, where &lt;math&gt;\textstyle f&lt;/math&gt; is shown as being dependent upon itself. However, an implied temporal dependence is not shown.<br /> <br /> ===Learning===<br /> What has attracted the most interest in neural networks is the possibility of ''learning''. Given a specific ''task'' to solve, and a ''class'' of functions &lt;math&gt;\textstyle F&lt;/math&gt;, learning means using a set of ''observations'' to find &lt;math&gt;\textstyle f^{*} \in F&lt;/math&gt; which solves the task in some ''optimal'' sense.<br /> <br /> This entails defining a cost function &lt;math&gt;\textstyle C : F \rightarrow \mathbb{R}&lt;/math&gt; such that, for the optimal solution &lt;math&gt;\textstyle f^*&lt;/math&gt;, &lt;math&gt;\textstyle C(f^*) \leq C(f)&lt;/math&gt; &lt;math&gt;\textstyle \forall f \in F&lt;/math&gt; – i.e., no solution has a cost less than the cost of the optimal solution (see [[Mathematical optimization]]).<br /> <br /> The cost function &lt;math&gt;\textstyle C&lt;/math&gt; is an important concept in learning, as it is a measure of how far away a particular solution is from an optimal solution to the problem to be solved. Learning algorithms search through the solution space to find a function that has the smallest possible cost.<br /> <br /> For applications where the solution is dependent on some data, the cost must necessarily be a ''function of the observations'', otherwise we would not be modelling anything related to the data. It is frequently defined as a [[statistic]] to which only approximations can be made. As a simple example, consider the problem of finding the model &lt;math&gt;\textstyle f&lt;/math&gt;, which minimizes &lt;math&gt;\textstyle C=E\left[(f(x) - y)^2\right]&lt;/math&gt;, for data pairs &lt;math&gt;\textstyle (x,y)&lt;/math&gt; drawn from some distribution &lt;math&gt;\textstyle \mathcal{D}&lt;/math&gt;. In practical situations we would only have &lt;math&gt;\textstyle N&lt;/math&gt; samples from &lt;math&gt;\textstyle \mathcal{D}&lt;/math&gt; and thus, for the above example, we would only minimize &lt;math&gt;\textstyle \hat{C}=\frac{1}{N}\sum_{i=1}^N (f(x_i)-y_i)^2&lt;/math&gt;. Thus, the cost is minimized over a sample of the data rather than the entire data set.<br /> <br /> When &lt;math&gt;\textstyle N \rightarrow \infty&lt;/math&gt; some form of [[online machine learning]] must be used, where the cost is partially minimized as each new example is seen. While online machine learning is often used when &lt;math&gt;\textstyle \mathcal{D}&lt;/math&gt; is fixed, it is most useful in the case where the distribution changes slowly over time. In neural network methods, some form of online machine learning is frequently used for finite datasets.<br /> <br /> {{See also|Mathematical optimization|Estimation theory|Machine learning}}<br /> <br /> ====Choosing a cost function====<br /> While it is possible to define some arbitrary [[ad hoc]] cost function, frequently a particular cost will be used, either because it has desirable properties (such as [[Convex function|convexity]]) or because it arises naturally from a particular formulation of the problem (e.g., in a probabilistic formulation the posterior probability of the model can be used as an inverse cost). Ultimately, the cost function will depend on the desired task. An overview of the three main categories of learning tasks is provided below:<br /> <br /> ===Learning paradigms===<br /> There are three major learning paradigms, each corresponding to a particular abstract learning task. These are [[supervised learning]], [[unsupervised learning]] and [[reinforcement learning]].<br /> <br /> ====Supervised learning====<br /> In [[supervised learning]], we are given a set of example pairs &lt;math&gt;\textstyle (x, y), x \in X, y \in Y&lt;/math&gt; and the aim is to find a function &lt;math&gt;\textstyle f : X \rightarrow Y &lt;/math&gt; in the allowed class of functions that matches the examples. In other words, we wish to ''infer'' the mapping implied by the data; the cost function is related to the mismatch between our mapping and the data and it implicitly contains prior knowledge about the problem domain.<br /> <br /> A commonly used cost is the [[mean-squared error]], which tries to minimize the average squared error between the network's output, &lt;math&gt;\textstyle f(x)&lt;/math&gt;, and the target value &lt;math&gt;\textstyle y&lt;/math&gt; over all the example pairs. When one tries to minimize this cost using [[gradient descent]] for the class of neural networks called [[multilayer perceptron]]s, one obtains the common and well-known [[Backpropagation|backpropagation algorithm]] for training neural networks.<br /> <br /> Tasks that fall within the paradigm of supervised learning are [[pattern recognition]] (also known as classification) and [[Regression analysis|regression]] (also known as function approximation). The supervised learning paradigm is also applicable to sequential data (e.g., for speech and gesture recognition). This can be thought of as learning with a &quot;teacher&quot;, in the form of a function that provides continuous feedback on the quality of solutions obtained thus far.<br /> <br /> ====Unsupervised learning====<br /> In [[unsupervised learning]], some data &lt;math&gt;\textstyle x&lt;/math&gt; is given and the cost function to be minimized, that can be any function of the data &lt;math&gt;\textstyle x&lt;/math&gt; and the network's output, &lt;math&gt;\textstyle f&lt;/math&gt;.<br /> <br /> The cost function is dependent on the task (what we are trying to model) and our ''a priori'' assumptions (the implicit properties of our model, its parameters and the observed variables).<br /> <br /> As a trivial example, consider the model &lt;math&gt;\textstyle f(x) = a&lt;/math&gt; where &lt;math&gt;\textstyle a&lt;/math&gt; is a constant and the cost &lt;math&gt;\textstyle C=E[(x - f(x))^2]&lt;/math&gt;. Minimizing this cost will give us a value of &lt;math&gt;\textstyle a&lt;/math&gt; that is equal to the mean of the data. The cost function can be much more complicated. Its form depends on the application: for example, in compression it could be related to the [[mutual information]] between &lt;math&gt;\textstyle x&lt;/math&gt; and &lt;math&gt;\textstyle f(x)&lt;/math&gt;, whereas in statistical modeling, it could be related to the [[posterior probability]] of the model given the data (note that in both of those examples those quantities would be maximized rather than minimized).<br /> <br /> Tasks that fall within the paradigm of unsupervised learning are in general [[Approximation|estimation]] problems; the applications include [[Data clustering|clustering]], the estimation of [[statistical distributions]], [[Data compression|compression]] and [[Bayesian spam filtering|filtering]].<br /> <br /> ====Reinforcement learning====<br /> In [[reinforcement learning]], data &lt;math&gt;\textstyle x&lt;/math&gt; are usually not given, but generated by an agent's interactions with the environment. At each point in time &lt;math&gt;\textstyle t&lt;/math&gt;, the agent performs an action &lt;math&gt;\textstyle y_t&lt;/math&gt; and the environment generates an observation &lt;math&gt;\textstyle x_t&lt;/math&gt; and an instantaneous cost &lt;math&gt;\textstyle c_t&lt;/math&gt;, according to some (usually unknown) dynamics. The aim is to discover a ''policy'' for selecting actions that minimizes some measure of a long-term cost; i.e., the expected cumulative cost. The environment's dynamics and the long-term cost for each policy are usually unknown, but can be estimated.<br /> <br /> More formally the environment is modelled as a [[Markov decision process]] (MDP) with states &lt;math&gt;\textstyle {s_1,...,s_n}\in S &lt;/math&gt; and actions &lt;math&gt;\textstyle {a_1,...,a_m} \in A&lt;/math&gt; with the following probability distributions: the instantaneous cost distribution &lt;math&gt;\textstyle P(c_t|s_t)&lt;/math&gt;, the observation distribution &lt;math&gt;\textstyle P(x_t|s_t)&lt;/math&gt; and the transition &lt;math&gt;\textstyle P(s_{t+1}|s_t, a_t)&lt;/math&gt;, while a policy is defined as conditional distribution over actions given the observations. Taken together, the two then define a [[Markov chain]] (MC). The aim is to discover the policy that minimizes the cost; i.e., the MC for which the cost is minimal.<br /> <br /> ANNs are frequently used in reinforcement learning as part of the overall algorithm.&lt;ref&gt;{{cite conference| author = Dominic, S., Das, R., Whitley, D., Anderson, C. |date=July 1991 | title = Genetic reinforcement learning for neural networks | conference = IJCNN-91-Seattle International Joint Conference on Neural Networks | booktitle = IJCNN-91-Seattle International Joint Conference on Neural Networks | publisher = IEEE | location = Seattle, Washington, USA | url = http://dx.doi.org/10.1109/IJCNN.1991.155315 | doi = 10.1109/IJCNN.1991.155315 | accessdate = 29 July 2012 | isbn = 0-7803-0164-1 }}&lt;/ref&gt;&lt;ref&gt;{{cite journal |last=Hoskins |first=J.C. |author2=Himmelblau, D.M. |title=Process control via artificial neural networks and reinforcement learning |journal=Computers &amp; Chemical Engineering |year=1992 |volume=16 |pages=241–251 |doi=10.1016/0098-1354(92)80045-B |issue=4}}&lt;/ref&gt; [[Dynamic programming]] has been coupled with ANNs (Neuro dynamic programming) by [[Dimitri Bertsekas|Bertsekas]] and Tsitsiklis&lt;ref&gt;{{cite book| author = Bertsekas, D.P., Tsitsiklis, J.N. | year = 1996 | title = Neuro-dynamic programming | publisher = Athena Scientific | isbn = 1-886529-10-8 | page = 512 }}&lt;/ref&gt; and applied to multi-dimensional nonlinear problems such as those involved in [[vehicle routing]],&lt;ref&gt;{{cite journal |last=Secomandi |first=Nicola |title=Comparing neuro-dynamic programming algorithms for the vehicle routing problem with stochastic demands |journal=Computers &amp; Operations Research |year=2000 |volume=27 |pages=1201–1225 |doi=10.1016/S0305-0548(99)00146-X |issue=11–12}}&lt;/ref&gt; [[natural resource management|natural resources management]]&lt;ref&gt;{{cite conference| author = de Rigo, D., Rizzoli, A. E., Soncini-Sessa, R., Weber, E., Zenesi, P. | year = 2001 | title = Neuro-dynamic programming for the efficient management of reservoir networks | conference = MODSIM 2001, International Congress on Modelling and Simulation | conferenceurl = http://www.mssanz.org.au/MODSIM01/MODSIM01.htm | booktitle = Proceedings of MODSIM 2001, International Congress on Modelling and Simulation | publisher = Modelling and Simulation Society of Australia and New Zealand | location = Canberra, Australia | doi = 10.5281/zenodo.7481 | url = https://zenodo.org/record/7482/files/de_Rigo_etal_MODSIM2001_activelink_authorcopy.pdf | accessdate = 29 July 2012 | isbn = 0-867405252 }}&lt;/ref&gt;&lt;ref&gt;{{cite conference| author = Damas, M., Salmeron, M., Diaz, A., Ortega, J., Prieto, A., Olivares, G.| year = 2000 | title = Genetic algorithms and neuro-dynamic programming: application to water supply networks | conference = 2000 Congress on Evolutionary Computation | booktitle = Proceedings of 2000 Congress on Evolutionary Computation | publisher = IEEE | location = La Jolla, California, USA | url = http://dx.doi.org/10.1109/CEC.2000.870269 | doi = 10.1109/CEC.2000.870269 | accessdate = 29 July 2012 | isbn = 0-7803-6375-2 }}&lt;/ref&gt; or [[medicine]]&lt;ref&gt;{{cite journal |last=Deng |first=Geng |author2=Ferris, M.C. |title=Neuro-dynamic programming for fractionated radiotherapy planning |journal=Springer Optimization and Its Applications |year=2008 |volume=12 |pages=47–70 |doi=10.1007/978-0-387-73299-2_3}}&lt;/ref&gt; because of the ability of ANNs to mitigate losses of accuracy even when reducing the discretization grid density for numerically approximating the solution of the original control problems.<br /> <br /> Tasks that fall within the paradigm of reinforcement learning are control problems, [[game]]s and other [[sequential decision making]] tasks.<br /> <br /> {{See also|dynamic programming|stochastic control}}<br /> <br /> ===Learning algorithms===<br /> Training a neural network model essentially means selecting one model from the set of allowed models (or, in a [[Bayesian probability|Bayesian]] framework, determining a distribution over the set of allowed models) that minimizes the cost criterion. There are numerous algorithms available for training neural network models; most of them can be viewed as a straightforward application of [[Mathematical optimization|optimization]] theory and [[statistical estimation]].<br /> <br /> Most of the algorithms used in training artificial neural networks employ some form of [[gradient descent]], using backpropagation to compute the actual gradients. This is done by simply taking the derivative of the cost function with respect to the network parameters and then changing those parameters in a [[gradient-related]] direction.<br /> <br /> [[Evolutionary methods]],&lt;ref&gt;{{cite conference| author = de Rigo, D., Castelletti, A., Rizzoli, A.E., Soncini-Sessa, R., Weber, E. |date=January 2005 | title = A selective improvement technique for fastening Neuro-Dynamic Programming in Water Resources Network Management | conference = 16th IFAC World Congress | conferenceurl = http://www.nt.ntnu.no/users/skoge/prost/proceedings/ifac2005/Index.html | booktitle = Proceedings of the 16th IFAC World Congress – IFAC-PapersOnLine | editor = Pavel Zítek | volume = 16 | publisher = IFAC | location = Prague, Czech Republic | url = http://www.nt.ntnu.no/users/skoge/prost/proceedings/ifac2005/Papers/Paper4269.html<br /> | accessdate = 30 December 2011 | doi = 10.3182/20050703-6-CZ-1902.02172 | isbn = 978-3-902661-75-3 }}&lt;/ref&gt; [[gene expression programming]],&lt;ref&gt;{{cite web|last=Ferreira|first=C.|year=2006|title=Designing Neural Networks Using Gene Expression Programming|url= http://www.gene-expression-programming.com/webpapers/Ferreira-ASCT2006.pdf|publisher= In A. Abraham, B. de Baets, M. Köppen, and B. Nickolay, eds., Applied Soft Computing Technologies: The Challenge of Complexity, pages 517–536, Springer-Verlag}}&lt;/ref&gt; [[simulated annealing]],&lt;ref&gt;{{cite conference| author = Da, Y., Xiurun, G. |date=July 2005 | title = An improved PSO-based ANN with simulated annealing technique | conference = New Aspects in Neurocomputing: 11th European Symposium on Artificial Neural Networks | conferenceurl = http://www.dice.ucl.ac.be/esann/proceedings/electronicproceedings.htm | editor = T. Villmann | publisher = Elsevier | accessdate = 30 December 2011 | doi = 10.1016/j.neucom.2004.07.002 }}&lt;/ref&gt; [[expectation-maximization]], [[non-parametric methods]] and [[particle swarm optimization]]&lt;ref&gt;{{cite conference| author = Wu, J., Chen, E. |date=May 2009 | title = A Novel Nonparametric Regression Ensemble for Rainfall Forecasting Using Particle Swarm Optimization Technique Coupled with Artificial Neural Network | conference = 6th International Symposium on Neural Networks, ISNN 2009 | conferenceurl = http://www2.mae.cuhk.edu.hk/~isnn2009/ | editor = Wang, H., Shen, Y., Huang, T., Zeng, Z. | publisher = Springer | accessdate = 1 January 2012 | doi = 10.1007/978-3-642-01513-7_6 | isbn = 978-3-642-01215-0 }}&lt;/ref&gt; are some commonly used methods for training neural networks. {{See also|machine learning}}<br /> <br /> ==Employing artificial neural networks==<br /> Perhaps the greatest advantage of ANNs is their ability to be used as an arbitrary function approximation mechanism that 'learns' from observed data. However, using them is not so straightforward, and a relatively good understanding of the underlying theory is essential.<br /> * Choice of model: This will depend on the data representation and the application. Overly complex models tend to lead to problems with learning.<br /> * Learning algorithm: There are numerous trade-offs between learning algorithms. Almost any algorithm will work well with the ''correct [[hyperparameter]]s'' for training on a particular fixed data set. However, selecting and tuning an algorithm for training on unseen data requires a significant amount of experimentation.<br /> * Robustness: If the model, cost function and learning algorithm are selected appropriately the resulting ANN can be extremely robust.<br /> <br /> With the correct implementation, ANNs can be used naturally in [[online algorithm|online learning]] and large data set applications. Their simple implementation and the existence of mostly local dependencies exhibited in the structure allows for fast, parallel implementations in hardware.<br /> <br /> ==Applications==<br /> The utility of artificial neural network models lies in the fact that they can be used to infer a function from observations. This is particularly useful in applications where the complexity of the data or task makes the design of such a function by hand impractical.<br /> <br /> ===Real-life applications===<br /> The tasks artificial neural networks are applied to tend to fall within the following broad categories:<br /> * [[Function approximation]], or [[regression analysis]], including [[time series prediction]], [[fitness approximation]] and modeling.<br /> * [[Statistical classification|Classification]], including [[Pattern recognition|pattern]] and sequence recognition, [[novelty detection]] and sequential decision making.<br /> * [[Data processing]], including filtering, clustering, [[blind source separation]] and compression.<br /> * [[Robotics]], including directing manipulators, [[prosthesis]].<br /> * [[Control engineering|Control]], including [[Computer numerical control]].<br /> <br /> Application areas include the system identification and control (vehicle control, process control, [[natural resource]]s management), quantum chemistry,&lt;ref name=Balabin_2009&gt;{{Cite journal|journal=[[J. Chem. Phys.]] |volume = 131 |issue = 7 |page = 074104 |doi=10.1063/1.3206326 |title=Neural network approach to quantum-chemistry data: Accurate prediction of density functional theory energies |year=2009 |author=Roman M. Balabin, Ekaterina I. Lomakina |pmid=19708729}}&lt;/ref&gt; game-playing and decision making (backgammon, chess, [[poker]]), pattern recognition (radar systems, face identification, object recognition and more), sequence recognition (gesture, speech, handwritten text recognition), medical diagnosis, financial applications (e.g. [[algorithmic trading|automated trading systems]]), [[data mining]] (or knowledge discovery in databases, &quot;KDD&quot;), visualization and [[e-mail spam]] filtering.<br /> <br /> Artificial neural networks have also been used to diagnose several cancers. An ANN based hybrid lung cancer detection system named HLND improves the accuracy of diagnosis and the speed of lung cancer radiology.&lt;ref&gt;{{cite web|last=Ganesan|first=N|title=Application of Neural Networks in Diagnosing Cancer Disease Using Demographic Data|url=http://www.ijcaonline.org/journal/number26/pxc387783.pdf|publisher=International Journal of Computer Applications}}&lt;/ref&gt; These networks have also been used to diagnose prostate cancer. The diagnoses can be used to make specific models taken from a large group of patients compared to information of one given patient. The models do not depend on assumptions about correlations of different variables. Colorectal cancer has also been predicted using the neural networks. Neural networks could predict the outcome for a patient with colorectal cancer with more accuracy than the current clinical methods. After training, the networks could predict multiple patient outcomes from unrelated institutions.&lt;ref&gt;{{cite web|last=Bottaci|first=Leonardo|title=Artificial Neural Networks Applied to Outcome Prediction for Colorectal Cancer Patients in Separate Institutions|url=http://www.lcc.uma.es/~jja/recidiva/042.pdf|publisher=The Lancet}}&lt;/ref&gt;<br /> <br /> ===Neural networks and neuroscience===<br /> Theoretical and [[computational neuroscience]] is the field concerned with the theoretical analysis and the computational modeling of biological neural systems. Since neural systems are intimately related to cognitive processes and behavior, the field is closely related to cognitive and behavioral modeling.<br /> <br /> The aim of the field is to create models of biological neural systems in order to understand how biological systems work. To gain this understanding, neuroscientists strive to make a link between observed biological processes (data), biologically plausible mechanisms for neural processing and learning ([[biological neural network]] models) and theory (statistical learning theory and [[information theory]]).<br /> <br /> ====Types of models====<br /> Many models are used in the field, defined at different levels of abstraction and modeling different aspects of neural systems. They range from models of the short-term behavior of [[biological neuron models|individual neurons]], models of how the dynamics of neural circuitry arise from interactions between individual neurons and finally to models of how behavior can arise from abstract neural modules that represent complete subsystems. These include models of the long-term, and short-term plasticity, of neural systems and their relations to learning and memory from the individual neuron to the system level.<br /> <br /> ==Neural network software==<br /> {{Main|Neural network software}}<br /> <br /> '''Neural network software''' is used to [[Simulation|simulate]], [[research]], develop and apply artificial neural networks, [[biological neural network]]s and, in some cases, a wider array of [[adaptive system]]s.<br /> <br /> ==Types of artificial neural networks==<br /> &lt;!-- Split to [[Types of artificial neural networks]] --&gt;<br /> {{Main|Types of artificial neural networks}}<br /> <br /> Artificial neural network types vary from those with only one or two layers of single direction logic, to complicated multi–input many directional feedback loops and layers. On the whole, these systems use algorithms in their programming to determine control and organization of their functions. <br /> Most systems use &quot;weights&quot; to change the parameters of the throughput and the varying connections to the neurons. Artificial neural networks can be autonomous and learn by input from outside &quot;teachers&quot; or even self-teaching from written-in rules.<br /> <br /> ==Theoretical properties==<br /> &lt;section begin=theory /&gt;<br /> <br /> ===Computational power===<br /> The [[multi-layer perceptron]] (MLP) is a universal function approximator, as proven by the [[universal approximation theorem]]. However, the proof is not constructive regarding the number of neurons required or the settings of the weights.<br /> <br /> Work by [[Hava Siegelmann]] and [[Eduardo D. Sontag]] has provided a proof that a specific recurrent architecture with rational valued weights (as opposed to full precision [[real number]]-valued weights) has the full power of a [[Universal Turing Machine]]&lt;ref&gt;{{Cite journal| title = Turing computability with neural nets | url = http://www.math.rutgers.edu/~sontag/FTP_DIR/aml-turing.pdf | year = 1991 | journal = Appl. Math. Lett. | pages = 77–80 | volume = 4 | issue = 6 | last1 = Siegelmann | first1 = H.T. | last2 = Sontag | first2 = E.D. | doi = 10.1016/0893-9659(91)90080-F }}&lt;/ref&gt; using a finite number of neurons and standard linear connections. Further, it has been shown that the use of irrational values for weights results in a machine with [[Hypercomputation|super-Turing]] power.&lt;ref&gt;{{cite journal |last1=Balcázar |first1=José |title=Computational Power of Neural Networks: A Kolmogorov Complexity Characterization |journal=Information Theory, IEEE Transactions on |date=Jul 1997 |volume=43 |issue=4 |pages=1175–1183 |doi=10.1109/18.605580 |url=http://ieeexplore.ieee.org/xpl/login.jsp?tp=&amp;arnumber=605580&amp;url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D605580 |accessdate=3 November 2014}}&lt;/ref&gt;<br /> <br /> ===Capacity===<br /> Artificial neural network models have a property called 'capacity', which roughly corresponds to their ability to model any given function. It is related to the amount of information that can be stored in the network and to the notion of complexity.<br /> <br /> ===Convergence===<br /> Nothing can be said in general about convergence since it depends on a number of factors. Firstly, there may exist many local minima. This depends on the cost function and the model. Secondly, the optimization method used might not be guaranteed to converge when far away from a local minimum. Thirdly, for a very large amount of data or parameters, some methods become impractical. In general, it has been found that theoretical guarantees regarding convergence are an unreliable guide to practical application. {{Citation needed|date=March 2012}}<br /> <br /> ===Generalization and statistics===<br /> In applications where the goal is to create a system that generalizes well in unseen examples, the problem of over-training has emerged. This arises in convoluted or over-specified systems when the capacity of the network significantly exceeds the needed free parameters. There are two schools of thought for avoiding this problem: The first is to use [[cross-validation (statistics)|cross-validation]] and similar techniques to check for the presence of overtraining and optimally select hyperparameters such as to minimize the generalization error. The second is to use some form of ''[[regularization (mathematics)|regularization]]''. This is a concept that emerges naturally in a probabilistic (Bayesian) framework, where the regularization can be performed by selecting a larger prior probability over simpler models; but also in statistical learning theory, where the goal is to minimize over two quantities: the 'empirical risk' and the 'structural risk', which roughly corresponds to the error over the training set and the predicted error in unseen data due to overfitting.<br /> <br /> [[File:Synapse deployment.jpg|thumb|right|Confidence analysis of a neural network]]<br /> Supervised neural networks that use a [[mean squared error]] (MSE) cost function can use formal statistical methods to determine the confidence of the trained model. The MSE on a validation set can be used as an estimate for variance. This value can then be used to calculate the [[confidence interval]] of the output of the network, assuming a [[normal distribution]]. A confidence analysis made this way is statistically valid as long as the output [[probability distribution]] stays the same and the network is not modified.<br /> <br /> By assigning a [[softmax activation function]], a generalization of the [[logistic function]], on the output layer of the neural network (or a softmax component in a component-based neural network) for categorical target variables, the outputs can be interpreted as posterior probabilities. This is very useful in classification as it gives a certainty measure on classifications.<br /> <br /> The softmax activation function is:<br /> :&lt;math&gt;y_i=\frac{e^{x_i}}{\sum_{j=1}^c e^{x_j}}&lt;/math&gt;<br /> &lt;section end=theory /&gt;<br /> <br /> ==Controversies==<br /> <br /> ===Training issues===<br /> A common criticism of neural networks, particularly in robotics, is that they require a large diversity of training for real-world operation {{Citation needed|date=November 2014}}. This is not surprising, since any learning machine needs sufficient representative examples in order to capture the underlying structure that allows it to generalize to new cases. Dean Pomerleau, in his research presented in the paper &quot;Knowledge-based Training of Artificial Neural Networks for Autonomous Robot Driving,&quot; uses a neural network to train a robotic vehicle to drive on multiple types of roads (single lane, multi-lane, dirt, etc.). A large amount of his research is devoted to (1) extrapolating multiple training scenarios from a single training experience, and (2) preserving past training diversity so that the system does not become overtrained (if, for example, it is presented with a series of right turns – it should not learn to always turn right). These issues are common in neural networks that must decide from amongst a wide variety of responses, but can be dealt with in several ways, for example by randomly shuffling the training examples, by using a numerical optimization algorithm that does not take too large steps when changing the network connections following an example, or by grouping examples in so-called mini-batches.<br /> <br /> [[A. K. Dewdney]], a former ''[[Scientific American]]'' columnist, wrote in 1997, &quot;Although neural nets do solve a few toy problems, their powers of computation are so limited that I am surprised anyone takes them seriously as a general problem-solving tool.&quot; (Dewdney, p.&amp;nbsp;82)<br /> <br /> ===Hardware issues===<br /> To implement large and effective software neural networks, considerable processing and storage resources need to be committed {{Citation needed|date=November 2014}}. While the brain has hardware tailored to the task of processing signals through a [[Graph (mathematics)|graph]] of neurons, simulating even a most simplified form on [[Von Neumann]] technology may compel a neural network designer to fill many millions of [[database]] rows for its connections – which can consume vast amounts of computer [[Random-access memory|memory]] and [[Hard drive|hard disk]] space. Furthermore, the designer of neural network systems will often need to simulate the transmission of signals through many of these connections and their associated neurons – which must often be matched with incredible amounts of [[CPU]] processing power and time. While neural networks often yield ''effective'' programs, they too often do so at the cost of ''efficiency'' (they tend to consume considerable amounts of time and money).<br /> <br /> Computing power continues to grow roughly according to [[Moore's Law]], which may provide sufficient resources to accomplish new tasks. [[Neuromorphic engineering]] addresses the hardware difficulty directly, by constructing non-Von-Neumann chips with circuits designed to implement neural nets from the ground up.<br /> <br /> ===Practical counterexamples to criticisms===<br /> <br /> Arguments against Dewdney's position are that neural networks have been successfully used to solve many complex and diverse tasks, ranging from autonomously flying aircraft&lt;ref&gt;[http://www.nasa.gov/centers/dryden/news/NewsReleases/2003/03-49.html NASA - Dryden Flight Research Center - News Room: News Releases: NASA NEURAL NETWORK PROJECT PASSES MILESTONE]. Nasa.gov. Retrieved on 2013-11-20.&lt;/ref&gt; to detecting credit card fraud .{{citation needed|date=August 2012}}<br /> <br /> Technology writer [[Roger Bridgman]] commented on Dewdney's statements about neural nets:<br /> &lt;blockquote&gt;Neural networks, for instance, are in the dock not only because they have been hyped to high heaven, (what hasn't?) but also because you could create a successful net without understanding how it worked: the bunch of numbers that captures its behaviour would in all probability be &quot;an opaque, unreadable table...valueless as a scientific resource&quot;.<br /> <br /> In spite of his emphatic declaration that science is not technology, Dewdney seems here to pillory neural nets as bad science when most of those devising them are just trying to be good engineers. An unreadable table that a useful machine could read would still be well worth having.&lt;ref&gt;[http://members.fortunecity.com/templarseries/popper.html Roger Bridgman's defence of neural networks]&lt;/ref&gt;<br /> &lt;/blockquote&gt;<br /> <br /> Although it is true that analyzing what has been learned by an artificial neural network is difficult, it is much easier to do so than to analyze what has been learned by a biological neural network. Furthermore, researchers involved in exploring learning algorithms for neural networks are gradually uncovering generic principles which allow a learning machine to be successful. For example, Bengio and LeCun (2007) wrote an article regarding local vs non-local learning, as well as shallow vs deep architecture.&lt;ref&gt;http://www.iro.umontreal.ca/~lisa/publications2/index.php/publications/show/4&lt;/ref&gt;<br /> <br /> ===Hybrid approaches===<br /> Some other criticisms came from believers of hybrid models (combining neural networks and symbolic approaches). They advocate the intermix of these two approaches and believe that hybrid models can better capture the mechanisms of the human mind.&lt;ref&gt;Sun and Bookman (1990)&lt;/ref&gt;&lt;ref&gt;{{Cite journal| last1 = Tahmasebi | last2 = Hezarkhani | title = A hybrid neural networks-fuzzy logic-genetic algorithm for grade estimation | url = http://www.sciencedirect.com/science/article/pii/S0098300412000398 | year = 2012| journal = Computers &amp; Geosciences | pages = 18–27 | volume = 42| doi = 10.1016/j.cageo.2012.02.004 }}&lt;/ref&gt;<br /> <br /> ==Gallery==<br /> &lt;gallery widths=&quot;220&quot;&gt;<br /> File:Single_layer_ann.svg|A single-layer feedforward artificial neural network. Arrows originating from &lt;math&gt;\scriptstyle x_2&lt;/math&gt; are omitted for clarity. There are p inputs to this network and q outputs. In this system, the value of the qth output, &lt;math&gt;\scriptstyle y_q&lt;/math&gt; would be calculated as &lt;math&gt;\scriptstyle y_q = \sum(x_i*w_{iq}) &lt;/math&gt;<br /> File:Two_layer_ann.svg|A two-layer feedforward artificial neural network.<br /> File:Artificial_neural_network.svg<br /> File:Ann_dependency_(graph).svg<br /> &lt;/gallery&gt;<br /> <br /> ==See also==<br /> {{columns-list|colwidth=25em|<br /> * [[20Q]]<br /> * [[ADALINE]]<br /> * [[Adaptive resonance theory]]<br /> * [[Artificial life]]<br /> * [[Associative learning|Associative memory]]<br /> * [[Autoencoder]]<br /> * [[Backpropagation]]<br /> * [[BEAM robotics]]<br /> * [[Biological cybernetics]]<br /> * [[Biologically inspired computing]]<br /> * [[Blue brain]]<br /> * [[Catastrophic interference]]<br /> * [[Cerebellar Model Articulation Controller]]<br /> * [[Cognitive architecture]]<br /> * [[Cognitive science]]<br /> * [[Convolutional neural network]] (CNN)<br /> * [[Connectionist expert system]]<br /> * [[Connectomics]]<br /> * [[Cultured neuronal networks]]<br /> * [[Digital morphogenesis]]<br /> * [[Encog]]<br /> * [[Fuzzy logic]]<br /> * [[Gene expression programming]]<br /> * [[Genetic algorithm]]<br /> * [[Group method of data handling]]<br /> * [[Habituation]]<br /> * [[In Situ Adaptive Tabulation]]<br /> * [[Memristor]]<br /> * [[Multilinear subspace learning]]<br /> * [[Neuroevolution]]<br /> * [[Neural coding]]<br /> * [[Neural gas]]<br /> * [[Neural network software]]<br /> * [[Neuroscience]]<br /> * [[Ni1000]] chip<br /> * [[Nonlinear system identification]]<br /> * [[Optical neural network]]<br /> * [[Parallel Constraint Satisfaction Processes]]<br /> * [[Parallel distributed processing]]<br /> * [[Radial basis function network]]<br /> * [[Recurrent neural networks]]<br /> * [[Self-organizing map]]<br /> * [[Systolic array]]<br /> * [[Tensor product network]]<br /> * [[Time delay neural network]] (TDNN)<br /> }}<br /> <br /> ==References==<br /> {{Reflist|2}}<br /> <br /> ==Bibliography==<br /> {{refbegin}}<br /> * {{Cite journal| author=Bhadeshia H. K. D. H. | year=1999 |title=Neural Networks in Materials Science | journal=ISIJ International | volume=39 |pages=966–979 | doi=10.2355/isijinternational.39.966 | url=http://www.msm.cam.ac.uk/phase-trans/abstracts/neural.review.pdf| issue=10}}<br /> * Bishop, C.M. (1995) ''Neural Networks for Pattern Recognition'', Oxford: Oxford University Press. ISBN 0-19-853849-9 (hardback) or ISBN 0-19-853864-2 (paperback)<br /> * Cybenko, G.V. (1989). Approximation by Superpositions of a Sigmoidal function, ''[[Mathematics of Control, Signals, and Systems]]'', Vol. 2 pp.&amp;nbsp;303–314. [http://actcomm.dartmouth.edu/gvc/papers/approx_by_superposition.pdf electronic version]<br /> * Duda, R.O., Hart, P.E., Stork, D.G. (2001) ''Pattern classification (2nd edition)'', Wiley, ISBN 0-471-05669-3<br /> * {{Cite journal | author=Egmont-Petersen, M., de Ridder, D., Handels, H. | year=2002 | title=Image processing with neural networks – a review | journal=Pattern Recognition | volume=35 | pages=2279–2301 | doi = 10.1016/S0031-3203(01)00178-9 | issue=10}}<br /> * Gurney, K. (1997) ''An Introduction to Neural Networks'' London: Routledge. ISBN 1-85728-673-1 (hardback) or ISBN 1-85728-503-4 (paperback)<br /> * Haykin, S. (1999) '' Neural Networks: A Comprehensive Foundation'', Prentice Hall, ISBN 0-13-273350-1<br /> * Fahlman, S, Lebiere, C (1991). ''The Cascade-Correlation Learning Architecture'', created for [[National Science Foundation]], Contract Number EET-8716324, and [[Defense Advanced Research Projects Agency]] (DOD), ARPA Order No. 4976 under Contract F33615-87-C-1499. [http://www.cs.iastate.edu/~honavar/fahlman.pdf electronic version]<br /> * Hertz, J., Palmer, R.G., Krogh. A.S. (1990) ''Introduction to the theory of neural computation'', Perseus Books. ISBN 0-201-51560-1<br /> * Lawrence, Jeanette (1994) ''Introduction to Neural Networks'', California Scientific Software Press. ISBN 1-883157-00-5<br /> * Masters, Timothy (1994) ''Signal and Image Processing with Neural Networks'', John Wiley &amp; Sons, Inc. ISBN 0-471-04963-8<br /> * [[Brian D. Ripley|Ripley, Brian D]]. (1996) ''Pattern Recognition and Neural Networks'', Cambridge<br /> * Siegelmann, H.T. and [[Eduardo D. Sontag|Sontag, E.D.]] (1994). Analog computation via neural networks, ''Theoretical Computer Science'', v. 131, no. 2, pp.&amp;nbsp;331–360. [http://www.math.rutgers.edu/~sontag/FTP_DIR/nets-real.pdf electronic version]<br /> * Sergios Theodoridis, Konstantinos Koutroumbas (2009) &quot;Pattern Recognition&quot;, 4th Edition, Academic Press, ISBN 978-1-59749-272-0.<br /> * Smith, Murray (1993) ''Neural Networks for Statistical Modeling'', Van Nostrand Reinhold, ISBN 0-442-01310-8<br /> * Wasserman, Philip (1993) ''Advanced Methods in Neural Computing'', Van Nostrand Reinhold, ISBN 0-442-00461-3<br /> * ''Computational Intelligence: A Methodological Introduction'' by Kruse, Borgelt, Klawonn, Moewes, Steinbrecher, Held, 2013, Springer, ISBN 9781447150121<br /> * ''Neuro-Fuzzy-Systeme'' (3rd edition) by Borgelt, Klawonn, Kruse, Nauck, 2003, Vieweg, ISBN 9783528252656<br /> {{refend}}<br /> <br /> ==External links==<br /> &lt;!--<br /> Do not post software links here. If you must, use the Neural Network Software article. Remember however that Wikipedia is neither a link repository nor the place to promote products or show off your code.<br /> --&gt;<br /> {{wikibooks|Artificial Neural Networks}}<br /> * {{dmoz|Computers/Artificial_Intelligence/Neural_Networks|Neural Networks}}<br /> * [http://www.dkriesel.com/en/science/neural_networks A brief introduction to Neural Networks] (PDF), illustrated 250p textbook covering the common kinds of neural networks (CC license).<br /> <br /> {{DEFAULTSORT:Artificial Neural Network}}<br /> [[Category:Computational statistics]]<br /> [[Category:Artificial neural networks| ]]<br /> [[Category:Classification algorithms]]<br /> [[Category:Computational neuroscience]]<br /> [[Category:Mathematical psychology]]<br /> <br /> [[pl:Sieci neuronowe]]<br /> [[ro:Rețea neurală artificială]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Wikipedia:Articles_for_deletion/Roy_(programming_language)&diff=654352221 Wikipedia:Articles for deletion/Roy (programming language) 2015-03-31T15:34:09Z <p>PuercoPop: </p> <hr /> <div>===[[Roy (programming language)]]===<br /> {{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD|T}}<br /> <br /> :{{la|Roy (programming language)}} – (&lt;includeonly&gt;[[Wikipedia:Articles for deletion/Roy (programming language)|View AfD]]&lt;/includeonly&gt;&lt;noinclude&gt;[[Wikipedia:Articles for deletion/Log/2015 March 31#{{anchorencode:Roy (programming language)}}|View log]]&lt;/noinclude&gt;{{int:dot-separator}} &lt;span class=&quot;plainlinks&quot;&gt;[https://tools.wmflabs.org/jackbot/snottywong/cgi-bin/votecounter.cgi?page=Wikipedia:Articles_for_deletion/Roy_(programming_language) Stats]&lt;/span&gt;)<br /> :({{Find sources AFD|Roy (programming language)}})<br /> Unnotable programming language. Fails [[WP:GNG]], [[WP:NSOFT]]. &amp;#8213;&lt;span style=&quot;background:#8FF;border:solid 1px;border-radius:8px;box-shadow:darkgray 2px 2px 2px&quot;&gt;&amp;nbsp;[[User:Padenton|&lt;span style=&quot;font-family:Old English Text MT;color:#C00&quot;&gt;Padenton&lt;/span&gt;]]&amp;#124;[[User talk:Padenton|&amp;#9993;]]&amp;nbsp;&lt;/span&gt;&amp;nbsp; 15:12, 31 March 2015 (UTC)<br /> : As the article's main author, I agree it should be deleted, It appears that development of Roy has stopped and the language is currently in an incipient state. [[User:PuercoPop|PuercoPop]] ([[User talk:PuercoPop|talk]]) 15:34, 31 March 2015 (UTC)</div> PuercoPop https://en.wikipedia.org/w/index.php?title=The_Assayer&diff=653775733 The Assayer 2015-03-27T17:11:52Z <p>PuercoPop: </p> <hr /> <div>{{italic title}}<br /> [[Image:Assayertitle.png|thumb|275px|right|Franceso Villamena's Frontispiece for ''The Assayer'']]<br /> '''''The Assayer''''' ({{lang-it|Il Saggiatore}}) was a book published in [[Rome]] by [[Galileo Galilei]] in October 1623.<br /> <br /> The book was a polemic against the treatise on the [[comet]]s of 1618 by [[Orazio Grassi]], a [[Jesuit]] mathematician at the [[Collegio Romano]]. In this matter Grassi, for all his [[Aristotelianism]], was right and Galileo was wrong. Galileo incorrectly treated the comets as a play of light rather than as real objects.<br /> <br /> In 1616 Galileo may have been silenced on [[Copernicanism]]. In 1623 his supporter and friend, Cardinal [[Maffeo Barberini]], a former patron of the [[Accademia dei Lincei|Lynx]] and uncle of Cardinal [[Francesco Barberini (seniore)|Francesco Barberini]], became [[Pope Urban VIII]]. The election of Barberini seemed to assure Galileo of support at the highest level in the Church. A visit to Rome confirmed this.<br /> <br /> The title page of ''The Assayer'' shows the crest of the [[Barberini|Barberini family]], featuring three busy bees. In ''The Assayer'', Galileo weighs the astronomical views of a Jesuit, Orazio Grassi, and finds them wanting. The book was dedicated to the new pope. The title page also shows that Urban VIII employed a member of the Lynx, Cesarini, at a high level in the papal service. This book was edited and published by members of the Lynx.<br /> <br /> Again Galileo insisted that physics should be mathematical. According to the title page, he was the [[philosopher]] or [[physicist]] of the Grand Duke of Tuscany, not merely the mathematician. Physics or natural philosophy spans the gamut from processes of generation and growth (represented by a plant) to the physical structure of the universe, represented by the cosmic cross-section. Mathematics, on the other hand, is symbolized by telescopes, and an astrolabe. This is the book containing Galileo’s famous statement that mathematics is the language of science. Only through mathematics can one achieve lasting truth in physics. Those who neglect mathematics wander endlessly in a dark labyrinth. From the book:&lt;ref&gt;Galileo Galilei, ''The Assayer'', as translated by [[Stillman Drake]] (1957), ''Discoveries and Opinions of Galileo'' pp. 237-8.&lt;/ref&gt;<br /> <br /> {{cquote|''Philosophy [i.e. physics] is written in this grand book — I mean the universe — which stands continually open to our gaze, but it cannot be understood unless one first learns to comprehend the language and interpret the characters in which it is written. It is written in the language of mathematics, and its characters are triangles, circles, and other geometrical figures, without which it is humanly impossible to understand a single word of it; without these, one is wandering around in a dark labyrinth.''}}<br /> <br /> Although ''The Assayer'' contains a magnificent polemic for mathematical physics, ironically its main point was to ridicule a mathematical astronomer. This time, the target of Galileo’s wit and sarcasm was the cometary theory of a Jesuit, [[Orazio Grassi]], who argued from parallax that comets move above the Moon. Galileo mistakenly countered that comets are an optical illusion.<br /> <br /> Galileo’s polemical tone was common at the time. However, the book was read with delight at the dinner table by Urban VIII, who had written a poem lauding Galileo for his rhetorical performances.{{ citation needed }}<br /> <br /> ==See also==<br /> * [[Book of Nature]]<br /> <br /> ==References==<br /> {{reflist}}<br /> <br /> ==Sources==<br /> *Galileo Galilei, ''Il Saggiatore'' (in Italian) (Rome, 1623); ''[http://www.princeton.edu/~hos/h291/assayer.htm The Assayer]'', English trans. [[Stillman Drake]] and C. D. O'Malley, in ''The Controversy on the Comets of 1618'' (University of Pennsylvania Press, 1960).<br /> *Pietro Redondi, ''Galileo eretico'', 1983; ''Galileo: Heretic'' (transl: Raymond Rosenthal) Princeton University Press 1987 (reprint 1989 ISBN 0-691-02426-X); Penguin 1988 (reprint 1990 ISBN 0-14-012541-8)<br /> <br /> {{Galileo Galilei}}<br /> <br /> {{DEFAULTSORT:Assayer, The}}<br /> [[Category:1623 books]]<br /> [[Category:Astronomy books]]<br /> [[Category:History of astronomy]]<br /> [[Category:Books by Galileo Galilei]]</div> PuercoPop https://en.wikipedia.org/w/index.php?title=Luis_Casta%C3%B1eda&diff=644419951 Luis Castañeda 2015-01-27T16:08:28Z <p>PuercoPop: Remove extra period + citation needed</p> <hr /> <div>{{spanish name 2|Castañeda|Lossio}} <br /> {{Infobox Officeholder | name = Luis Castañeda<br /> | image = LUISCASTAÑEDALOSSIO.PNG<br /> | smallimage =<br /> | caption =<br /> | order = [[Mayor of Lima|Metropolitan Mayor of Lima]]<br /> | term_start = 1 January 2003<br /> | term_end = 11 October 2010<br /> | vicepresident =<br /> | viceprimeminister =<br /> | deputy = <br /> | president =<br /> | primeminister =<br /> | predecessor = [[Alberto Andrade Carmona|Alberto Andrade]]<br /> | successor = [[Marco Parra Sánchez|Marco Parra]]<br /> | term_start2 = 1 January 2015<br /> | term_end2 =<br /> | vicepresident2 =<br /> | viceprimeminister2 =<br /> | deputy2 =<br /> | president2 =<br /> | primeminister2 =<br /> | predecessor2 = [[Susana Villarán]]<br /> | successor2 =<br /> | order3 =<br /> | term_start3 =<br /> | term_end3 =<br /> | vicepresident3 =<br /> | viceprimeminister3 =<br /> | deputy3 =<br /> | president3 =<br /> | primeminister3 =<br /> | predecessor3 =<br /> | successor3 =<br /> | order4 =<br /> | term_start4 =<br /> | term_end4 =<br /> | vicepresident4 =<br /> | viceprimeminister4 =<br /> | deputy4 =<br /> | president4 =<br /> | primeminister4 =<br /> | predecessor4 =<br /> | successor4 =<br /> | birth_date = {{Birth date and age|1945|6|21|mf=y}}<br /> | birth_place = [[Chiclayo]], [[Lambayeque Region|Lambayeque]]<br /> | death_date =<br /> | death_place =<br /> | constituency =<br /> | party = [[National Solidarity (Peru)]]<br /> | spouse =<br /> | profession = Lawyer<br /> | religion = Roman Catholic<br /> | signature =<br /> | footnotes =<br /> }}<br /> <br /> '''Óscar Luis Castañeda Lossio''' (born June 21, 1945) is a [[Peru]]vian politician who was [[Mayor]] of [[Lima]], [[Peru]], from 2003 to 2010. He became Mayor of Lima again in 2015, after being elected for a third nonconsecutive term with a 51% of popular vote, that lasts until December 2018. He is recognized for being a successful mayor for his public works and transportation reforms. He ran for [[President of Peru]] in 2000, prior to his municipal reign, and in 2011, obtaining the fifth place with 9%. {{ citation needed }}<br /> <br /> ==Life and politics==<br /> Castañeda, who was born in [[Chiclayo]] and lived in the ''Casa Castañeda'', is the son of Carlos Castañeda Iparraguirre and Ida Lossio. His father is remembered as one of the most important mayors of [[Chiclayo]]. As a little child he used to inspect with his father the works in progress at the city. From his marriage with Rosario Pardo, he has two sons: Luis Castañeda Pardo and Darío Castañeda Pardo.<br /> <br /> He was trained as a lawyer at the [[Pontifical Catholic University of Peru|Catholic University of Peru]], he got a Masters degree at the [[Centro de Altos Estudios Militares del Perú]]. In [[Sweden]] and [[Mexico]] he got a Professional Diploma in Management. In 1981, he started as a member of [[Popular Action (Peru)|Popular Action]] party, working with many of the former mayors of Lima as [[Alfonso Barrantes Lingán]].<br /> <br /> Between 1990-1996, during [[Alberto Fujimori|Fujimori's]] government, he was the President of the National Institute of Public Health [[IPPS]], now known as [[ESSALUD]]. He had also a controversial participacion in La Caja del Pescador, an entity that works in benefit of the fishermen.&lt;ref&gt;[http://www.agenciaperu.com/sociedad/2002/feb/cajapescador.htm]&lt;/ref&gt; In 2000, he ran as a candidate of his own party [[National Solidarity (Peru)|National Solidarity Party]], in the [[Peruvian national election, 2000|presidential elections]], but failed to make it to the run-off elections.&lt;ref&gt;http://allmediany.com/details_news_article.php?news_artid=887&lt;/ref&gt;&lt;ref&gt;http://latintrade.com/2009/06/luis-castaneda-lossio-a-dark-horse-in-a-long-race&lt;/ref&gt;&lt;ref&gt;http://www.peruviantimes.com/17/no-alliances-will-be-made-with-lima-mayor-castaneda-for-upcoming-2011-presidential-elections-says-simon/3680/&lt;/ref&gt;<br /> <br /> In 2002, he participated in the elections for mayor with the [[National Unity (Peru)|National Unity Party]], defeating Mayor [[Alberto Andrade]]. Castañeda started out as a very popular mayor, with a popularity index close to 79%. He won re-election as the city's mayor in November 2006 with 48% of the vote.<br /> <br /> In 2011, SN (lead by Luis Castañeda Lossio) decided to run for presidency. Nevertheless and unsuccessfully, they only managed to gather around 9.5% of the votes.<br /> <br /> On March 15, 2013 audio recordings leaked to the press were broadcast over national television revealing that Luis Castañeda Lossio was indeed in charge of the campaign to recall Lima's first female Mayor, Susana Villaran.&lt;ref&gt;{{ cite web | url=http://www.hispanicallyspeakingnews.com/latino-daily-news/details/lima-perus-first-female-mayor-survives-recall-vote/23094/ |title=Lima, Peru’s First Female Mayor Survives Recall Vote |publisher=Hispanically Speaking News }}&lt;/ref&gt; Before the leaks Castañeda Lossio had publicly denied his involvement in the recall process.<br /> <br /> In 2014, he ran for Mayor of Lima, winning the election by a landslide on October 5, trailing her rival and current mayor [[Susana Villarán]] to the third place (10%), and surprisingly, giving 18% to [[APRA]] candidate [[Enrique Cornejo]]. He assumed office on January 1, 2015.<br /> <br /> ==References==<br /> {{reflist}}<br /> <br /> {{s-start}}<br /> {{succession box|title=[[Mayor of Lima]]|before=[[Alberto Andrade]]|after=[[Marco Parra Sánchez]]|years=2002&amp;ndash;2010}}<br /> {{s-end}}<br /> <br /> {{LimaMayors}}<br /> <br /> {{Persondata &lt;!-- Metadata: see [[Wikipedia:Persondata]]. --&gt;<br /> | NAME =Castaneda Lossio, Luis<br /> | ALTERNATIVE NAMES =<br /> | SHORT DESCRIPTION = Peruvian politician<br /> | DATE OF BIRTH =21 June 1945<br /> | PLACE OF BIRTH =[[Chiclayo]], [[Lambayeque Region|Lambayeque]]<br /> | DATE OF DEATH =<br /> | PLACE OF DEATH =<br /> }}<br /> {{DEFAULTSORT:Castaneda Lossio, Luis}}<br /> [[Category:Living people]]<br /> [[Category:Peruvian people of Italian descent]]<br /> [[Category:Mayors of Lima]]<br /> [[Category:1945 births]]<br /> [[Category:Popular Action (Peru) politicians]]<br /> [[Category:National Unity (Peru) politicians]]<br /> [[Category:National Solidarity Party (Peru) politicians]]</div> PuercoPop