I want to define two subscripted functions
Subscript[f,2]. To keep the assignments local, I would like to associate the definitions with
f if possible. My current solution is to write the following.
The resulting definition is stored as an UpValue for
f, which is acceptable for me. Is it possible to construct a similar definition using pattern matching? I am looking for an analog to the following pair of definitions.
f[x_]:=g[x] (*definition 1*) f:=Function[x,g[x]] (*definition 2*)
In other words, I am currently using a definition akin to definition 2 above for my subscripted functions. Is it possible to write a definition analogous to definition 1 above?