On 26 November 2012 18:17, Manu <span dir="ltr"><<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 26 November 2012 17:44, Adam D. Ruppe <span dir="ltr"><<a href="mailto:destructionator@gmail.com" target="_blank">destructionator@gmail.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Monday, 26 November 2012 at 15:39:35 UTC, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Properties look like variables. How do I distinguish properties from proper variables?<br>
</blockquote>
<br></div>
I think this will do it:<br>
<br>
import std.traits;<br>
bool isProperty = (functionAttributes!(S.P) & FunctionAttributes.property) ? true : false<br>
<br>
<br>
<br>
The way that works in the implementation is checking the mangled name of the function. I wouldn't try anything else because any other difference between a property and a variable is arguably a bug since they are supposed to be mostly interchangable!<br>


</blockquote></div><br></div></div></div><div class="gmail_extra">That's weird. Why would I call functionAttributes in something that I can't even identify as a function? That's almost self-defeating... but as long as functionAttributes will tolerate being called with basically any argument, function or otherwise, then I guess this is okay...</div>

</blockquote></div><br></div><div class="gmail_extra">And fail! functionAttributes breaks when I pass basically anything that's not a function >_<</div>