On Thursday, 25 December 2014 at 16:24:10 UTC, Danny wrote:
Adam: Thanks, that was very illuminating! I tried and these
work indeed.
Is there a function like opDispatch which can be used (at
compile time) to refer to something by name wh ether or not
it's custom? (to access something like "value.a" safely. mixin
and string concatenation looks like would have problems with
special characters easily)
(Something like getattr(x, "a") in Python)
http://dlang.org/traits
__traits(getMember, x, "a").
Not sure how that works together with opDispatch. I am not sure
why you see safety reasons at compile time though. If there is no
such attribute, you'll just get an error.