[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH 3/3] Improve scrutiny for pair types
From: |
Evan Hanson |
Subject: |
[Chicken-hackers] [PATCH 3/3] Improve scrutiny for pair types |
Date: |
Thu, 2 Jan 2014 22:06:40 +1300 |
Hi everyone,
Here is a set of patches relating to #1039.
The first two are pretty simple. The first fixes the checks for null
during (pair ...) <-> (list ...) type matching, to avoid errors due to
calling (cadr '()). The second removes some unreachable code from the
scrutinizer's matching function, mostly things like checking for e.g.
'list when it will already have been expanded to (list-of *) by then.
The third makes pair <-> list type matching slightly more accurate by
skipping early canonicalization for pair types if that would lose
information about their components, then matching those components more
faithfully during the actual type comparisons. So, rather than rewriting
a type like (pair a null) to just 'list and matching it inexactly, the
pair form (including the type variable a) is preserved so that, if it's
matched, a can be unified, giving us more type information in cases like
#1039. (Pairs that can be rewritten without losing information are
canonicalized like before.) See the additions to typematch-tests.scm for
examples of the new cases handled.
Hopefully this is clear -- let me know if not, or if there are concerns
with the approach.
https://bugs.call-cc.org/ticket/1039
Cheers,
Evan
0001-Add-null-guards-and-fix-empty-list-rewriting-in-pair.patch
Description: Text document
0002-Remove-some-redundant-unreachable-cases-in-type-matc.patch
Description: Text document
0003-Make-pair-type-matching-more-accurate.patch
Description: Text document
- [Chicken-hackers] [PATCH 3/3] Improve scrutiny for pair types,
Evan Hanson <=