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

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

[elpa] 137/255: setf method for aget


From: Eric Schulte
Subject: [elpa] 137/255: setf method for aget
Date: Sun, 16 Mar 2014 01:02:35 +0000

eschulte pushed a commit to branch go
in repository elpa.

commit cfd856bdc3ebdf4eeae9a30d3e826758bf533b7d
Author: Eric Schulte <address@hidden>
Date:   Sat Jun 2 17:48:04 2012 -0600

    setf method for aget
---
 go-util.el |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/go-util.el b/go-util.el
index 835cbf9..1533f7d 100644
--- a/go-util.el
+++ b/go-util.el
@@ -50,6 +50,13 @@
 
 (defun take (num list) (subseq list 0 num))
 
+(defun set-aget (list key new)
+  (if (aget list key)
+      (setf (cdr (assoc key list)) new)
+    (setf (cdr (last list)) (list (cons key new)))))
+
+(defsetf aget set-aget)
+
 (defmacro until (test &rest body)
   (declare (indent 1))
   `(while (not ,test) ,@body))



reply via email to

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