Distinguish two functions with the same name?

  • Magnus Persson

    Magnus Persson - 2006-05-27

    Im documenting an PHP and Javascript project and due to the nature of it (callbacks) PHP functions correspond to similar Javascript functions.

    Docs mention "...only include parameters in the topic name if you need to distinguish between two functions with the same name."

    But i cant see how <myfunction> can distinguish from two functions named myfunction?

    • Greg Valure

      Greg Valure - 2006-05-27

      Documenting with parameters means writing

      // Function: myfunction (int, int)

      or something similar. You can put anything you want in the parenthesis after the title and it won't break the prototype matching. The effect of this is you always have to write <myfunction (int, int)> to link to that function now. Just <myfunction> won't work, hence you should only use it when absolutely necessary.

      In your case you can have something like myfunction(php) and myfunction(js), but by doing that you'll lose the ability to link to just <myfunction>. I realize this may be less than ideal, but it's all that can be done with the current version. If you really want you can have a text file that has topics like this in case you forget to do it somewhere:

      Function: myfunction

      See <myfunction(php)> or <myfunction(js)>.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks