in reply to Function signatures in POD-headlines/pseudo code! Is there a standard?

I avoid the need for a meta notation by simply spelling out the alternatives like in Perl's docs.
=head3 C<< $mech->content_as_png() >> =head3 C<< $mech->content_as_png($tab, @coordinates) >> Returns the ...
  • Comment on Re: Function signatures in POD-headlines/pseudo code! Is there a standard?
  • Download Code

Replies are listed 'Best First'.
Re^2: Function signatures in POD-headlines/pseudo code! Is there a standard?
by LanX (Saint) on Dec 07, 2009 at 18:00 UTC
    Ok, but being precise this would lead to
    =head3 C<< $mech->content_as_png() >> =head3 C<< $mech->content_as_png( $tab ) >> =head3 C<< $mech->content_as_png( $tab, $x0, $y0, $x1, $y1 ) >>
    Hmm ... IMHO a meta-syntax can be shorter though precise, but this needs a common consensus...

    Cheers Rolf

      Occasionally, you'll get three alternatives and that's fine. If you have more than three alternatives, your function's parameter list is probably too complex and needs a redesign anyway.

        > If you have more than three alternatives, your function's parameter list is probably too complex and needs a redesign anyway.

        Good point!

        Cheers Rolf

      You can list the empty and the full signature, and mention in the prose text that they are optional, and leaving out some of them at the end is allowed too.
      but this needs a common consensus

      No. The Perl community is far too big to always reach an consensus, especially not for a topic that's subject to personal taste as much as this topic.

Re^2: Function signatures in POD-headlines/pseudo code! Is there a standard?
by Anonymous Monk on Dec 08, 2009 at 07:42 UTC
    =head3 C<< $mech->content_as_png >> $mech->content_as_png() $mech->content_as_png($tab, @coordinates)