chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] corrected "smashing" of pair/vector/list compo


From: Felix
Subject: [Chicken-hackers] [PATCH] corrected "smashing" of pair/vector/list component types
Date: Wed, 21 Sep 2011 04:34:38 -0400 (EDT)

Corrected "smashing" of pair/list/vector component types after
call to possibly modifying procedure. The existing code refered
to the incorrect type specifier "pair-of".

Note that this patch depends on the recent scrutinizer patch
that fixes several bugs related to type-matching (4c574b04
in "felix-pending").


cheers,
felix
commit 7089000c8d4948d0ea13c3e401a428af5a7dd2e6
Author: felix <address@hidden>
Date:   Wed Sep 21 10:22:06 2011 +0200

    Corrected "smashing" of pair/list/vector component types after
    call to possibly modifying procedure.
    
    Squashed commit of the following:
    
    commit 3f5ed638183628c9e71a0aef720c17a9c6642427
    Author: felix <address@hidden>
    Date:   Wed Sep 21 10:20:10 2011 +0200
    
        removed failing test (corrected smashing for (list T) will force result 
to be list of undetermined type)
    
    commit 04eb746226c8ad7c662fce4dfcea6553f80f26b3
    Author: felix <address@hidden>
    Date:   Wed Sep 21 09:27:37 2011 +0200
    
        fixed reference to incorrect pair-of type in component-type smashing

diff --git a/scrutinizer.scm b/scrutinizer.scm
index 895481e..5dc07af 100755
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -825,11 +825,11 @@
               (change! (cute set-cdr! (car lst) <>)))
       (when (pair? t)
        (case (car t)
-         ((pair-of vector-of)
+         ((list-of vector-of)
           (dd "  smashing `~s' in ~a" (caar lst) where)
-          (change! (if (eq? 'pair-of (car t)) 'pair 'vector))
+          (change! (if (eq? 'list-of (car t)) 'list 'vector))
           (car t))
-         ((pair vector)
+         ((pair vector list)
           (dd "  smashing `~s' in ~a" (caar lst) where)
           (change! (car t))
           (car t))
diff --git a/tests/typematch-tests.scm b/tests/typematch-tests.scm
index eb437e0..33b4e1c 100644
--- a/tests/typematch-tests.scm
+++ b/tests/typematch-tests.scm
@@ -151,7 +151,6 @@
 (checkp boolean? #f boolean)
 (checkp pair? '(1 . 2) pair)
 (checkp null? '() null)
-(checkp list? '(1) (list fixnum))
 (checkp symbol? 'a symbol)
 (checkp number? (+ n) number)
 (checkp number? (+ n) number)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]