1

Suppose that I have the function f[a][x_]:= x^2 and I want to save it in a .m file, then if I do Save["/path/",{x,f[a]}] doesn't work.

My first question is why it doesn't work and the second is what is actually the first argument of the f, i.e. the [a].

hal
  • 783
  • 3
  • 14

1 Answers1

6

You need to use symbols or lists of symbols as the second argument of Save. So for:

f[a][x_] := x^2

you would use:

Save["test.m", f]

Check:

Import["test.m", "String"]

"f[a][x_] := x^2 "

Carl Woll
  • 130,679
  • 6
  • 243
  • 355