__FUNC__ in D

BCS BCS at pathlink.com
Wed Aug 15 11:05:33 PDT 2007


argl wrote:
> Sorry, stupid me forgot the declaration. I am still getting an error though.
> 
> dmd -J/tmp test3.d
> test3.d(7): Error: cannot evaluate GetLastFnDef("import tango.io.Stdout;\x0a\x0achar[] GetLastFnDef(char[] file, int line);\x0a\x0avoid main()\x0a{\x0a    const char[] fn = GetLastFnDef(import(__FILE__), __LINE__);\x0a    Stdout (\"hello {}\", fn).newline;\x0a}\x0a\x0a\x0a\x0a\x0a",7) at compile time
> 
> Any help would be appreciated.
> 
> argl Wrote:
> 

It's a hypothetical function that doesn't exist (yet). However, it's 
shouldn't be two hard to wright one that would work for most case.


More information about the Digitalmars-d-learn mailing list