[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 0272e8b 017/316: [Fix #158] -map-last does not mod
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash 0272e8b 017/316: [Fix #158] -map-last does not modify input list. |
Date: |
Mon, 15 Feb 2021 15:57:16 -0500 (EST) |
branch: externals/dash
commit 0272e8b1261344070ec4fc84921b1fb086e4d8f9
Author: Matus Goljer <matus.goljer@gmail.com>
Commit: Matus Goljer <matus.goljer@gmail.com>
[Fix #158] -map-last does not modify input list.
---
dash.el | 2 +-
dev/examples.el | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dash.el b/dash.el
index 3f20e5c..f310563 100644
--- a/dash.el
+++ b/dash.el
@@ -361,7 +361,7 @@ See also: `-map-when', `-replace-first'"
"Replace first item in LIST satisfying PRED with result of REP called on
this item.
See also: `-map-when', `-replace-last'"
- (nreverse (-map-first pred rep (nreverse list))))
+ (nreverse (-map-first pred rep (reverse list))))
(defmacro --map-last (pred rep list)
"Anaphoric form of `-map-last'."
diff --git a/dev/examples.el b/dev/examples.el
index 6377e69..06bc58f 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -69,6 +69,9 @@ new list."
(-map-last 'even? 'square '(1 2 3 4)) => '(1 2 3 16)
(--map-last (> it 2) (* it it) '(1 2 3 4)) => '(1 2 3 16)
(--map-last (= it 2) 17 '(1 2 3 2)) => '(1 2 3 17)
+ ;; the next two tests assert that the input list is not modified #158
+ (let ((l '(1 2 3))) (list (--map-last (< it 2) (number-to-string it) l)
l)) => '(("1" 2 3) (1 2 3))
+ (let ((l '(1 2 3))) (list (--map-last (< it 3) (number-to-string it) l)
l)) => '((1 "2" 3) (1 2 3))
(-map-last 'even? 'square '(1 3 5 7)) => '(1 3 5 7)
(-map-last 'even? 'square '(2)) => '(4)
(-map-last 'even? 'square nil) => nil)
- [elpa] externals/dash 71668fe 003/316: Speed up -table-flat, (continued)
- [elpa] externals/dash 71668fe 003/316: Speed up -table-flat, ELPA Syncer, 2021/02/15
- [elpa] externals/dash a3cd1ac 004/316: Alias `-zip-pair`, prepare for breaking change, ELPA Syncer, 2021/02/15
- [elpa] externals/dash fec6f54 007/316: Release 2.12.1, ELPA Syncer, 2021/02/15
- [elpa] externals/dash b6e1041 010/316: Fix broken GH profile link in README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 174187f 005/316: Add lexical binding pragma to dash.el, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 22e494a 008/316: Update MELPA URLs, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0d84c0f 009/316: Merge pull request #167 from syohex/update-url, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8a46d3c 013/316: [#170] Add a note about -keep on -filter., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 81b15c5 006/316: Fix: The upcoming breaking change is 3.0, not 2.0, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 6484fb5 012/316: Merge pull request #168 from camsaul/patch-2, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0272e8b 017/316: [Fix #158] -map-last does not modify input list.,
ELPA Syncer <=
- [elpa] externals/dash 1fce650 019/316: Add `-each-indexed` and an anaphoric equivalent (#178), ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7b2845a 011/316: Fix broken GH profile link in README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 096f244 018/316: --remove-last does not modify input list #158, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3e7163a 020/316: [#99] Use butlast to implement -butlast, ELPA Syncer, 2021/02/15
- [elpa] externals/dash eef3bb0 023/316: Document -doto macro in the README (#181), ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7cc0149 021/316: [#99] Add -take-last and -drop-last, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 6d8abc7 022/316: Add -doto macro (like Clojure's doto) (#177), ELPA Syncer, 2021/02/15
- [elpa] externals/dash f1c60c4 034/316: Merge pull request #193 from GuiltyDolphin/fix-map-when-typo, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 15f384d 025/316: Copyedit: argument name consistency (#187), ELPA Syncer, 2021/02/15
- [elpa] externals/dash 937f8a1 026/316: Update documentation, ELPA Syncer, 2021/02/15