[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r17771 - branches/bdb-fixes/tools/dev

From: David James <james82_at_gmail.com>
Date: 2005-12-19 22:01:09 CET

On 12/13/05, brane@tigris.org <brane@tigris.org> wrote:
> * tools/dev/stress.pl: "Use strict", add prototypes and prefix all die
> messages with "stress.pl" to make them stand out from Subversion
> errors.

Why add prototypes? In C, function prototypes enable compile-time type
checking of function arguments, and are generally a good thing. Perl
prototypes aren't designed to do that. Instead, the "$" prototype adds
an implicit typecast in front of function arguments, converting arrays
and hashes into scalar arguments. For example, the "$" prototype
converts an array of letters ("a",b","c","d") into a count of the
number of elements (e.g. "4"). Is this really what you want to do?

See the following mail for more information on how prototypes work:
  http://mail.pm.org/pipermail/wellington-pm/2004-November/000211.html

Cheers,

David

--
David James -- http://www.cs.toronto.edu/~james
Received on Mon Dec 19 22:03:58 2005

This is an archived mail posted to the Subversion Dev mailing list.