[Larceny-users] likely bug in remprop w/ fix

Andreas Huber andi at beyond-aggravated.com
Thu Mar 22 18:40:15 EDT 2007


I discovered that "remprop" did not actually remove properties  
installed on a symbol with "putprop" but left the propery list  
unchanged. I tracked this down to src/Lib/Common/oblist.sch, here's  
my suggested fix:

Index: src/Lib/Common/oblist.sch
===================================================================
--- src/Lib/Common/oblist.sch   (revision 4177)
+++ src/Lib/Common/oblist.sch   (working copy)
@@ -109,13 +109,20 @@
                   (cdr probe)
                   #f)))))))
+(define (aremq! x alis)
+  (cond ((null? alis) '())
+               ((eq? x (caar alis))
+                (aremq! x (cdr alis)))
+               (else
+                 (set-cdr! alis (aremq! x (cdr alis))))))
+
(define (remprop sym name)
    (if (not (symbol? sym))
        (begin (error "remprop: " sym " is not a symbol.")
              #t)
        (call-without-interrupts
         (lambda ()
-         (symbol.proplist! sym (remq name (symbol.proplist sym)))))))
+         (symbol.proplist! sym (aremq! name (symbol.proplist sym)))))))

-- Andreas




More information about the Larceny-users mailing list