I defined f1 several times with slight changes and Julia created different methods for them.
I guess when I executed f1(5) it was using an old method inadvertedly. I’m new to Julia.
I’ve restarted Julia and now it’s OK.
I’m going to change the title of the thread.
How can I delete an old function definition or be sure Julia is using the proper one?
You can’t do that if it’s in Main’s global scope - it’s one of the cases where you need to restart Julia.
You can do it by defining your function in a module and not exporting them though. Reloading module MyModule will then only have the methods defined for MyModule.f1 that you specify.