>> I really cannot make sense out of the error in the attached program.
>> Why would it in some cases work fine and in others not? That is quite
>> frustrating. Anyone spots an error in my code? Or is it another compiler
>> bug?
> 
> First guess is that this is due to different handling of constants
> in types in various part of FriCAS (this is known bug).
> Try consitently keeping parameters as variables and pass actual
> values from interpeter only at one place.

I assume that you answer to the problem in this thread and not to

https://www.mail-archive.com/[email protected]/msg13722.html
(which more looks like an issue with category default
implementations---but maybe you say it's the same issue).

Anyway. in

===========
Bar(C: IntegralDomain): with
    f1: () -> Void
    f2: () -> Void
  == add
    f1(): Void ==
      px1 := px()$Foo(C, L1 C)
      dbgPrint("px1", px1)
    f2(): Void ==
      minrootpol: SUP C := monomial(1,2)$SUP(C) + 1
      CX ==> SimpleAlgebraicExtension(C, SUP C, minrootpol)
      px2 := px()$Foo(CX, L1 CX)
      dbgPrint("px2", px2)
===========

minrootpol IS a variable and f2 leads to a problem (as seen in my
previous mail).

In my original program I want something like minrootpol to be computed
from other data that eventually come from a user input.
So your suggestion does not really help me to get around this problem.

If it were Aldor, I would probably write something like this:

    f3aux(minrootpol: SUP(C)): Void ==
      CX ==> SimpleAlgebraicExtension(C, SUP C, minrootpol)
      px3 := px()$Foo(CX, L1 CX)
      dbgPrint("px3", px3)
    f3(): Void ==
      minrootpol: SUP C := monomial(1,2)$SUP(C) + 1
      f3aux(minrootpol)
    f4(): Void == f3aux(monomial(1,2)$SUP(C) + 1)

because arguments of functions are supposed to be constants (as far as I
remember). However in FriCAS that does not help.

The question is, how would I have to program f2 so that it will work as
expected? This problem is a real blocker for me. :-(

Ralf

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/5e4996b7-ff66-3426-1532-c846c0c0ceae%40hemmecke.org.

Reply via email to