<div><div>The idea here was to create a base class. That base class would have a function register() which took a function name or function pointer, and create a delegate at compile time. register() would add the delegate  and the function name as a string into the hash. At runtime, I pass in the string, get the delegate and invoke the function.</div>

<div><br></div><div>So I need both the function name as a symbol (to create the delegate) and the function name as a string. In c++ I'd use the preprocessor to convert the symbol to a string via "#" (stringify).<div>

</div></div><div><br></div><div>If D doesn't have this, the callers will have to do:</div><div><br></div><div>     register(bob, "bob");</div><div><br></div><div>which is a little tedious.</div><div><br></div>
<div>BTW I tried:</div><div><br></div><div>   public void register(string name)   {     </div><div>     auto func = __traits(getMember, this, name);</div><div><br></div><div>but __traits() only works at compile time, but variable name is only available at run-time....</div>
<div><br></div><div>John</div><div><br></div><div><div class="gmail_quote">On Sat, Oct 22, 2011 at 8:45 PM, Robert Jacques <span dir="ltr"><<a href="mailto:sandford@jhu.edu" target="_blank">sandford@jhu.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Sat, 22 Oct 2011 21:17:09 -0400, J Arrizza <<a href="mailto:cppgent0@gmail.com" target="_blank">cppgent0@gmail.com</a>> wrote:<br>


<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This would be easier with "stringify":<br>
     register(bob, #bob);<br>
<br>
Anything like that in D?<br>
<br>
John<br>
</blockquote>
<br></div>
What do you mean by "stringify"? Wouldn't register!bob be superior?<br>
</blockquote></div><br><br>
</div></div>