mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 04:15:36 +02:00
`%plist-member' fix
* module/language/elisp/boot.el (%plist-member): Use recursion to avoid using `catch' and `throw'.
This commit is contained in:
parent
5950f674bf
commit
76c50ec52e
1 changed files with 7 additions and 5 deletions
|
@ -400,11 +400,13 @@
|
||||||
;;; Property lists
|
;;; Property lists
|
||||||
|
|
||||||
(defun %plist-member (plist property test)
|
(defun %plist-member (plist property test)
|
||||||
(catch 'loop
|
(cond
|
||||||
(while plist
|
((null plist) nil)
|
||||||
(if (funcall test (car plist) property)
|
((consp plist)
|
||||||
(throw 'loop (cdr plist))
|
(if (funcall test (car plist) property)
|
||||||
(setq plist (cddr plist))))))
|
(cdr plist)
|
||||||
|
(%plist-member (cdr (cdr plist)) property test)))
|
||||||
|
(t (signal 'wrong-type-argument `(listp ,plist)))))
|
||||||
|
|
||||||
(defun %plist-get (plist property test)
|
(defun %plist-get (plist property test)
|
||||||
(car (%plist-member plist property test)))
|
(car (%plist-member plist property test)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue