chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] #!rest in type declarations


From: Felix
Subject: Re: [Chicken-users] #!rest in type declarations
Date: Fri, 02 Nov 2012 13:55:32 +0100 (CET)

> Consider this example:
> 
> (: apply1 (forall (a b) (procedure ((procedure (#!rest a) b) (list-of a)) b)))
> (define (apply1 f args)
>   (apply f args))
> 
> (cond-expand
>  (compiling
>   (compiler-typecase (list 'a 2 3)
>     ((list-of (or symbol fixnum)) #t))))
> 
> (cond-expand
>  (compiling
>   (compiler-typecase +
>     ((procedure (#!rest number) number) #t))))
> 
> (apply1 + (list 'a 2 3)) ; <- no type warning
> 
> ---
> 
> This gives no compilation warnings. 
> 
> But shouldn't it warn at the last line that the type of the second
> argument is not correct (i.e. not (list-of number))?

It probably should. I'm not sure yet if this is just a limitation
of the type-matching or a bug. I'll investigate.


cheers,
felix



reply via email to

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