Mercurial > hg > xemacs-beta
comparison man/lispref/functions.texi @ 5361:62b9ef1ed4ac
Change "special form" to "special operator" in the manuals, too
2011-03-01 Aidan Kehoe <kehoea@parhasard.net>
* lispref/commands.texi (Using Interactive):
* lispref/compile.texi (Eval During Compile):
* lispref/compile.texi (Compiled-Function Objects):
* lispref/control.texi (Sequencing):
* lispref/control.texi (Conditionals):
* lispref/control.texi (Combining Conditions):
* lispref/control.texi (Iteration):
* lispref/control.texi (Catch and Throw):
* lispref/control.texi (Handling Errors):
* lispref/control.texi (Cleanups):
* lispref/display.texi (Temporary Displays):
* lispref/eval.texi (Quoting):
* lispref/eval.texi (Multiple values):
* lispref/frames.texi (Input Focus):
* lispref/functions.texi (Argument List):
* lispref/functions.texi (Defining Functions):
* lispref/functions.texi (Anonymous Functions):
* lispref/internationalization.texi (Level 3 Primitives):
* lispref/internationalization.texi (Domain Specification):
* lispref/intro.texi (A Sample Function Description):
* lispref/intro.texi (A Sample Variable Description):
* lispref/lists.texi (Sets And Lists):
* lispref/macros.texi (Defining Macros):
* lispref/macros.texi (Backquote):
* lispref/positions.texi (Excursions):
* lispref/positions.texi (Narrowing):
* lispref/searching.texi (Saving Match Data):
* lispref/sequences.texi (Sequence Functions):
* lispref/sequences.texi (Array Functions):
* lispref/specifiers.texi (Adding Specifications):
* lispref/variables.texi (Local Variables):
* lispref/variables.texi (Defining Variables):
* lispref/variables.texi (Setting Variables):
* lispref/variables.texi (Default Value):
* lispref/windows.texi (Selecting Windows):
* lispref/windows.texi (Window Configurations):
No longer use @defspec, since we no longer use the term "special
form"; instead use @deffn {Special Operator}. Unfortunately
there's no way in texinfo to redefine @defspec in one place.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 01 Mar 2011 14:18:45 +0000 |
parents | 99f8ebc082d9 |
children | 9fae6227ede5 |
comparison
equal
deleted
inserted
replaced
5359:f5a5501814f5 | 5361:62b9ef1ed4ac |
---|---|
335 @code{subseq} means to use the length of the sequence supplied. | 335 @code{subseq} means to use the length of the sequence supplied. |
336 | 336 |
337 @cindex CL note---default optional arg | 337 @cindex CL note---default optional arg |
338 @quotation | 338 @quotation |
339 @b{Common Lisp note:} Common Lisp allows the function to specify what | 339 @b{Common Lisp note:} Common Lisp allows the function to specify what |
340 default value to use when an optional argument is omitted; XEmacs Lisp | 340 default value to use when an optional argument is omitted; this is |
341 always uses @code{nil}. | 341 available in XEmacs Lisp with the @code{defun*} macro, an alternative to |
342 @code{defun}. | |
342 @end quotation | 343 @end quotation |
343 | 344 |
344 For example, an argument list that looks like this: | 345 For example, an argument list that looks like this: |
345 | 346 |
346 @example | 347 @example |
472 | 473 |
473 We usually give a name to a function when it is first created. This | 474 We usually give a name to a function when it is first created. This |
474 is called @dfn{defining a function}, and it is done with the | 475 is called @dfn{defining a function}, and it is done with the |
475 @code{defun} special operator. | 476 @code{defun} special operator. |
476 | 477 |
477 @defspec defun name argument-list body-forms | 478 @deffn {Special Operator} defun name argument-list body-forms |
478 @code{defun} is the usual way to define new Lisp functions. It | 479 @code{defun} is the usual way to define new Lisp functions. It |
479 defines the symbol @var{name} as a function that looks like this: | 480 defines the symbol @var{name} as a function that looks like this: |
480 | 481 |
481 @example | 482 @example |
482 (lambda @var{argument-list} . @var{body-forms}) | 483 (lambda @var{argument-list} . @var{body-forms}) |
541 Be careful not to redefine existing functions unintentionally. | 542 Be careful not to redefine existing functions unintentionally. |
542 @code{defun} redefines even primitive functions such as @code{car} | 543 @code{defun} redefines even primitive functions such as @code{car} |
543 without any hesitation or notification. Redefining a function already | 544 without any hesitation or notification. Redefining a function already |
544 defined is often done deliberately, and there is no way to distinguish | 545 defined is often done deliberately, and there is no way to distinguish |
545 deliberate redefinition from unintentional redefinition. | 546 deliberate redefinition from unintentional redefinition. |
546 @end defspec | 547 @end deffn |
547 | 548 |
548 @defun define-function name definition | 549 @defun define-function name definition |
549 @defunx defalias name definition | 550 @defunx defalias name definition |
550 These equivalent primitives define the symbol @var{name} as a | 551 These equivalent primitives define the symbol @var{name} as a |
551 function, with definition @var{definition} (which can be any valid Lisp | 552 function, with definition @var{definition} (which can be any valid Lisp |
831 | 832 |
832 @noindent | 833 @noindent |
833 In such cases, we usually use the special operator @code{function} instead | 834 In such cases, we usually use the special operator @code{function} instead |
834 of simple quotation to quote the anonymous function. | 835 of simple quotation to quote the anonymous function. |
835 | 836 |
836 @defspec function function-object | 837 @deffn {Special Operator} function function-object |
837 @cindex function quoting | 838 @cindex function quoting |
838 This special operator returns @var{function-object} without evaluating it. | 839 This special operator returns @var{function-object} without evaluating it. |
839 In this, it is equivalent to @code{quote}. However, it serves as a | 840 In this, it is equivalent to @code{quote}. However, it serves as a |
840 note to the XEmacs Lisp compiler that @var{function-object} is intended | 841 note to the XEmacs Lisp compiler that @var{function-object} is intended |
841 to be used only as a function, and therefore can safely be compiled. | 842 to be used only as a function, and therefore can safely be compiled. |
842 Contrast this with @code{quote}, in @ref{Quoting}. | 843 Contrast this with @code{quote}, in @ref{Quoting}. |
843 @end defspec | 844 @end deffn |
844 | 845 |
845 Using @code{function} instead of @code{quote} makes a difference | 846 Using @code{function} instead of @code{quote} makes a difference |
846 inside a function or macro that you are going to compile. For example: | 847 inside a function or macro that you are going to compile. For example: |
847 | 848 |
848 @example | 849 @example |