Hello, Le sam. 19 oct. 2024 à 16:18, 'Prof. Dr. Johannes Grabmeier' via FriCAS - computer algebra system <[email protected]> a écrit :
> I solved the problem and traced it, so this is not the point. The system > simply calls elt$Partition when I coded > > entries(p).i > > It should call elt$List(Integer) - after all enries(p) is a List Integer > and no longer represents a Partition!! > > Somehow elt from Partition has higher priority and entries(p) seems to > be automatically converted to a Partition, which I think is wrong I don’t how you solved your problem but I encountered several times this. Usually I "helps" the compiler using a temporary variable and even declare its type for the affectation. Maybe but I am not sure the . (dot) is compiled differently than using elt or qelt. Maybe you have tried this solution (elt or qelt)? - Greg > > I can send the code (when I finished revision) for put into the system > anyway. > > Am 19.10.24 um 16:12 schrieb Qian Yun: > > Hi, showing a spad file that contains a minimal reproducible > > example would be very helpful for people to debug. > > > > If you want to debug it your self, you can utilize tools like > > ")trace", or ")set break break" and Ctrl-C and "backtrace" > > to examine the call stack, or use the good old "printf" to debug. > > > > From the posted snippet, I don't see a problem yet. > > > > - Qian > > > > On 10/19/24 9:54 PM, 'Prof. Dr. Johannes Grabmeier' via FriCAS - > > computer algebra system wrote: > >> I am revising Partition represented by List Integer: > >> > >> Rep := List Integer > >> rep x ==> (x @ %) pretend Rep > >> per x ==> (x @ Rep) pretend % > >> > >> then I have a function > >> > >> entries(p: %): List Integer == copy rep p > >> > >> which is used for elt from Eltable(Integer, Integer): > >> > >> elt(p: %, i: Integer): Integer == > >> i <= 0 => error "elt requires a positive second argument." > >> i > #p => error "elt: second argument too large." > >> entries(p).i > >> > >> However, this constructs an infinite loop of calls to elt. Seamingly > >> the elt from List Integer ( as I thinks this could should point to) > >> is not called, but it uses the just defined elt from Partition. > >> > >> The code is fixed by explicit function call: > >> > >> elt(entries(p),i)$List(Integer) > >> > >> Question: What is wrong here? Or if not wrong, what is my > >> misunderstanding? > >> > > > -- > 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/ab5bef64-ecaf-42da-9a63-dfe64ab29a2d%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/CAHnU2db3nb_OyTLkk5as3zL0nBvt2v%2BOO-tc-RWq_F-0dWJr7g%40mail.gmail.com.
