LanX has asked for the wisdom of the Perl Monks concerning the following question:
After meditating about Re^4: Screencapture with Perl on Linux I'm still confused about the widespread POD-habit to denote optional parameters in pseudo-code by enclosing them in brackets
$mech->content_as_png [TAB, COORDINATES]
(I'm don't know where this notation stems from, C, Fortran or just BNF? Where is it defined?)
Anyway it conflicts with concrete perl notation where brackets either denote
and can cause confusion.
According to the documentation for prototypesą, optional parameters are denoted by a preceding semicolon, which would lead to:
$mech->content_as_png (;TAB,COORDINATES)
other CPAN authors prefer to denote the type of arguments by indicating the sigil and avoid upper case:
$mech->content_as_png ($tab,@coordinates)
(and for completeness, some authors skip the parens around parameters others don't.)
I'm no CPAN-author yet and don't intend "to be more catholic than the pope"˛ but I'm wondering
if there is a best practice or even standard for function signatures in pseudo code???
Maybe there is some insight which can be taken from perl6-meditations/notations?
Cheers Rolf
(1) yes I know that prototype syntax is rather "restricted" for defining signatures
(2) sure I'm mathematician but still pragmatic ;)
|
---|