[racket] Bug in TR for/sum: ??
Perhaps for/sum should adapt its base case answer to the return type?
On Mar 28, 2013, at 4:03 PM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
> I'm not sure what you're referring to. This program doesn't typecheck,
> because if both vectors were empty, the result is exact 0, which isn't
> a `Float`.
>
> Sam
>
> On Thu, Mar 28, 2013 at 3:56 PM, Ray Racine <ray.racine at gmail.com> wrote:
>> Is this a bug?
>>
>> #lang typed/racket/base
>>
>> (define: βns : (Vectorof Float) '#(1.0 2.0 3.0))
>> (define: χns : (Vectorof Float) '#(4.0 5.0 6.0))
>>
>> (for/sum: : Float
>> ([βn : Float (in-vector βns)]
>> [χn : Float (in-vector χns)])
>> (* βn χn))
>>
>> ____________________
>> Racket Users list:
>> http://lists.racket-lang.org/users
>>
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users