git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: Uniquify usage of subroutine prototypes

From
RGRafael 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.

Previous: Junio C Hamano
Message 3 of 3 in “gitweb: Uniquify usage of subroutine prototypes”
  1. gitweb: Uniquify usage of subroutine prototypesJakub Narebski, Mar 25, 2008
  2. Junio C HamanoMar 25, 2008
  3. Rafael Garcia-SuarezMar 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.