Any reason why your code should pass the compilation successfully?

Dom1 asserts to export bar, but never implements it. It also asserts to implement foo, but doesn't actually implement it.

And, I guess, your code is a bit tricky. If the compiler has to check for full implementation of all exports, then it would have to test "% has Ring" at compile time. But your implementation of foo appears in a category default. Are you expecting the compiler to find it when it generates code for Dom1? And surely you would want the compiler to shout, if Dom1 is not a Ring and thus foo is nowhere implemented. Category defaults are not one of my favourites. They must be used with utmost care, since they allow multiple inheritance conflicts on domain level. Note that a domain usually can only inherit an implementation from *one* other domain. Well, but there are these category defaults... :-(

Ralf

In the code below, calling foo()$Dom1 will raise an error
"hi", but bar()$Dom1 will raise

    Internal Error
    The function bar with signature hashcode is missing from domain Dom1

which is not really better than what we have now...

Sorry again,

Martin

)abbrev category TEST Test
Test(): Category == BasicType with
         foo: () ->  %
         bar: () ->  %
     add
         if % has CharacteristicNonZero then
             error "hi"

         if % has Ring then
             foo() == 1$%

)abbrev domain DOM1 Dom1
Dom1(): Exports == Implementation where
     Exports ==>  Join(Test, CharacteristicNonZero) with
         hi: () ->  %

     Implementation ==>  add
         Rep := PrimeField 17
         hi() == 1$PrimeField(17)


--
---------------------------------------------------------------------
Dr Ralf Hemmecke - Research Institute for Symbolic Computation (RISC)
Johannes Kepler University, Altenberger Str. 69, A-4040 Linz, Austria
[email protected]                           Tel: +43 732 2468 9961
http://www.risc.jku.at/people/hemmecke         Fax: +43 732 2468 9930
---------------------------------------------------------------------

--
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.

Reply via email to