aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/obarray.el
diff options
context:
space:
mode:
authorArtur Malabarba2015-11-11 22:30:22 +0000
committerArtur Malabarba2015-11-11 22:30:22 +0000
commit952395d3eb813e1c21b8bace10e54aa67bee9122 (patch)
tree91ce9ffe74d5913807e98ecf8fd2fc801212081e /lisp/obarray.el
parent436d3307211db86d5606e6cec51d6fbe9f7572a8 (diff)
downloademacs-952395d3eb813e1c21b8bace10e54aa67bee9122.tar.gz
emacs-952395d3eb813e1c21b8bace10e54aa67bee9122.zip
* lisp/obarray.el: Fix shadowed variables
(obarray-map, obarray-remove, obarray-put, obarray-get): Change OBARRAY arg to OB to avoid shadowing ‘obarray’.
Diffstat (limited to 'lisp/obarray.el')
-rw-r--r--lisp/obarray.el25
1 files changed, 13 insertions, 12 deletions
diff --git a/lisp/obarray.el b/lisp/obarray.el
index bf8bb3ee2ca..a93c9a94c33 100644
--- a/lisp/obarray.el
+++ b/lisp/obarray.el
@@ -42,24 +42,25 @@
42 (and (vectorp object) 42 (and (vectorp object)
43 (< 0 (length object)))) 43 (< 0 (length object))))
44 44
45(defun obarray-get (obarray name) 45;; Don’t use obarray as a variable name to avoid shadowing.
46 "Return symbol named NAME if it is contained in OBARRAY. 46(defun obarray-get (ob name)
47 "Return symbol named NAME if it is contained in obarray OB.
47Return nil otherwise." 48Return nil otherwise."
48 (intern-soft name obarray)) 49 (intern-soft name ob))
49 50
50(defun obarray-put (obarray name) 51(defun obarray-put (ob name)
51 "Return symbol named NAME from OBARRAY. 52 "Return symbol named NAME from obarray OB.
52Creates and adds the symbol if doesn't exist." 53Creates and adds the symbol if doesn't exist."
53 (intern name obarray)) 54 (intern name ob))
54 55
55(defun obarray-remove (obarray name) 56(defun obarray-remove (ob name)
56 "Remove symbol named NAME if it is contained in OBARRAY. 57 "Remove symbol named NAME if it is contained in obarray OB.
57Return t on success, nil otherwise." 58Return t on success, nil otherwise."
58 (unintern name obarray)) 59 (unintern name ob))
59 60
60(defun obarray-map (fn obarray) 61(defun obarray-map (fn ob)
61 "Call function FN on every symbol in OBARRAY and return nil." 62 "Call function FN on every symbol in obarray OB and return nil."
62 (mapatoms fn obarray)) 63 (mapatoms fn ob))
63 64
64(provide 'obarray) 65(provide 'obarray)
65;;; obarray.el ends here 66;;; obarray.el ends here