<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">I rewrote it like this, could it be any leaner? Asking in case I am not as good as I can be yet :D !<div><br></div><div><div><font face="Edlo">    384 get_class_superclass(Class, Super, !X) :-</font></div><div><font face="Edlo">    385     ( if !.X = [ tk(Cp, Cb) | Rest ] then</font></div><div><font face="Edlo">    386         Class = ps(Cp, Cb),</font></div><div><font face="Edlo">    387         Super = no,</font></div><div><font face="Edlo">    388         !:X   = Rest</font></div><div><font face="Edlo">    389     else if !.X = [ sexp(_, [ tk(Cp, Cb), tk(Sp, Sb) ]) | Rest ] then</font></div><div><font face="Edlo">    390         Class = ps(Cp, Cb),</font></div><div><font face="Edlo">    391         Super = yes(ps(Sp, Sb)),</font></div><div><font face="Edlo">    392         !:X   = Rest</font></div><div><font face="Edlo">    393     else</font></div><div><font face="Edlo">    394         fail</font></div><div><font face="Edlo">    395     ).</font></div><div><br></div><div>I mean, it's fine but in the manual, 2.13 DCG-rules it says "<span style="font-family: -webkit-standard; font-size: medium;">As a matter of style, we recommend that in future DCG notation be reserved for writing parsers and sequence generators, and that state variable syntax be used for passing state threads."</span></div><div><span style="font-family: -webkit-standard; font-size: medium;"><br></span></div><div><span style="font-family: -webkit-standard; font-size: medium;">And I am writing a parser system so I figured it was permissible to use DGC form. I have a lot more DCG code in my project... it ain't broke, don't fix it!</span></div><div><span style="font-family: -webkit-standard; font-size: medium;"><br></span></div><div><span style="font-family: -webkit-standard; font-size: medium;"><br></span></div><div><br><blockquote type="cite"><div>On 28 Oct 2023, at 12:05, Zoltan Somogyi <zoltan.somogyi@runbox.com> wrote:</div><br class="Apple-interchange-newline"><div><div><br>On 2023-10-28 21:53 +11:00 AEDT, "Volker Wysk" <post@volker-wysk.de> wrote:<br><blockquote type="cite">I have the impression that the compiler often gives complicated error<br>messages for stupid errors... <br></blockquote><br>The two main factors influencing whether the compiler will have a direct,<br>specific error message for a class of errors are<br><br>- how frequent that class of errors appears to be, and<br>- how difficult that class of errors is to isolate from other classes.<br><br>It is a sad fact of life that the people judging the frequency<br>of error classes are the compiler developers. Since their errors<br>have a different frequency distribution from other language users,<br>the work they (we) put into improving error messages usually<br>benefits us more than it benefits general users. That said, we of course<br>do try to improve messages even for errors we don't encounter<br>ourselves. (For example, I wouldn't encounter this bug, because<br>I stopped using DCGs ages ago.) Of course, this does require that<br>such problems be brought to our attention. That usually works;<br>for example, I extended the error message mmc generates<br>for references to undefined types, predicates etc with "did you mean"<br>suggestions (such as "circle" for "cirle") a few days after the m-users<br>thread about that error.<br><br>So if you get a complicated error message for an error, stupid or not,<br>you know what to do.<br><br>Zoltan.</div></div></blockquote></div><br></div></body></html>