View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000811 | LDMud 3.3 | LPC Compiler/Preprocessor | public | 2012-09-18 08:58 | 2012-12-12 19:16 |
Reporter | sinnvoll | Assigned To | fufu | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Product Version | 3.3.720 | ||||
Target Version | 3.3.721 | Fixed in Version | 3.3.721 | ||
Summary | 0000811: predefined define __FUNCTION__ for the name of the function | ||||
Description | __FUNCTION__ could be replaced with the name of the current function. example: int set_value(int i) { v=i; if(i) do_error(" Error in Function "+__FUNCTION__+" "); } output of set_value(1); : Error in Function set_value | ||||
Tags | No tags attached. | ||||
|
Just in case you don't know the possibility: you can already get the current lfun name with debug_info(). Or you just use debug_info() to dump some more info in addition to the name. You might argue that is consumes more ressources than necessary, but then errors should be the exception, I guess. Depending on the error it might also be a good idea to dump/store the whole stacktrace to be able to trace the source of error. At least I made the experience, that the plain info "error in function xy" usually does not help me too much. |
|
I agree with Zesstra that a __FUNCTION__ predefine is of limited use. But it's not hard to implement if we want it: https://github.com/Fuchur/ldmud/commit/07c3c3c35e6c6bf6fc11fd085f0b65b1f00c53f8 |
|
Yay, somebody submitted a patch. :-) I don't have anything against it, so from my side feel free to apply it to the trunk. (ok, now we only need to finally migrate our main repository to github...) |
|
Fuchur, do you want to take care of committing this? If not, re-assign to me. I have a comment after all: I am not sure, if the name in inline closures should not be the auto-generated name for the inline, because technically it is another function...? BTW: We moved the primary source repository now to github.com, so please either push your changes to https://github.com/ldmud/ldmud or file a pull request against it. :-) |
|
I'll push it later tonight. |
|
pushed as 6e0b4b85543c3af3ab5c7d30db2f3b12a9260466 (3.3 branch) and dae6067cf15017605b04ff85b77b0fd856e1756a (master branch) |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-09-18 08:58 | sinnvoll | New Issue | |
2012-09-18 20:25 | zesstra | Note Added: 0002150 | |
2012-09-18 20:27 | zesstra | Note Edited: 0002150 | |
2012-09-28 23:38 | fufu | Note Added: 0002151 | |
2012-09-29 14:19 | zesstra | Note Added: 0002152 | |
2012-12-08 22:09 | zesstra | Note Added: 0002172 | |
2012-12-08 22:09 | zesstra | Assigned To | => fufu |
2012-12-08 22:09 | zesstra | Status | new => assigned |
2012-12-08 22:18 | zesstra | Project | LDMud => LDMud 3.3 |
2012-12-08 22:20 | zesstra | Product Version | => 3.3.720 |
2012-12-08 22:20 | zesstra | Target Version | => 3.3.721 |
2012-12-12 15:24 | fufu | Note Added: 0002178 | |
2012-12-12 19:15 | fufu | Note Added: 0002179 | |
2012-12-12 19:16 | fufu | Status | assigned => resolved |
2012-12-12 19:16 | fufu | Fixed in Version | => 3.3.721 |
2012-12-12 19:16 | fufu | Resolution | open => fixed |