Re: [PATCH] gitweb: Uniquify usage of subroutine prototypes
- From
- Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
- Date
- Mar 25, 2008, 22:06 UTC
- Message-ID
- <b77c1dce0803251506y443aab5uf0134a47e9cf28de@mail.gmail.com>
- In-Reply-To
- <7vlk46lh61.fsf@gitster.siamese.dyndns.org>
On 25/03/2008, Junio C Hamano <junio@pobox.com> wrote:
> I am not saying that Perl prototypes is a bad thing. The point of the > prototype is to change the syntax and semantics so that you can write a > function to which arguments are _not_ passed as a flattend list, and > without them you cannot write something that emulates "push @a, $b, $c".
I would agree with what Junio says here. The primary motivation of prototypes was to emulate the syntax of perl built-ins, and their extension (with the _ character) in Perl 5.10 has followed this general principle. As a general rule, I tend to avoid using prototypes for 'normal' functions. That's mostly an application of the least surprise principle.