Ltac is used for automating proofs and modifying proof environment, outputting strings and defining complex notations. Can it be also used for "smart" modifications of Coq environment? Here are two failed attempts:
Variable Phy: Set.
Fail Let pp (x:Type) := ltac: (match type of x with
| Set => constr: (Reset Phy)
| _ => idtac end).
(*Cannot infer an internal placeholder of type "Type" in environment: x : Type*)
Fail Ltac pp x := match type of x with
| Set => constr: (Reset Phy)
| _ => idtac end.
(*The reference Reset was not found in the current environment.*)
Also, if this isn't a job for Ltac, maybe there's another way?