I have the Symbol
e with some upvalues and ownvalues:
f[e] = 1; g[e] = 2; e = 3;
I would like the evaluator to evaluate the definitions in that order. Currently, I get
f[e] (* f *)
f[e] (* 1 *)
The evaluator applies the ownvalues before the downvalues, this is documented. I want it to apply the downvalues first, then use the ownvalues. I'm sure there's some clever way of making this happen, I can't imagine this is too uncommon, but perhaps it is. I would prefer a solution that doesn't rely on $Pre, but beggers can't be choosers. The most ideal would be some attribute/thing I can attach to the symbol
Edit Ok, I feel like the answers given give me enough to work with on my own. I had thought of trying a conditional ownvalue but didn't know how to implement it. Leonid Shifrin's solution shows how, and confirms my suspicions that it is an inefficient and fragile solution. Nonetheless, I don't think there is too much need to keep it open, and I will accept Leonid's solution and Michael E2's attribute method (which I probably should have thought of myself). Thanks for the help yall.