mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-23 20:05:32 +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
|
||||
|
||||
(defun %plist-member (plist property test)
|
||||
(catch 'loop
|
||||
(while plist
|
||||
(if (funcall test (car plist) property)
|
||||
(throw 'loop (cdr plist))
|
||||
(setq plist (cddr plist))))))
|
||||
(cond
|
||||
((null plist) nil)
|
||||
((consp plist)
|
||||
(if (funcall test (car plist) property)
|
||||
(cdr plist)
|
||||
(%plist-member (cdr (cdr plist)) property test)))
|
||||
(t (signal 'wrong-type-argument `(listp ,plist)))))
|
||||
|
||||
(defun %plist-get (plist property test)
|
||||
(car (%plist-member plist property test)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue