diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-05-16 17:17:00 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-05-16 18:24:07 -0700 |
commit | 6ac2326e5bc4796087910eb429e0cb4384e0e0cf (patch) | |
tree | c9a3a32445d1a7dff31829d4efc8f3ed8dcc0c09 /doc/lispref/strings.texi | |
parent | b4937f64cd97ff6bf93538987c014f8ea8ff9d34 (diff) | |
download | emacs-6ac2326e5bc4796087910eb429e0cb4384e0e0cf.tar.gz |
Don’t use “constant” for values you shouldn’t change
Inspired by patch proposed by Dmitry Gutov (Bug#40671#393)
and by further comments by him and by Michael Heerdegen
in the same bug report.
* doc/lispintro/emacs-lisp-intro.texi (setcar):
Don’t push mutability here.
* doc/lispref/eval.texi (Self-Evaluating Forms, Quoting)
(Backquote):
* doc/lispref/lists.texi (Modifying Lists):
* doc/lispref/objects.texi (Lisp Data Types, Mutability):
* doc/lispref/sequences.texi (Array Functions, Vectors):
* doc/lispref/strings.texi (String Basics, Modifying Strings):
Don’t use the word “constant” to describe all values that
a program should not change.
* doc/lispref/objects.texi (Mutability):
Rename from “Constants and Mutability”. All uses changed.
In a footnote, contrast the Emacs behavior with that of Common
Lisp, Python, etc. for clarity, and say the goal is to be nicer.
Diffstat (limited to 'doc/lispref/strings.texi')
-rw-r--r-- | doc/lispref/strings.texi | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index a4c9c2549c5..70c3b3cf4be 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -49,10 +49,9 @@ by a distinguished character code. Since strings are arrays, and therefore sequences as well, you can operate on them with the general array and sequence functions documented -in @ref{Sequences Arrays Vectors}. For example, you can access or -change individual characters in a string using the functions @code{aref} -and @code{aset} (@pxref{Array Functions}). However, you should not -try to change the contents of constant strings (@pxref{Modifying Strings}). +in @ref{Sequences Arrays Vectors}. For example, you can access +individual characters in a string using the function @code{aref} +(@pxref{Array Functions}). There are two text representations for non-@acronym{ASCII} characters in Emacs strings (and in buffers): unibyte and multibyte. @@ -382,9 +381,7 @@ usual value is @w{@code{"[ \f\t\n\r\v]+"}}. @cindex string modification You can alter the contents of a mutable string via operations -described in this section. However, you should not try to use these -operations to alter the contents of a constant string. -@xref{Constants and Mutability}. +described in this section. @xref{Mutability}. The most basic way to alter the contents of an existing string is with @code{aset} (@pxref{Array Functions}). @code{(aset @var{string} |