chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] PATCH: wrong type for alist-delete!


From: Andy Bennett
Subject: Re: [Chicken-hackers] PATCH: wrong type for alist-delete!
Date: Fri, 12 Feb 2016 12:40:45 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0

Hi Peter,

> It occurred to me that maybe the scrutinizer is smart enough to merge
> lists of pairs of (known) mixed types, and it actually is!
> 
> (use srfi-1)
> (print (assoc 'x '((1 . 2) (#f . 4)) (lambda (x y) (> x y))))
> 
> When compiled, this will tell you:
> Warning: at toplevel:
>   (test.scm:2) in procedure call to `assoc', expected argument #3 of type 
> `(procedure ((or false fixnum) symbol) *)', but was given an argument of type 
> `(procedure (number number) boolean)'
> 
> So I guess my patch needlessly weakens the type declarations.

What happens when the alist argument to assoc isn't static? Does the
data analysis know the types? Which type is better for safe code
generation in the non-static data case (which I imagine to be the
general case).

Is there a difference between building the alist up dynamically with
alist-cons compared to using quasiquote or cons or something?



Regards,
@ndy

-- 
address@hidden
http://www.ashurst.eu.org/
0290 DA75 E982 7D99 A51F  E46A 387A 7695 7EBA 75FF


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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