diff options
| author | Leo Liu | 2014-05-21 11:49:58 +0800 |
|---|---|---|
| committer | Leo Liu | 2014-05-21 11:49:58 +0800 |
| commit | 254b7645f30f67abd00b773f2b0eac63d4c382dd (patch) | |
| tree | 30b7feb81da5fb54bceb4a06f6f020fd22bb70f1 /src | |
| parent | e619d93c227597bccc8b3d76ee8518fb20098bb1 (diff) | |
| download | emacs-254b7645f30f67abd00b773f2b0eac63d4c382dd.tar.gz emacs-254b7645f30f67abd00b773f2b0eac63d4c382dd.zip | |
* doc/lispref/sequences.texi (Sequence Functions): Update nreverse.
* src/fns.c (Fnreverse): Accept strings for SEQ and update doc-string.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/fns.c | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0ca3deaec9c..d6e21a777c2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2014-05-21 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * fns.c (Fnreverse): Accept strings for SEQ and update doc-string. | ||
| 4 | |||
| 1 | 2014-05-20 Michael Albinus <michael.albinus@gmx.de> | 5 | 2014-05-20 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 6 | ||
| 3 | * dbusbind.c (xd_signature): Revert last 2 patches. | 7 | * dbusbind.c (xd_signature): Revert last 2 patches. |
| @@ -1697,16 +1697,15 @@ changing the value of a sequence `foo'. */) | |||
| 1697 | } | 1697 | } |
| 1698 | 1698 | ||
| 1699 | DEFUN ("nreverse", Fnreverse, Snreverse, 1, 1, 0, | 1699 | DEFUN ("nreverse", Fnreverse, Snreverse, 1, 1, 0, |
| 1700 | doc: /* Reverse order of items in a list or vector SEQ. | 1700 | doc: /* Reverse order of items in a list, vector or string SEQ. |
| 1701 | If SEQ is a list, it should be nil-terminated, and reversed | 1701 | If SEQ is a list, it should be nil-terminated. |
| 1702 | by modifying cdr pointers. Return the reversed SEQ. | 1702 | This function may destructively modify SEQ to produce the value. */) |
| 1703 | |||
| 1704 | Note that unlike `reverse', this function doesn't work with strings. | ||
| 1705 | It is strongly encouraged to treat them as immutable. */) | ||
| 1706 | (Lisp_Object seq) | 1703 | (Lisp_Object seq) |
| 1707 | { | 1704 | { |
| 1708 | if (NILP (seq)) | 1705 | if (NILP (seq)) |
| 1709 | return seq; | 1706 | return seq; |
| 1707 | else if (STRINGP (seq)) | ||
| 1708 | return Freverse (seq); | ||
| 1710 | else if (CONSP (seq)) | 1709 | else if (CONSP (seq)) |
| 1711 | { | 1710 | { |
| 1712 | Lisp_Object prev, tail, next; | 1711 | Lisp_Object prev, tail, next; |