I'm working with an own package of functions. During development I noticed, that my naming scheme is not that clever; for example some of my functions are starting with capital letters. But I have several files working with that package, that I would like to be able to use further on with as few as possible. So my idea is, to write a small package named loadOldNamsor something like that, providing the old function names additionally.

Therefore I'm facing the following problem:

Having a function with my new name - for simplification just f, e.g.

f[x_] := x^2;
f[x_, y_] := x^2 y^2;
f::usage = "A test usage text";

I would like to define a function having the old name (say g), such that all cases 'g[x], g[x,y]and the::usagealso work withg`.

Just f=g; or f:=g; won't work, so

How do I get a function with the name g doing exactly the same as f (just having another name)?

  • 1
    $\begingroup$ Luckily, this very same question was asked just a couple of days ago and has a very nice answer that would be perfect for your case :) Let me know if it isn't (and why) and we can reopen this one with the specific problem. $\endgroup$
    – rm -rf
    Feb 23, 2013 at 18:38
  • $\begingroup$ Wow! I tried to search some words, but didn't come up with those; actually your posted Question does even more that I wanted. With the mentioned Operator that even gets nicer than i thought. It's perfect - and you were very fast :) $\endgroup$
    – Ronny
    Feb 23, 2013 at 18:40
  • $\begingroup$ You're welcome :) $\endgroup$
    – rm -rf
    Feb 23, 2013 at 18:46


Browse other questions tagged or ask your own question.