Description
RFC #466 was closed back in the days before we had a protocol for opening up follow-up issues to use to gather links to related discussion.
The idea is that we already have some macros (file!
and line!
) that are useful for reporting source code context, and it might be nice to expand that collection with macros that include other information, such as the current function name, which I believe was the suggestion of the function!
macro that was at one point described in RFC #466 (whose draft contents have now been lost, apparently).
Here is my attempt to retrieve the Motivation from that original draft text. (I don't think we need the detailed design in the description of an issue like this.)
Motivation
For error reporting cases we already have
file!
,line!
,col!
andmodule_path!
but there is no way yet to figure out in which function an error was reported. Python's
tracebacks are well received and for many people the function name information is much
more important than the line number.
- An alternative (or complement) would be to have a
module_path!
macro that expands into a string representing the path to the current module; such a macro would be usable outside offn
definitions, e.g. instatic
items.