On Wed, Apr 03, 2024 at 05:19:03PM +0200, Ralf Hemmecke wrote:
> Hi Waldek,
>
> I've now tried to compile all of FriCAS with your patch (adding the error3
> function to g-error.boot).
>
> https://github.com/fricas/fricas/compare/master...hemmecke:fricas:wip/error3.patch
>
> Branch "wip/error3" at my github repo:
>
> https://github.com/hemmecke/fricas/tree/wip/error3
>
> It aborts the compilation with the log below. Obiously while compiling (in
> parallel) the file xpfact.spad.
>
> "master" compiled fine on that machine so the problem must come from your
> patch, but I do not see why this would be related.
Attached diff adds special handling for 'error3'. I principle
we should have special type (or something internal to the compiler)
to mark code which does not return. But in the patch I just add
extra line making 'error3' magic (like 'error').
--
Waldek Hebisch
--
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/Zg2LMG87obdnHpyB%40fricas.org.
--- ../trunk.pp6/src/interp/compiler.boot 2024-03-28 21:46:24.406140407 +0000
+++ compiler.boot 2024-04-03 16:52:48.237462018 +0000
@@ -484,10 +484,16 @@
compForm1(form is [op,:argl],m,e) ==
op="error" =>
+ constr :=
+ NULL($functorForm) => nil
+ first($functorForm)
+ fun :=
+ $op = constr => nil
+ $op
#argl = 1 =>
arg := first(argl)
u := comp(arg, $String, e) =>
- [[op, u.expr], m, e]
+ [["error3", MKQ(constr), MKQ(fun), u.expr], m, e]
SAY ['"compiling call to error ", argl]
u := outputComp(arg, e) =>
[[op, ['LIST, ['QUOTE, 'mathprint], u.expr]], m, e]
@@ -961,6 +967,7 @@
level=exitCount and not ValueFlag => nil
op="SEQ" => or/[canReturn(u,level+1,exitCount,false) for u in rest expr]
op = "error" => nil
+ op = "error3" => nil
op="TAGGEDreturn" => nil
op="CATCH" =>
[.,gs,data]:= expr