www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Cannot access frame of <insert whatever here>

I haven't done any D coding since May, but picked up my little 
toy code again now.
Last time I had a lot of hassle with not being able to 
store/access symbols through templates, and I got the same thing 

Am I the only one hitting these all the time?

I'm basically playing around with UDAs:

 notNull class A {
    matches("[0-9]+") string s;
    interval!"[)"(0, 10) int i;
void f(A a) {
   mixin enforceValidParameters;

f(null); // Throws because a is null
f(new A()); // Throws because a.s doesn't match and i isn't 
within [0,10)

I need a mixin there because I haven't found another way of 
getting the correct function without passing any parameters. And 
the second call because the mixin cannot call any code itself, 
only declare.

.. But the above doesn't work. I have to do this instead:
void f(A a, A b) {
   validate!(a, b)();

which doesn't scale. It's bad enough that I need to run a 
function after mixing in code.

.. Just a bit of a rant - unable to access frames sucks :/
Sep 12 2013