I would like to simplify some database notation, and I'm doing some tests with
UpValues for that.
For example, if I set this Upvalue fot tab1:
tab1 /: tab1.column1 = 1
When I evaluate
1 as expected. But if latter I set
column1 = "x", when I evaluate it again, I get
tab1."x" instead of
1 as I need.
There is some way that I can change this behavior? So I could get
1 and prevent variables name conflict?
To avoid missinterpretation there is the sequence of evaluation.
Quit the kernel and evaluate:
tab1 /: tab1.column1 = 1; column1 = "x"; tab1.column1
The result is
tab1."x" in the first evaluation.