Mercurial > hg > xemacs-beta
comparison man/lispref/lists.texi @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | 8de8e3f6228a |
children | bc9eadea35cf |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
1 @c -*-texinfo-*- | 1 @c -*-texinfo-*- |
2 @c This is part of the XEmacs Lisp Reference Manual. | 2 @c This is part of the XEmacs Lisp Reference Manual. |
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. | 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. |
4 @c See the file lispref.texi for copying conditions. | 4 @c See the file lispref.texi for copying conditions. |
5 @setfilename ../../info/lists.info | 5 @setfilename ../../info/lists.info |
6 @node Lists, Sequences Arrays Vectors, Strings and Characters, Top | 6 @node Lists, Sequences Arrays Vectors, Strings and Characters, Top |
7 @chapter Lists | 7 @chapter Lists |
8 @cindex list | 8 @cindex list |
696 | 696 |
697 Changing the @sc{car} of a cons cell is done with @code{setcar}. When | 697 Changing the @sc{car} of a cons cell is done with @code{setcar}. When |
698 used on a list, @code{setcar} replaces one element of a list with a | 698 used on a list, @code{setcar} replaces one element of a list with a |
699 different element. | 699 different element. |
700 | 700 |
701 @defun setcar cons object | 701 @defun setcar cons-cell object |
702 This function stores @var{object} as the new @sc{car} of @var{cons}, | 702 This function stores @var{object} as the new @sc{car} of @var{cons-cell}, |
703 replacing its previous @sc{car}. It returns the value @var{object}. | 703 replacing its previous @sc{car}. It returns the value @var{object}. |
704 For example: | 704 For example: |
705 | 705 |
706 @example | 706 @example |
707 @group | 707 @group |
796 @node Setcdr | 796 @node Setcdr |
797 @subsection Altering the CDR of a List | 797 @subsection Altering the CDR of a List |
798 | 798 |
799 The lowest-level primitive for modifying a @sc{cdr} is @code{setcdr}: | 799 The lowest-level primitive for modifying a @sc{cdr} is @code{setcdr}: |
800 | 800 |
801 @defun setcdr cons object | 801 @defun setcdr cons-cell object |
802 This function stores @var{object} as the new @sc{cdr} of @var{cons}, | 802 This function stores @var{object} as the new @sc{cdr} of @var{cons-cell}, |
803 replacing its previous @sc{cdr}. It returns the value @var{object}. | 803 replacing its previous @sc{cdr}. It returns the value @var{object}. |
804 @end defun | 804 @end defun |
805 | 805 |
806 Here is an example of replacing the @sc{cdr} of a list with a | 806 Here is an example of replacing the @sc{cdr} of a list with a |
807 different list. All but the first element of the list are removed in | 807 different list. All but the first element of the list are removed in |
1596 @end menu | 1596 @end menu |
1597 | 1597 |
1598 @node Working With Normal Plists | 1598 @node Working With Normal Plists |
1599 @subsection Working With Normal Plists | 1599 @subsection Working With Normal Plists |
1600 | 1600 |
1601 @defun plist-get plist prop &optional default | 1601 @defun plist-get plist property &optional default |
1602 This function extracts a value from a property list. The function | 1602 This function extracts a value from a property list. The function |
1603 returns the value corresponding to the given @var{prop}, or | 1603 returns the value corresponding to the given @var{property}, or |
1604 @var{default} if @var{prop} is not one of the properties on the list. | 1604 @var{default} if @var{property} is not one of the properties on the list. |
1605 @end defun | 1605 @end defun |
1606 | 1606 |
1607 @defun plist-put plist prop val | 1607 @defun plist-put plist property value |
1608 This function changes the value in @var{plist} of @var{prop} to | 1608 This function changes the value in @var{plist} of @var{property} to |
1609 @var{val}. If @var{prop} is already a property on the list, its value is | 1609 @var{value}. If @var{property} is already a property on the list, its value is |
1610 set to @var{val}, otherwise the new @var{prop} @var{val} pair is added. | 1610 set to @var{value}, otherwise the new @var{property} @var{value} pair is added. |
1611 The new plist is returned; use @code{(setq x (plist-put x prop val))} to | 1611 The new plist is returned; use @code{(setq x (plist-put x property value))} to |
1612 be sure to use the new value. The @var{plist} is modified by side | 1612 be sure to use the new value. The @var{plist} is modified by side |
1613 effects. | 1613 effects. |
1614 @end defun | 1614 @end defun |
1615 | 1615 |
1616 @defun plist-remprop plist prop | 1616 @defun plist-remprop plist property |
1617 This function removes from @var{plist} the property @var{prop} and its | 1617 This function removes from @var{plist} the property @var{property} and its |
1618 value. The new plist is returned; use @code{(setq x (plist-remprop x | 1618 value. The new plist is returned; use @code{(setq x (plist-remprop x |
1619 prop val))} to be sure to use the new value. The @var{plist} is | 1619 property))} to be sure to use the new value. The @var{plist} is |
1620 modified by side effects. | 1620 modified by side effects. |
1621 @end defun | 1621 @end defun |
1622 | 1622 |
1623 @defun plist-member plist prop | 1623 @defun plist-member plist property |
1624 This function returns @code{t} if @var{prop} has a value specified in | 1624 This function returns @code{t} if @var{property} has a value specified in |
1625 @var{plist}. | 1625 @var{plist}. |
1626 @end defun | 1626 @end defun |
1627 | 1627 |
1628 In the following functions, if optional arg @var{nil-means-not-present} | 1628 In the following functions, if optional arg @var{nil-means-not-present} |
1629 is non-@code{nil}, then a property with a @code{nil} value is ignored or | 1629 is non-@code{nil}, then a property with a @code{nil} value is ignored or |
1655 @subsection Working With Lax Plists | 1655 @subsection Working With Lax Plists |
1656 | 1656 |
1657 Recall that a @dfn{lax plist} is a property list whose keys are compared | 1657 Recall that a @dfn{lax plist} is a property list whose keys are compared |
1658 using @code{equal} instead of @code{eq}. | 1658 using @code{equal} instead of @code{eq}. |
1659 | 1659 |
1660 @defun lax-plist-get lax-plist prop &optional default | 1660 @defun lax-plist-get lax-plist property &optional default |
1661 This function extracts a value from a lax property list. The function | 1661 This function extracts a value from a lax property list. The function |
1662 returns the value corresponding to the given @var{prop}, or | 1662 returns the value corresponding to the given @var{property}, or |
1663 @var{default} if @var{prop} is not one of the properties on the list. | 1663 @var{default} if @var{property} is not one of the properties on the list. |
1664 @end defun | 1664 @end defun |
1665 | 1665 |
1666 @defun lax-plist-put lax-plist prop val | 1666 @defun lax-plist-put lax-plist property value |
1667 This function changes the value in @var{lax-plist} of @var{prop} to @var{val}. | 1667 This function changes the value in @var{lax-plist} of @var{property} to @var{value}. |
1668 @end defun | 1668 @end defun |
1669 | 1669 |
1670 @defun lax-plist-remprop lax-plist prop | 1670 @defun lax-plist-remprop lax-plist property |
1671 This function removes from @var{lax-plist} the property @var{prop} and | 1671 This function removes from @var{lax-plist} the property @var{property} and |
1672 its value. The new plist is returned; use @code{(setq x | 1672 its value. The new plist is returned; use @code{(setq x |
1673 (lax-plist-remprop x prop val))} to be sure to use the new value. The | 1673 (lax-plist-remprop x property))} to be sure to use the new value. The |
1674 @var{lax-plist} is modified by side effects. | 1674 @var{lax-plist} is modified by side effects. |
1675 @end defun | 1675 @end defun |
1676 | 1676 |
1677 @defun lax-plist-member lax-plist prop | 1677 @defun lax-plist-member lax-plist property |
1678 This function returns @code{t} if @var{prop} has a value specified in | 1678 This function returns @code{t} if @var{property} has a value specified in |
1679 @var{lax-plist}. | 1679 @var{lax-plist}. |
1680 @end defun | 1680 @end defun |
1681 | 1681 |
1682 In the following functions, if optional arg @var{nil-means-not-present} | 1682 In the following functions, if optional arg @var{nil-means-not-present} |
1683 is non-@code{nil}, then a property with a @code{nil} value is ignored or | 1683 is non-@code{nil}, then a property with a @code{nil} value is ignored or |