eschulte pushed a commit to branch go in repository elpa. commit 39a822446aa6ef37151d9203fee785f509901e8a Author: Eric Schulte <eric.schu...@gmx.com> Date: Sun Jun 3 11:35:14 2012 -0600
Revert "improved the setf method for aget" This reverts commit de4ddf2419b9fc1b26814db6cbd3ddc9b0214232. --- go-util.el | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) diff --git a/go-util.el b/go-util.el index de1b178..1533f7d 100644 --- a/go-util.el +++ b/go-util.el @@ -50,16 +50,10 @@ (defun take (num list) (subseq list 0 num)) -(defmacro set-aget (place key new) - "Set `aget' of KEY in the list stored in PLACE to NEW." - (let ((sym (gensym))) - (if (symbolp place) - (if (aget (eval place) (eval key)) - `(setf (cdr (assoc ,key ,place)) ,new) - `(callf setq ,place (cons (cons ,key ,new) ,place))) - `(let ((,sym ,place)) - (setf (aget ,sym ,key) ,new) - (setf ,place ,sym))))) +(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)