www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - miss __FUNCTION__ so much

reply Davidl <Davidl 126.com> writes:
i think there wouldn't be much effort to make it ?
Apr 17 2007
parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
Davidl wrote:
 i think there wouldn't be much effort to make it ?

I think what would be better was a compile-time context object that told us what scope we were at (module, function, class, etc.), what the current enclosing symbol is called, what kind of symbol it is, what its arguments/base types are, etc., and a reference to the enclosing context as well. I mean, if we're going to do this, we may as well do it properly :) -- Daniel -- int getRandomNumber() { return 4; // chosen by fair dice roll. // guaranteed to be random. } http://xkcd.com/ v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/
Apr 17 2007
parent Dan <murpsoft hotmail.com> writes:
Daniel Keep Wrote:
 I think what would be better was a compile-time context object that told
 us what scope we were at (module, function, class, etc.), what the
 current enclosing symbol is called, what kind of symbol it is, what its
 arguments/base types are, etc., and a reference to the enclosing context
 as well.

In that light, please wait for Walter to release the AST reflection feature, as it ought to include such functionality and will also come with a reasonable API with which to access such things. Many many things are building up that want the AST reflection feature, Walter. : ) Any chance I could contribute some time on it?
Apr 17 2007