[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] PATCH: wrong type for alist-delete!
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] PATCH: wrong type for alist-delete! |
Date: |
Fri, 12 Feb 2016 20:53:46 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Feb 12, 2016 at 08:34:15PM +0100, Peter Bex wrote:
> And if you change srfi-1 to data-structures, and assoc to rassoc,
> the current master doesn't give a compile time warning, but with this
> patch you'll get the same warning with both CHICKEN versions:
>
> Warning: at toplevel:
> (test.scm:2) in procedure call to `rassoc', expected argument #3 of type
> `(procedure (symbol (or false fixnum)) *)' but was given an argument of type
> `(procedure (number number) boolean)'
Interestingly enough, CHICKEN 5 gives this warning only at lower
optimization levels. With -O3 and higher, the warning goes away(!)
I'm not sure what causes this it doesn't seem to be caused by
#:foldable because if I remove it, the warning is still gone, and
because the same happens with the "sort" procedure from data-structures,
which doesn't have #:foldable:
(use data-structures)
(print (sort '(x y z) (lambda (a b) (> a b))))
With -O2 or lower:
Warning: at toplevel:
(/tmp/test.scm:5) in procedure call to `chicken.data-structures#sort',
expected argument #2 of type `(procedure (symbol symbol) *)' but was given an
argument of type `(procedure (number number) boolean)'
With -O3 or higher, no output! CHICKEN 4 doesn't have this problem.
Anyway, it is a separate issue to the types.db patch but I just wanted
to mention it so you don't wonder why the warning doesn't show up.
I've created ticket #1258 so we won't forget to fix this before we
make a release.
Cheers,
Peter
signature.asc
Description: Digital signature
- Re: [Chicken-hackers] PATCH: wrong type for alist-delete!, Peter Bex, 2016/02/11
- Re: [Chicken-hackers] PATCH: wrong type for alist-delete!, Peter Bex, 2016/02/12
- Re: [Chicken-hackers] PATCH: wrong type for alist-delete!, Andy Bennett, 2016/02/12
- Re: [Chicken-hackers] PATCH: wrong type for alist-delete!, Peter Bex, 2016/02/12
- Re: [Chicken-hackers] PATCH: wrong type for alist-delete!,
Peter Bex <=
- [Chicken-hackers] [PATCH] Re: wrong type for alist-delete!, Evan Hanson, 2016/02/13
- Re: [Chicken-hackers] [PATCH] Re: wrong type for alist-delete!, Peter Bex, 2016/02/13
- Re: [Chicken-hackers] [PATCH] Re: wrong type for alist-delete!, John Cowan, 2016/02/13
- Re: [Chicken-hackers] [PATCH] Re: wrong type for alist-delete!, Evan Hanson, 2016/02/13
- Re: [Chicken-hackers] [PATCH] Re: wrong type for alist-delete!, Peter Bex, 2016/02/13
- Re: [Chicken-hackers] [PATCH] Re: wrong type for alist-delete!, Mario Domenech Goulart, 2016/02/14