Ralf Hemmecke wrote:
> > Assumung that Spad
> > compiler already checked arument types it is reasonable strategy.
>
> I don't quite understand. Let's make an artificial example.
>
> CatA(T: SemiRng): Category == with
> foo: % -> %
> if T has Ring then
> bar: % -> %
>
> CatB(X: AbelianMonoid): Category == with
> if X has Ring then CatA(X)
>
>
> Should Cat(Integer) be exporting bar or not? I think, it should, if CatB
> is translated as you say then it would mean
>
> if Integer has Ring then CatA(Integer pretend SemiRng)
>
> I already had difficulties understanding how "has" works and probably
> the "pretend SemiRng" will not prevent "T has Ring" to return true for
> T=Integer. Still, it looks a bit confusing to me.
At least in Spad checking if 'T has Ring' uses actual value of T,
so the test will give true. OTOH during compilation compiler may
lack some information (which will be true at runtime) and
either signal error or generate suboptimal code.
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.