aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGlenn Morris2012-11-03 10:56:30 -0700
committerGlenn Morris2012-11-03 10:56:30 -0700
commit685b00269debcb77f533f65ba5e6421d8539229d (patch)
tree27151c7c52ab67a2f97eefa1586fe1efcd029ce0 /doc
parent77f6eafecaee05fcd62b03f7c7d01961bcd31ec8 (diff)
downloademacs-685b00269debcb77f533f65ba5e6421d8539229d.tar.gz
emacs-685b00269debcb77f533f65ba5e6421d8539229d.zip
Further edits for doc/misc/cl.texi
* cl.texi: Further general copyedits. (List Functions): Remove copy-tree, standard elisp for some time. (Efficiency Concerns): Comment out examples that no longer apply. (Compiler Optimizations): Rename from "Optimizing Compiler"; reword.
Diffstat (limited to 'doc')
-rw-r--r--doc/misc/ChangeLog3
-rw-r--r--doc/misc/cl.texi111
2 files changed, 52 insertions, 62 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 39d7ee8d1fc..6bd601bef5d 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,6 +1,9 @@
12012-11-03 Glenn Morris <rgm@gnu.org> 12012-11-03 Glenn Morris <rgm@gnu.org>
2 2
3 * cl.texi: Further general copyedits. 3 * cl.texi: Further general copyedits.
4 (List Functions): Remove copy-tree, standard elisp for some time.
5 (Efficiency Concerns): Comment out examples that no longer apply.
6 (Compiler Optimizations): Rename from "Optimizing Compiler"; reword.
4 7
52012-11-02 Glenn Morris <rgm@gnu.org> 82012-11-02 Glenn Morris <rgm@gnu.org>
6 9
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 66d25144dd6..593985edbfc 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -2867,6 +2867,7 @@ temporary variables.
2867This function creates a new, uninterned symbol (using @code{make-symbol}) 2867This function creates a new, uninterned symbol (using @code{make-symbol})
2868with a unique name. (The name of an uninterned symbol is relevant 2868with a unique name. (The name of an uninterned symbol is relevant
2869only if the symbol is printed.) By default, the name is generated 2869only if the symbol is printed.) By default, the name is generated
2870@c FIXME no longer true?
2870from an increasing sequence of numbers, @samp{G1000}, @samp{G1001}, 2871from an increasing sequence of numbers, @samp{G1000}, @samp{G1001},
2871@samp{G1002}, etc. If the optional argument @var{x} is a string, that 2872@samp{G1002}, etc. If the optional argument @var{x} is a string, that
2872string is used as a prefix instead of @samp{G}. Uninterned symbols 2873string is used as a prefix instead of @samp{G}. Uninterned symbols
@@ -3207,7 +3208,7 @@ may appear in any order.
3207The @code{:key} argument should be passed either @code{nil}, or a 3208The @code{:key} argument should be passed either @code{nil}, or a
3208function of one argument. This key function is used as a filter 3209function of one argument. This key function is used as a filter
3209through which the elements of the sequence are seen; for example, 3210through which the elements of the sequence are seen; for example,
3210@code{(cl-find x y :key 'car)} is similar to @code{(cl-assoc x y)}: 3211@code{(cl-find x y :key 'car)} is similar to @code{(cl-assoc x y)}.
3211It searches for an element of the list whose @sc{car} equals 3212It searches for an element of the list whose @sc{car} equals
3212@code{x}, rather than for an element which equals @code{x} itself. 3213@code{x}, rather than for an element which equals @code{x} itself.
3213If @code{:key} is omitted or @code{nil}, the filter is effectively 3214If @code{:key} is omitted or @code{nil}, the filter is effectively
@@ -3225,7 +3226,7 @@ true (non-@code{nil}) to indicate a match; instead, you may use
3225@code{:test-not} to give a function which returns @emph{false} to 3226@code{:test-not} to give a function which returns @emph{false} to
3226indicate a match. The default test function is @code{eql}. 3227indicate a match. The default test function is @code{eql}.
3227 3228
3228Many functions which take @var{item} and @code{:test} or @code{:test-not} 3229Many functions that take @var{item} and @code{:test} or @code{:test-not}
3229arguments also come in @code{-if} and @code{-if-not} varieties, 3230arguments also come in @code{-if} and @code{-if-not} varieties,
3230where a @var{predicate} function is passed instead of @var{item}, 3231where a @var{predicate} function is passed instead of @var{item},
3231and sequence elements match if the predicate returns true on them 3232and sequence elements match if the predicate returns true on them
@@ -3239,7 +3240,7 @@ and sequence elements match if the predicate returns true on them
3239to remove all zeros from sequence @code{seq}. 3240to remove all zeros from sequence @code{seq}.
3240 3241
3241Some operations can work on a subsequence of the argument sequence; 3242Some operations can work on a subsequence of the argument sequence;
3242these function take @code{:start} and @code{:end} arguments which 3243these function take @code{:start} and @code{:end} arguments, which
3243default to zero and the length of the sequence, respectively. 3244default to zero and the length of the sequence, respectively.
3244Only elements between @var{start} (inclusive) and @var{end} 3245Only elements between @var{start} (inclusive) and @var{end}
3245(exclusive) are affected by the operation. The @var{end} argument 3246(exclusive) are affected by the operation. The @var{end} argument
@@ -3347,7 +3348,7 @@ the return values using @code{nconc}.
3347@defun cl-some predicate seq &rest more-seqs 3348@defun cl-some predicate seq &rest more-seqs
3348This function calls @var{predicate} on each element of @var{seq} 3349This function calls @var{predicate} on each element of @var{seq}
3349in turn; if @var{predicate} returns a non-@code{nil} value, 3350in turn; if @var{predicate} returns a non-@code{nil} value,
3350@code{some} returns that value, otherwise it returns @code{nil}. 3351@code{cl-some} returns that value, otherwise it returns @code{nil}.
3351Given several sequence arguments, it steps through the sequences 3352Given several sequence arguments, it steps through the sequences
3352in parallel until the shortest one runs out, just as in 3353in parallel until the shortest one runs out, just as in
3353@code{cl-mapcar}. You can rely on the left-to-right order in which 3354@code{cl-mapcar}. You can rely on the left-to-right order in which
@@ -3396,7 +3397,7 @@ of left-associative:
3396 @equiv{} (- 1 (- 2 (- 3 4))) @result{} -2 3397 @equiv{} (- 1 (- 2 (- 3 4))) @result{} -2
3397@end example 3398@end example
3398 3399
3399If @code{:key} is specified, it is a function of one argument which 3400If @code{:key} is specified, it is a function of one argument, which
3400is called on each of the sequence elements in turn. 3401is called on each of the sequence elements in turn.
3401 3402
3402If @code{:initial-value} is specified, it is effectively added to the 3403If @code{:initial-value} is specified, it is effectively added to the
@@ -3465,7 +3466,7 @@ of data copied is simply the shorter of the source and destination
3465If @var{seq1} and @var{seq2} are @code{eq}, then the replacement 3466If @var{seq1} and @var{seq2} are @code{eq}, then the replacement
3466will work correctly even if the regions indicated by the start 3467will work correctly even if the regions indicated by the start
3467and end arguments overlap. However, if @var{seq1} and @var{seq2} 3468and end arguments overlap. However, if @var{seq1} and @var{seq2}
3468are lists which share storage but are not @code{eq}, and the 3469are lists that share storage but are not @code{eq}, and the
3469start and end arguments specify overlapping regions, the effect 3470start and end arguments specify overlapping regions, the effect
3470is undefined. 3471is undefined.
3471@end defun 3472@end defun
@@ -3488,7 +3489,7 @@ if @var{count} was also specified).
3488@end defun 3489@end defun
3489 3490
3490@defun cl-delete item seq @t{&key :test :test-not :key :count :start :end :from-end} 3491@defun cl-delete item seq @t{&key :test :test-not :key :count :start :end :from-end}
3491This deletes all elements of @var{seq} which match @var{item}. 3492This deletes all elements of @var{seq} that match @var{item}.
3492It is a destructive operation. Since Emacs Lisp does not support 3493It is a destructive operation. Since Emacs Lisp does not support
3493stretchable strings or vectors, this is the same as @code{cl-remove} 3494stretchable strings or vectors, this is the same as @code{cl-remove}
3494for those sequence types. On lists, @code{cl-remove} will copy the 3495for those sequence types. On lists, @code{cl-remove} will copy the
@@ -3588,7 +3589,7 @@ elements match (according to @code{:test}, @code{:test-not},
3588and @code{:key}), the function returns @code{nil}. If there is 3589and @code{:key}), the function returns @code{nil}. If there is
3589a mismatch, the function returns the index (relative to @var{seq1}) 3590a mismatch, the function returns the index (relative to @var{seq1})
3590of the first mismatching element. This will be the leftmost pair of 3591of the first mismatching element. This will be the leftmost pair of
3591elements which do not match, or the position at which the shorter of 3592elements that do not match, or the position at which the shorter of
3592the two otherwise-matching sequences runs out. 3593the two otherwise-matching sequences runs out.
3593 3594
3594If @code{:from-end} is true, then the elements are compared from right 3595If @code{:from-end} is true, then the elements are compared from right
@@ -3603,7 +3604,7 @@ which compares two strings case-insensitively.
3603@defun cl-search seq1 seq2 @t{&key :test :test-not :key :from-end :start1 :end1 :start2 :end2} 3604@defun cl-search seq1 seq2 @t{&key :test :test-not :key :from-end :start1 :end1 :start2 :end2}
3604This function searches @var{seq2} for a subsequence that matches 3605This function searches @var{seq2} for a subsequence that matches
3605@var{seq1} (or part of it specified by @code{:start1} and 3606@var{seq1} (or part of it specified by @code{:start1} and
3606@code{:end1}.) Only matches which fall entirely within the region 3607@code{:end1}). Only matches that fall entirely within the region
3607defined by @code{:start2} and @code{:end2} will be considered. 3608defined by @code{:start2} and @code{:end2} will be considered.
3608The return value is the index of the leftmost element of the 3609The return value is the index of the leftmost element of the
3609leftmost match, relative to the start of @var{seq2}, or @code{nil} 3610leftmost match, relative to the start of @var{seq2}, or @code{nil}
@@ -3614,7 +3615,7 @@ function finds the @emph{rightmost} matching subsequence.
3614@node Sorting Sequences 3615@node Sorting Sequences
3615@section Sorting Sequences 3616@section Sorting Sequences
3616 3617
3617@defun clsort seq predicate @t{&key :key} 3618@defun cl-sort seq predicate @t{&key :key}
3618This function sorts @var{seq} into increasing order as determined 3619This function sorts @var{seq} into increasing order as determined
3619by using @var{predicate} to compare pairs of elements. @var{predicate} 3620by using @var{predicate} to compare pairs of elements. @var{predicate}
3620should return true (non-@code{nil}) if and only if its first argument 3621should return true (non-@code{nil}) if and only if its first argument
@@ -3625,7 +3626,7 @@ numbers into decreasing rather than increasing order.
3625 3626
3626This function differs from Emacs's built-in @code{sort} in that it 3627This function differs from Emacs's built-in @code{sort} in that it
3627can operate on any type of sequence, not just lists. Also, it 3628can operate on any type of sequence, not just lists. Also, it
3628accepts a @code{:key} argument which is used to preprocess data 3629accepts a @code{:key} argument, which is used to preprocess data
3629fed to the @var{predicate} function. For example, 3630fed to the @var{predicate} function. For example,
3630 3631
3631@example 3632@example
@@ -3636,7 +3637,7 @@ fed to the @var{predicate} function. For example,
3636sorts @var{data}, a sequence of strings, into increasing alphabetical 3637sorts @var{data}, a sequence of strings, into increasing alphabetical
3637order without regard to case. A @code{:key} function of @code{car} 3638order without regard to case. A @code{:key} function of @code{car}
3638would be useful for sorting association lists. It should only be a 3639would be useful for sorting association lists. It should only be a
3639simple accessor though, it's used heavily in the current 3640simple accessor though, since it's used heavily in the current
3640implementation. 3641implementation.
3641 3642
3642The @code{cl-sort} function is destructive; it sorts lists by actually 3643The @code{cl-sort} function is destructive; it sorts lists by actually
@@ -3692,7 +3693,7 @@ i.e., chains of cons cells.
3692 3693
3693@defun cl-caddr x 3694@defun cl-caddr x
3694This function is equivalent to @code{(car (cdr (cdr @var{x})))}. 3695This function is equivalent to @code{(car (cdr (cdr @var{x})))}.
3695Likewise, this package defines all 28 @code{c@var{xxx}r} functions 3696Likewise, this package defines all 24 @code{c@var{xxx}r} functions
3696where @var{xxx} is up to four @samp{a}s and/or @samp{d}s. 3697where @var{xxx} is up to four @samp{a}s and/or @samp{d}s.
3697All of these functions are @code{setf}-able, and calls to them 3698All of these functions are @code{setf}-able, and calls to them
3698are expanded inline by the byte-compiler for maximum efficiency. 3699are expanded inline by the byte-compiler for maximum efficiency.
@@ -3720,7 +3721,8 @@ This function returns the length of list @var{x}, exactly like
3720@code{(length @var{x})}, except that if @var{x} is a circular 3721@code{(length @var{x})}, except that if @var{x} is a circular
3721list (where the @sc{cdr}-chain forms a loop rather than terminating 3722list (where the @sc{cdr}-chain forms a loop rather than terminating
3722with @code{nil}), this function returns @code{nil}. (The regular 3723with @code{nil}), this function returns @code{nil}. (The regular
3723@code{length} function would get stuck if given a circular list.) 3724@code{length} function would get stuck if given a circular list.
3725See also the @code{safe-length} function.)
3724@end defun 3726@end defun
3725 3727
3726@defun cl-list* arg &rest others 3728@defun cl-list* arg &rest others
@@ -3748,18 +3750,6 @@ This function returns a copy of the list @var{list}. It copies
3748dotted lists like @code{(1 2 . 3)} correctly. 3750dotted lists like @code{(1 2 . 3)} correctly.
3749@end defun 3751@end defun
3750 3752
3751@defun copy-tree x &optional vecp
3752This function returns a copy of the tree of cons cells @var{x}.
3753@c FIXME? cl-copy-list is not an alias of copy-sequence.
3754Unlike @code{copy-sequence} (and its alias @code{cl-copy-list}),
3755which copies only along the @sc{cdr} direction, this function
3756copies (recursively) along both the @sc{car} and the @sc{cdr}
3757directions. If @var{x} is not a cons cell, the function simply
3758returns @var{x} unchanged. If the optional @var{vecp} argument
3759is true, this function copies vectors (recursively) as well as
3760cons cells.
3761@end defun
3762
3763@defun cl-tree-equal x y @t{&key :test :test-not :key} 3753@defun cl-tree-equal x y @t{&key :test :test-not :key}
3764This function compares two trees of cons cells. If @var{x} and 3754This function compares two trees of cons cells. If @var{x} and
3765@var{y} are both cons cells, their @sc{car}s and @sc{cdr}s are 3755@var{y} are both cons cells, their @sc{car}s and @sc{cdr}s are
@@ -3822,7 +3812,7 @@ This is a destructive version of @code{cl-sublis}.
3822@section Lists as Sets 3812@section Lists as Sets
3823 3813
3824@noindent 3814@noindent
3825These functions perform operations on lists which represent sets 3815These functions perform operations on lists that represent sets
3826of elements. 3816of elements.
3827 3817
3828@defun cl-member item list @t{&key :test :test-not :key} 3818@defun cl-member item list @t{&key :test :test-not :key}
@@ -3835,13 +3825,14 @@ are compared by @code{eql} by default; you can use the @code{:test},
3835 3825
3836The standard Emacs lisp function @code{member} uses @code{equal} for 3826The standard Emacs lisp function @code{member} uses @code{equal} for
3837comparisons; it is equivalent to @code{(cl-member @var{item} @var{list} 3827comparisons; it is equivalent to @code{(cl-member @var{item} @var{list}
3838:test 'equal)}. 3828:test 'equal)}. With no keyword arguments, @code{cl-member} is
3829equivalent to @code{memq}.
3839@end defun 3830@end defun
3840 3831
3841@findex cl-member-if 3832@findex cl-member-if
3842@findex cl-member-if-not 3833@findex cl-member-if-not
3843The @code{cl-member-if} and @code{cl-member-if-not} functions 3834The @code{cl-member-if} and @code{cl-member-if-not} functions
3844analogously search for elements which satisfy a given predicate. 3835analogously search for elements that satisfy a given predicate.
3845 3836
3846@defun cl-tailp sublist list 3837@defun cl-tailp sublist list
3847This function returns @code{t} if @var{sublist} is a sublist of 3838This function returns @code{t} if @var{sublist} is a sublist of
@@ -3860,11 +3851,11 @@ become part of the list.
3860@end defun 3851@end defun
3861 3852
3862@defun cl-union list1 list2 @t{&key :test :test-not :key} 3853@defun cl-union list1 list2 @t{&key :test :test-not :key}
3863This function combines two lists which represent sets of items, 3854This function combines two lists that represent sets of items,
3864returning a list that represents the union of those two sets. 3855returning a list that represents the union of those two sets.
3865The result list will contain all items which appear in @var{list1} 3856The resulting list contains all items that appear in @var{list1}
3866or @var{list2}, and no others. If an item appears in both 3857or @var{list2}, and no others. If an item appears in both
3867@var{list1} and @var{list2} it will be copied only once. If 3858@var{list1} and @var{list2} it is copied only once. If
3868an item is duplicated in @var{list1} or @var{list2}, it is 3859an item is duplicated in @var{list1} or @var{list2}, it is
3869undefined whether or not that duplication will survive in the 3860undefined whether or not that duplication will survive in the
3870result list. The order of elements in the result list is also 3861result list. The order of elements in the result list is also
@@ -3879,7 +3870,7 @@ it tries to reuse the storage of the argument lists if possible.
3879@defun cl-intersection list1 list2 @t{&key :test :test-not :key} 3870@defun cl-intersection list1 list2 @t{&key :test :test-not :key}
3880This function computes the intersection of the sets represented 3871This function computes the intersection of the sets represented
3881by @var{list1} and @var{list2}. It returns the list of items 3872by @var{list1} and @var{list2}. It returns the list of items
3882which appear in both @var{list1} and @var{list2}. 3873that appear in both @var{list1} and @var{list2}.
3883@end defun 3874@end defun
3884 3875
3885@defun cl-nintersection list1 list2 @t{&key :test :test-not :key} 3876@defun cl-nintersection list1 list2 @t{&key :test :test-not :key}
@@ -3929,7 +3920,7 @@ This function searches the association list @var{a-list} for an
3929element whose @sc{car} matches (in the sense of @code{:test}, 3920element whose @sc{car} matches (in the sense of @code{:test},
3930@code{:test-not}, and @code{:key}, or by comparison with @code{eql}) 3921@code{:test-not}, and @code{:key}, or by comparison with @code{eql})
3931a given @var{item}. It returns the matching element, if any, 3922a given @var{item}. It returns the matching element, if any,
3932otherwise @code{nil}. It ignores elements of @var{a-list} which 3923otherwise @code{nil}. It ignores elements of @var{a-list} that
3933are not cons cells. (This corresponds to the behavior of 3924are not cons cells. (This corresponds to the behavior of
3934@code{assq} and @code{assoc} in Emacs Lisp; Common Lisp's 3925@code{assq} and @code{assoc} in Emacs Lisp; Common Lisp's
3935@code{assoc} ignores @code{nil}s but considers any other non-cons 3926@code{assoc} ignores @code{nil}s but considers any other non-cons
@@ -3990,11 +3981,11 @@ are symbols. For example,
3990@end example 3981@end example
3991 3982
3992@noindent 3983@noindent
3993defines a struct type called @code{person} which contains three 3984defines a struct type called @code{person} that contains three
3994slots. Given a @code{person} object @var{p}, you can access those 3985slots. Given a @code{person} object @var{p}, you can access those
3995slots by calling @code{(person-name @var{p})}, @code{(person-age @var{p})}, 3986slots by calling @code{(person-name @var{p})}, @code{(person-age @var{p})},
3996and @code{(person-sex @var{p})}. You can also change these slots by 3987and @code{(person-sex @var{p})}. You can also change these slots by
3997using @code{setf} on any of these place forms: 3988using @code{setf} on any of these place forms, for example:
3998 3989
3999@example 3990@example
4000(cl-incf (person-age birthday-boy)) 3991(cl-incf (person-age birthday-boy))
@@ -4011,10 +4002,10 @@ Given a @code{person}, @code{(copy-person @var{p})} makes a new
4011object of the same type whose slots are @code{eq} to those of @var{p}. 4002object of the same type whose slots are @code{eq} to those of @var{p}.
4012 4003
4013Given any Lisp object @var{x}, @code{(person-p @var{x})} returns 4004Given any Lisp object @var{x}, @code{(person-p @var{x})} returns
4014true if @var{x} looks like a @code{person}, false otherwise. (Again, 4005true if @var{x} looks like a @code{person}, and false otherwise. (Again,
4015in Common Lisp this predicate would be exact; in Emacs Lisp the 4006in Common Lisp this predicate would be exact; in Emacs Lisp the
4016best it can do is verify that @var{x} is a vector of the correct 4007best it can do is verify that @var{x} is a vector of the correct
4017length which starts with the correct tag symbol.) 4008length that starts with the correct tag symbol.)
4018 4009
4019Accessors like @code{person-name} normally check their arguments 4010Accessors like @code{person-name} normally check their arguments
4020(effectively using @code{person-p}) and signal an error if the 4011(effectively using @code{person-p}) and signal an error if the
@@ -4051,7 +4042,7 @@ In general, @var{name} is either a name symbol or a list of a name
4051symbol followed by any number of @dfn{struct options}; each @var{slot} 4042symbol followed by any number of @dfn{struct options}; each @var{slot}
4052is either a slot symbol or a list of the form @samp{(@var{slot-name} 4043is either a slot symbol or a list of the form @samp{(@var{slot-name}
4053@var{default-value} @var{slot-options}@dots{})}. The @var{default-value} 4044@var{default-value} @var{slot-options}@dots{})}. The @var{default-value}
4054is a Lisp form which is evaluated any time an instance of the 4045is a Lisp form that is evaluated any time an instance of the
4055structure type is created without specifying that slot's value. 4046structure type is created without specifying that slot's value.
4056 4047
4057Common Lisp defines several slot options, but the only one 4048Common Lisp defines several slot options, but the only one
@@ -4109,11 +4100,11 @@ The argument names should match the slot names; each slot is
4109initialized from the corresponding argument. Slots whose names 4100initialized from the corresponding argument. Slots whose names
4110do not appear in the argument list are initialized based on the 4101do not appear in the argument list are initialized based on the
4111@var{default-value} in their slot descriptor. Also, @code{&optional} 4102@var{default-value} in their slot descriptor. Also, @code{&optional}
4112and @code{&key} arguments which don't specify defaults take their 4103and @code{&key} arguments that don't specify defaults take their
4113defaults from the slot descriptor. It is valid to include arguments 4104defaults from the slot descriptor. It is valid to include arguments
4114which don't correspond to slot names; these are useful if they are 4105that don't correspond to slot names; these are useful if they are
4115referred to in the defaults for optional, keyword, or @code{&aux} 4106referred to in the defaults for optional, keyword, or @code{&aux}
4116arguments which @emph{do} correspond to slots. 4107arguments that @emph{do} correspond to slots.
4117 4108
4118You can specify any number of full-format @code{:constructor} 4109You can specify any number of full-format @code{:constructor}
4119options on a structure. The default constructor is still generated 4110options on a structure. The default constructor is still generated
@@ -4154,7 +4145,7 @@ means not to generate a copier function. (In this implementation,
4154all copier functions are simply synonyms for @code{copy-sequence}.) 4145all copier functions are simply synonyms for @code{copy-sequence}.)
4155 4146
4156@item :predicate 4147@item :predicate
4157The argument is an alternate name for the predicate which recognizes 4148The argument is an alternate name for the predicate that recognizes
4158objects of this type. The default is @code{@var{name}-p}. @code{nil} 4149objects of this type. The default is @code{@var{name}-p}. @code{nil}
4159means not to generate a predicate function. (If the @code{:type} 4150means not to generate a predicate function. (If the @code{:type}
4160option is used without the @code{:named} option, no predicate is 4151option is used without the @code{:named} option, no predicate is
@@ -4214,7 +4205,7 @@ work on astronauts just like other people.
4214 4205
4215@item :print-function 4206@item :print-function
4216In full Common Lisp, this option allows you to specify a function 4207In full Common Lisp, this option allows you to specify a function
4217which is called to print an instance of the structure type. The 4208that is called to print an instance of the structure type. The
4218Emacs Lisp system offers no hooks into the Lisp printer which would 4209Emacs Lisp system offers no hooks into the Lisp printer which would
4219allow for such a feature, so this package simply ignores 4210allow for such a feature, so this package simply ignores
4220@code{:print-function}. 4211@code{:print-function}.
@@ -4391,7 +4382,7 @@ You can find out how a macro expands by using the
4391This function takes a single Lisp form as an argument and inserts 4382This function takes a single Lisp form as an argument and inserts
4392a nicely formatted copy of it in the current buffer (which must be 4383a nicely formatted copy of it in the current buffer (which must be
4393in Lisp mode so that indentation works properly). It also expands 4384in Lisp mode so that indentation works properly). It also expands
4394all Lisp macros which appear in the form. The easiest way to use 4385all Lisp macros that appear in the form. The easiest way to use
4395this function is to go to the @file{*scratch*} buffer and type, say, 4386this function is to go to the @file{*scratch*} buffer and type, say,
4396 4387
4397@example 4388@example
@@ -4400,7 +4391,7 @@ this function is to go to the @file{*scratch*} buffer and type, say,
4400 4391
4401@noindent 4392@noindent
4402and type @kbd{C-x C-e} immediately after the closing parenthesis; 4393and type @kbd{C-x C-e} immediately after the closing parenthesis;
4403the expansion 4394an expansion similar to:
4404 4395
4405@example 4396@example
4406(cl-block nil 4397(cl-block nil
@@ -4421,7 +4412,11 @@ variable @code{G1004} was created by @code{cl-gensym}.)
4421If the optional argument @var{full} is true, then @emph{all} 4412If the optional argument @var{full} is true, then @emph{all}
4422macros are expanded, including @code{cl-block}, @code{cl-eval-when}, 4413macros are expanded, including @code{cl-block}, @code{cl-eval-when},
4423and compiler macros. Expansion is done as if @var{form} were 4414and compiler macros. Expansion is done as if @var{form} were
4424a top-level form in a file being compiled. For example, 4415a top-level form in a file being compiled.
4416
4417@c FIXME none of these examples are still applicable.
4418@ignore
4419For example,
4425 4420
4426@example 4421@example
4427(cl-prettyexpand '(cl-pushnew 'x list)) 4422(cl-prettyexpand '(cl-pushnew 'x list))
@@ -4431,16 +4426,12 @@ a top-level form in a file being compiled. For example,
4431(cl-prettyexpand '(caddr (cl-member 'a list)) t) 4426(cl-prettyexpand '(caddr (cl-member 'a list)) t)
4432 @print{} (car (cdr (cdr (memq 'a list)))) 4427 @print{} (car (cdr (cdr (memq 'a list))))
4433@end example 4428@end example
4429@end ignore
4434 4430
4435Note that @code{cl-adjoin}, @code{cl-caddr}, and @code{cl-member} all 4431Note that @code{cl-adjoin}, @code{cl-caddr}, and @code{cl-member} all
4436have built-in compiler macros to optimize them in common cases. 4432have built-in compiler macros to optimize them in common cases.
4437@end defun 4433@end defun
4438 4434
4439@ifinfo
4440@example
4441
4442@end example
4443@end ifinfo
4444@appendixsec Error Checking 4435@appendixsec Error Checking
4445 4436
4446@noindent 4437@noindent
@@ -4450,7 +4441,7 @@ where substantial gains were possible at the expense of marginal
4450incompatibility. 4441incompatibility.
4451 4442
4452The Common Lisp standard (as embodied in Steele's book) uses the 4443The Common Lisp standard (as embodied in Steele's book) uses the
4453phrase ``it is an error if'' to indicate a situation which is not 4444phrase ``it is an error if'' to indicate a situation that is not
4454supposed to arise in complying programs; implementations are strongly 4445supposed to arise in complying programs; implementations are strongly
4455encouraged but not required to signal an error in these situations. 4446encouraged but not required to signal an error in these situations.
4456This package sometimes omits such error checking in the interest of 4447This package sometimes omits such error checking in the interest of
@@ -4472,20 +4463,16 @@ you can use @code{&allow-other-keys} to omit this check. Functions
4472defined in this package such as @code{cl-find} and @code{cl-member} 4463defined in this package such as @code{cl-find} and @code{cl-member}
4473do check their keyword arguments for validity. 4464do check their keyword arguments for validity.
4474 4465
4475@ifinfo 4466@appendixsec Compiler Optimizations
4476@example
4477
4478@end example
4479@end ifinfo
4480@appendixsec Optimizing Compiler
4481 4467
4482@noindent 4468@noindent
4483Use of the optimizing Emacs compiler is highly recommended; many of the Common 4469Changing the value of @code{byte-optimize} from the default @code{t}
4470is highly discouraged; many of the Common
4484Lisp macros emit 4471Lisp macros emit
4485code which can be improved by optimization. In particular, 4472code that can be improved by optimization. In particular,
4486@code{cl-block}s (whether explicit or implicit in constructs like 4473@code{cl-block}s (whether explicit or implicit in constructs like
4487@code{cl-defun} and @code{cl-loop}) carry a fair run-time penalty; the 4474@code{cl-defun} and @code{cl-loop}) carry a fair run-time penalty; the
4488byte-compiler removes @code{cl-block}s which are not actually 4475byte-compiler removes @code{cl-block}s that are not actually
4489referenced by @code{cl-return} or @code{cl-return-from} inside the block. 4476referenced by @code{cl-return} or @code{cl-return-from} inside the block.
4490 4477
4491@node Common Lisp Compatibility 4478@node Common Lisp Compatibility