On 26 November 2012 14:31, 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>1.</div><div><br></div>enum i = 10;<div>pragma(msg, is(i == enum) || is(typeof(i) == enum)); // <- false?!<br></div><div><br></div><div>I can't find a way to identify that i is an enum, not a variable; can not be assigned, has no address, etc.</div>
<div><br></div><div><br></div><div>2.</div><div><br></div><div>import std.stdio;</div><div>pragma(msg, !is(std) && is(typeof(std))); // <- true?!</div><div><br></div><div>std.stdio is a module, it looks like a variable. typeof(std) == void... What the? Why does it even have a type?</div>
<div>I can't find a sensible way to distinguish std from any other regular variable.</div>
</blockquote></div><br></div><div class="gmail_extra">And a new one!</div><div class="gmail_extra"><br></div><div class="gmail_extra">3.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Properties look like variables. How do I distinguish properties from proper variables?</div>
<div class="gmail_extra">struct S</div><div class="gmail_extra">{</div><div class="gmail_extra"> @property int P() { return 10; }</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">
pragma(msg, is(typeof(S.P) == function)) // false?!</div>