Skip to content

Commit

Permalink
Let Display for functions print where it was defined
Browse files Browse the repository at this point in the history
... at least when that information is available
  • Loading branch information
fingolfin committed Oct 19, 2022
1 parent 114824d commit 7b8e585
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/function.gi
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ end);

InstallMethod(Display, "for a function", [IsFunction and IsInternalRep],
function(fun)
local loc;
loc := LocationFunc(fun);
if loc <> fail then
Print("# ", loc, "\n");
fi;
Print(fun, "\n");
end);

Expand Down

0 comments on commit 7b8e585

Please sign in to comment.