emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dash bcc74b5 045/316: [#200] Define setters for -first-


From: ELPA Syncer
Subject: [elpa] externals/dash bcc74b5 045/316: [#200] Define setters for -first-item and -last-item
Date: Mon, 15 Feb 2021 15:57:22 -0500 (EST)

branch: externals/dash
commit bcc74b56cc90842cb120015632b37eeffcaa4b9a
Author: Matus Goljer <goljer@logio.cz>
Commit: Matus Goljer <goljer@logio.cz>

    [#200] Define setters for -first-item and -last-item
---
 dash.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dash.el b/dash.el
index 0747eb8..27dd2c1 100644
--- a/dash.el
+++ b/dash.el
@@ -578,11 +578,15 @@ Alias: `-any'"
 
 \(fn LIST)")
 
+(gv-define-simple-setter -first-item setcar)
+
 (defun -last-item (list)
   "Return the last item of LIST, or nil on an empty list."
   (declare (pure t) (side-effect-free t))
   (car (last list)))
 
+(gv-define-setter -last-item (val x) `(setcar (last ,x) ,val))
+
 (defun -butlast (list)
   "Return a list of all items in list except for the last."
   ;; no alias as we don't want magic optional argument



reply via email to

[Prev in Thread] Current Thread [Next in Thread]