Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Common Lisp
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====The function namespace==== <!-- This section name is linked from several places; if you change it, update the links. --> 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 <code>defun</code>, <code>flet</code>, <code>labels</code>, <code>defmethod</code> and <code>defgeneric</code>. To pass a function by name as an argument to another function, one must use the <code>function</code> special operator, commonly abbreviated as <code>#'</code>. The first <code>sort</code> example above refers to the function named by the symbol <code>></code> in the function namespace, with the code <code>#'></code>. Conversely, to call a function passed in such a way, one would use the <code>funcall</code> operator on the argument. [[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. 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.<ref>{{cite journal |title=Technical Issues of Separation in Function Cells and Value Cells |url=http://www.nhplace.com/kent/Papers/Technical-Issues.html |author=Richard P. Gabriel |author2=Kent M. Pitman |journal=LISP and Symbolic Computation |date=June 1988|volume=1 |issue=1 |pages=81β101 |doi=10.1007/bf01806178|s2cid=26716515}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Common Lisp
(section)
Add topic