diff options
| author | Dmitry Antipov | 2014-05-15 10:01:46 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-05-15 10:01:46 +0400 |
| commit | c269148bf9a039edff92b1dd7a415d30c21d3087 (patch) | |
| tree | 00a599d3a6b51ddceb51faddce5ef704c6a74e3e /doc | |
| parent | b8e11d4102870e70dc50796454fcdae658caadbb (diff) | |
| download | emacs-c269148bf9a039edff92b1dd7a415d30c21d3087.tar.gz emacs-c269148bf9a039edff92b1dd7a415d30c21d3087.zip | |
* src/fns.c (Freverse): Allow vectors, bool vectors and strings.
* doc/lispref/lists.texi (Building Cons Cells and Lists): Remove
description of `reverse' and generalize it...
* doc/lispref/sequences.texi (Sequences): ...for sequences here.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/lispref/lists.texi | 19 | ||||
| -rw-r--r-- | doc/lispref/sequences.texi | 43 |
3 files changed, 49 insertions, 19 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index b62a4daa051..d5fe02d2398 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-05-15 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * lists.texi (Building Cons Cells and Lists): Remove | ||
| 4 | description of `reverse' and generalize it... | ||
| 5 | * sequences.texi (Sequences): ...for sequences here. | ||
| 6 | |||
| 1 | 2014-05-14 Glenn Morris <rgm@gnu.org> | 7 | 2014-05-14 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * files.texi (Changing Files): Mention with-file-modes. | 9 | * files.texi (Changing Files): Mention with-file-modes. |
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index cde7d9ce44c..882dd440491 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi | |||
| @@ -601,25 +601,6 @@ not a list, the sequence's elements do not become elements of the | |||
| 601 | resulting list. Instead, the sequence becomes the final @sc{cdr}, like | 601 | resulting list. Instead, the sequence becomes the final @sc{cdr}, like |
| 602 | any other non-list final argument. | 602 | any other non-list final argument. |
| 603 | 603 | ||
| 604 | @defun reverse list | ||
| 605 | This function creates a new list whose elements are the elements of | ||
| 606 | @var{list}, but in reverse order. The original argument @var{list} is | ||
| 607 | @emph{not} altered. | ||
| 608 | |||
| 609 | @example | ||
| 610 | @group | ||
| 611 | (setq x '(1 2 3 4)) | ||
| 612 | @result{} (1 2 3 4) | ||
| 613 | @end group | ||
| 614 | @group | ||
| 615 | (reverse x) | ||
| 616 | @result{} (4 3 2 1) | ||
| 617 | x | ||
| 618 | @result{} (1 2 3 4) | ||
| 619 | @end group | ||
| 620 | @end example | ||
| 621 | @end defun | ||
| 622 | |||
| 623 | @defun copy-tree tree &optional vecp | 604 | @defun copy-tree tree &optional vecp |
| 624 | This function returns a copy of the tree @code{tree}. If @var{tree} is a | 605 | This function returns a copy of the tree @code{tree}. If @var{tree} is a |
| 625 | cons cell, this makes a new cons cell with the same @sc{car} and | 606 | cons cell, this makes a new cons cell with the same @sc{car} and |
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 01de4ccb0cd..c96f1222f3f 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi | |||
| @@ -217,6 +217,49 @@ y @result{} [foo (69 2)] | |||
| 217 | @end example | 217 | @end example |
| 218 | @end defun | 218 | @end defun |
| 219 | 219 | ||
| 220 | @defun reverse seq | ||
| 221 | @cindex string reverse | ||
| 222 | @cindex list reverse | ||
| 223 | @cindex vector reverse | ||
| 224 | @cindex sequence reverse | ||
| 225 | This function creates a new sequence whose elements are the elements | ||
| 226 | of @var{seq}, but in reverse order. The original argument @var{seq} | ||
| 227 | is @emph{not} altered. Note that char-table cannot be reversed. | ||
| 228 | |||
| 229 | @example | ||
| 230 | @group | ||
| 231 | (setq x '(1 2 3 4)) | ||
| 232 | @result{} (1 2 3 4) | ||
| 233 | @end group | ||
| 234 | @group | ||
| 235 | (reverse x) | ||
| 236 | @result{} (4 3 2 1) | ||
| 237 | x | ||
| 238 | @result{} (1 2 3 4) | ||
| 239 | @end group | ||
| 240 | @group | ||
| 241 | (setq x [1 2 3 4]) | ||
| 242 | @result{} [1 2 3 4] | ||
| 243 | @end group | ||
| 244 | @group | ||
| 245 | (reverse x) | ||
| 246 | @result{} [4 3 2 1] | ||
| 247 | x | ||
| 248 | @result{} [1 2 3 4] | ||
| 249 | @end group | ||
| 250 | @group | ||
| 251 | (setq x "xyzzy") | ||
| 252 | @result{} "xyzzy" | ||
| 253 | @end group | ||
| 254 | @group | ||
| 255 | (reverse x) | ||
| 256 | @result{} "yzzyx" | ||
| 257 | x | ||
| 258 | @result{} "xyzzy" | ||
| 259 | @end group | ||
| 260 | @end example | ||
| 261 | @end defun | ||
| 262 | |||
| 220 | @node Arrays | 263 | @node Arrays |
| 221 | @section Arrays | 264 | @section Arrays |
| 222 | @cindex array | 265 | @cindex array |