Define a constant that mimics the behavior of internal constants



Hello,

I'd like to replicate the behavior of built-in constants like %pi or %e 
for custom constants. I.e. the constant should be displayed as a symbol 
by default and only be substituted by its numeric value upon request.

E.g. for the custom constant %2pi = 2*%pi:
The line "3 * %2pi;" should result in "3 %2pi;" and not in "6 %pi;".
The line "3 * %2pi, numer;" should result in "18.84955592153876".
The line "sin( %2pi);" should result in "0".

I guess another way to frame this question would be: Where and how are 
the internal constants defined?

Thanks!
Luj Omu