[bitc-dev] Type compatibility at application
David Hopwood
david.nospam.hopwood at blueyonder.co.uk
Fri May 19 15:14:48 EDT 2006
Jonathan S. Shapiro wrote:
>>OK. Are you thinking of a case like:
>>
>>(define (f x:(vector 'a) #t)
>>
>>(define vec1:(vector int32) (vector 1 2 3))
>>(define vec2:(vector (mutable int32)) (vector 1 2 3 ))
>>
>>(define vecApp
>> (begin
>> (f vec1)
>> (f vec2)
>>)
>
> Yes. I am thinking of exactly this. And here is the weird part: if F can
> operate correctly on (vector (non-mutable T)), then it will operate
> equally correctly on (vector (mutable T)).
Isn't the compiled code for F on (vector (non-mutable T)) allowed the
optimization of caching vector lookups, while the compiled code for F on
(vector (mutable T)) would have to perform every lookup that appears in
the source?
Oh, I'm thinking of a concurrent language where the vector may be shared.
Perhaps this doesn't apply to BitC (although I think it will have to
support concurrency at some point).
--
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>
More information about the bitc-dev
mailing list