aha, this seems reasonable (but, who should know that?)

But, nevertheless problem is not solved: I now added a new exported function

init : () -> %

BUT: same behaviour,

the code

 init(): % ==
   if mLP 0 then print hconcat [toOF "init() called using oneToN1 = ", oneToN1 :: OF]

   per oneToN (deref n1Ref)

still seems to refer to the one inherited from StepThrough, namely

init: constant -> %

Question: how can these 2 function be distinguished?

And even worse:

I cannot use the category StepThrough in my case, because the code in the category uses the

init()-function with "contant". Obviously, implementing

init: constant -> %

there, one has not thought about the neccessity to switch that off in cases where the

domain has feature to change internal variables.

That is not satisfactory, would need a possibility to force the system at runtime to evaluate the function again, although it is defined with "constant".

Am 22.01.24 um 16:00 schrieb oldk1331:
The "constant" can cause the compiler to cache the result and return it directly next time, IIRC.

- Qian

On Mon, Jan 22, 2024, 10:39 PM Prof. Dr. Johannes Grabmeier <[email protected]> wrote:

    thanks, the rare instance of code for init() in the system, e.g. in
    QuotienFieldCategory is as follows:

      if S has StepThrough then
         init() == init()$S / 1$S

    my code says

    init(): % ==

    changes to

    init: % ==

    and

    init: ==

    both compile, but both do not change the wrong behaviour

    Are there semantic differences between

    f: constant -> %

    versus

    f: () -> %


    Am 22.01.24 um 15:25 schrieb Ralf Hemmecke:
    > I am not quite sure what the "constant" in this line actually means
    > (Is that documented somewhere?), but intuitively it might be the
    > sources of your "problem".
    >
    >
    https://github.com/fricas/fricas/blob/master/src/algebra/catdef.spad#L1498

    >
    >
    > Ralf
    >
-- Mit freundlichen Grüßen

    Johannes Grabmeier

    Prof. Dr. Johannes Grabmeier,
    Köckstraße 1, D-94469 Deggendorf
    Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
    Fax: +49-(0)-991-2979592

-- 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]
    <mailto:fricas-devel%[email protected]>.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/fricas-devel/3cb26dbf-3d60-47f4-9490-7b0a2b530e69%40grabmeier.net.

--
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/CAGBJN916frH6W2u1JoS%3DBep-rA0woUpLTw3GQsx7LR9eUYiYaA%40mail.gmail.com <https://groups.google.com/d/msgid/fricas-devel/CAGBJN916frH6W2u1JoS%3DBep-rA0woUpLTw3GQsx7LR9eUYiYaA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier,
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Fax: +49-(0)-991-2979592

--
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/7f20a48d-8df4-4ea9-8990-a8a8b788f70f%40grabmeier.net.

Reply via email to