comparison lispref/strings.texi @ 76040:e303881b06eb

(Text Comparison): Mention that assoc-string converts symbols to strings before testing.
author Kim F. Storm <storm@cua.dk>
date Wed, 21 Feb 2007 13:52:27 +0000
parents cc22dbc5d5a3
children cbba7c4947b7 dd7c098af727
comparison
equal deleted inserted replaced
76039:7765d3cb6a48 76040:e303881b06eb
533 portion) is less. 533 portion) is less.
534 @end defun 534 @end defun
535 535
536 @defun assoc-string key alist &optional case-fold 536 @defun assoc-string key alist &optional case-fold
537 This function works like @code{assoc}, except that @var{key} must be a 537 This function works like @code{assoc}, except that @var{key} must be a
538 string, and comparison is done using @code{compare-strings}. If 538 string or symbol, and comparison is done using @code{compare-strings}.
539 @var{case-fold} is non-@code{nil}, it ignores case differences. 539 Symbols are converted to strings before testing.
540 If @var{case-fold} is non-@code{nil}, it ignores case differences.
540 Unlike @code{assoc}, this function can also match elements of the alist 541 Unlike @code{assoc}, this function can also match elements of the alist
541 that are strings rather than conses. In particular, @var{alist} can 542 that are strings or symbols rather than conses. In particular, @var{alist} can
542 be a list of strings rather than an actual alist. 543 be a list of strings or symbols rather than an actual alist.
543 @xref{Association Lists}. 544 @xref{Association Lists}.
544 @end defun 545 @end defun
545 546
546 See also the @code{compare-buffer-substrings} function in 547 See also the @code{compare-buffer-substrings} function in
547 @ref{Comparing Text}, for a way to compare text in buffers. The 548 @ref{Comparing Text}, for a way to compare text in buffers. The