• Re: callbacks in slot writer

    From B. Pym@21:1/5 to All on Thu Sep 26 14:30:11 2024
    XPost: comp.lang.scheme

    (defun sans (plist &rest keys)
    "Returns PLIST with keyword arguments from KEYS removed."
    ;; stolen from Usenet posting <3247672165664225@naggum.no> by
    ;; Erik Naggum
    (let ((sans ()))
    (loop
    (let ((tail (nth-value 2 (get-properties plist keys))))
    ;; this is how it ends
    (unless tail
    (return (nreconc sans plist)))
    ;; copy all the unmatched keys
    (loop until (eq plist tail) do
    (push (pop plist) sans)
    (push (pop plist) sans))
    ;; skip the matched key
    (setq plist (cddr plist))))))

    Gauche Scheme:

    (delete-keywords '(b d) '(a 0 b 1 c 2 d 3))


    (a 0 c 2)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)