eschulte pushed a commit to branch go
in repository elpa.

commit cfd856bdc3ebdf4eeae9a30d3e826758bf533b7d
Author: Eric Schulte <eric.schu...@gmx.com>
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