You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I just wanted to find out where the attribute Cyclotomic is declared. It took me some rummaging, until I rediscovered GET_DECLARATION_LOCATIONS -- and that only because I reviewed the PR that added it, and edited the code at various points, so I knew it was there. I imagine most other people will have a much harder time finding it, if they even try.
Let's make this useful debugging tool easier to find and use. One simple idea would be to install a more advanced Display method for operations, which also prints the location of all declarations. E.g. it could show this:
gap> Display(Cyclotomic);
<Attribute "Cyclotomic">
declared at /SOME/PATH/.../lib/zmodnze.gd:25
With one line for each place declaring the operation. Even better would be if it also showed the filters for the declaration (possibly with help of GET_OPER_FLAGS, but that may not be enough for "nice" printing).
Of course we could instead or in addition do other things to get this information; but my thought was that Display is a relatively easy way to discover this.
We could of course also already show this information with ViewObj resp. PrintObj, but that then makes writing certain .tst file entries more problematic, as those would now hardcode paths and line numbers, and even if we "normalize" the paths (to not encoded system specific stuff into the .tst file), the line numbers are still prone to change, which then would break certain test files... Of course we might be able to avoid that by rewriting our .tst files cleveraly to not print or view operations declared in the library (that might be a good idea anyway).
The text was updated successfully, but these errors were encountered:
In PR #3459 the helper function ShowDeclarationsOfOperation was added which shows the relevant info. But of course that's not quite what this PR suggests
So I just wanted to find out where the attribute
Cyclotomic
is declared. It took me some rummaging, until I rediscoveredGET_DECLARATION_LOCATIONS
-- and that only because I reviewed the PR that added it, and edited the code at various points, so I knew it was there. I imagine most other people will have a much harder time finding it, if they even try.Let's make this useful debugging tool easier to find and use. One simple idea would be to install a more advanced
Display
method for operations, which also prints the location of all declarations. E.g. it could show this:With one line for each place declaring the operation. Even better would be if it also showed the filters for the declaration (possibly with help of
GET_OPER_FLAGS
, but that may not be enough for "nice" printing).Of course we could instead or in addition do other things to get this information; but my thought was that
Display
is a relatively easy way to discover this.We could of course also already show this information with
ViewObj
resp.PrintObj
, but that then makes writing certain.tst
file entries more problematic, as those would now hardcode paths and line numbers, and even if we "normalize" the paths (to not encoded system specific stuff into the .tst file), the line numbers are still prone to change, which then would break certain test files... Of course we might be able to avoid that by rewriting our .tst files cleveraly to not print or view operations declared in the library (that might be a good idea anyway).The text was updated successfully, but these errors were encountered: