39 lines
2 KiB
HTML
39 lines
2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
|
|
<!Converted with LaTeX2HTML 0.6.5 (Tue Nov 15 1994) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
|
|
<HEAD>
|
|
<TITLE>5.2.1. Named Functions</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value=" Named Functions">
|
|
<meta name="keywords" value="clm">
|
|
<meta name="resource-type" value="document">
|
|
<meta name="distribution" value="global">
|
|
<P>
|
|
<b>Common Lisp the Language, 2nd Edition</b>
|
|
<BR> <HR><A NAME=tex2html2299 HREF="node64.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html2297 HREF="node62.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html2291 HREF="node62.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html2301 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html2302 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html2300 HREF="node64.html"> Lambda-Expressions</A>
|
|
<B>Up:</B> <A NAME=tex2html2298 HREF="node62.html"> Functions</A>
|
|
<B> Previous:</B> <A NAME=tex2html2292 HREF="node62.html"> Functions</A>
|
|
<HR> <P>
|
|
<H2><A NAME=SECTION00921000000000000000>5.2.1. Named Functions</A></H2>
|
|
<P>
|
|
A name can be given to a function in one of two ways.
|
|
A <i>global name</i> can be given to a function by using the
|
|
<tt>defun</tt> construct.
|
|
A <i>local name</i> can be given to a function by using the
|
|
<tt>flet</tt> or
|
|
<tt>labels</tt> special form.
|
|
When a function is named, a lambda-expression is effectively
|
|
associated with that name
|
|
along with information about the entities that are lexically apparent
|
|
at that point.
|
|
If a symbol appears as the first element of a function-call form, then it
|
|
refers to the definition established by the innermost <tt>flet</tt> or <tt>labels</tt>
|
|
construct that textually contains the reference, or to the global
|
|
definition (if any) if there is no such containing construct.
|
|
<P>
|
|
<HR>
|
|
<P><ADDRESS>
|
|
AI.Repository@cs.cmu.edu
|
|
</ADDRESS>
|
|
</BODY>
|