This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: automake and 'strict' Perl5
- To: Rodolphe Ortalo <Rodolphe.Ortalo@cert.fr>
- Subject: Re: automake and 'strict' Perl5
- From: "Matthew D. Langston" <langston@SLAC.Stanford.EDU>
- Date: Mon, 21 Jun 1999 12:29:18 -0700
- Cc: automake@gnu.org
- Organization: Stanford Linear Accelerator Center
- References: <376E0771.43B2@cert.fr>
Hi Rodolphe,
Rodolphe Ortalo wrote:
>
> I don't know if it can be useful and if it could help the use of
> automake, but I've successfully modified the core automake script this
> weekend to conform to stricter Perl5 syntax.
>
> More precisely, I've converted all variables to the 'my' convention
> (ie: lexical variables), introduced prototypes for all functions, and
> I've been able to produce an automake script that compiles and run
> correctly with the 'use strict;' directive enabled.
Since you didn't post your patch I wasn't able to fully appreciate your
changes. Perhaps it is a large-ish patch (it sounded like it might be),
which may be why you decided not to post it. In any event, I had a few
questions and comments concerning it.
Lexically scoping automake's variables is a good thing. It needed to be
done, and we all knew that it should be done, but it was a big project
to do correctly. Thank you for undertaking this.
However, I am not so keen on "Perl function prototypes". You mentioned
that you prototyped *all* of automake's functions, but I believe this
may do more harm than good in the long run.
As you know, a "Perl function prototype" isn't what many people think of
as a "function prototype". Since they do little more than try and force
a context on a function's arguments, they don't provide safety
(e.g. checks on the type and number of arguments, which is what many
programmers would expect a function prototype to provide) - they really
only provide an alternate notational convenience.
While this can be useful in certain contexts, our experience has found
their true usefulness to be limited, and in some cases even harmful.
Since they force a context on a function's arguments, they have often
times surprised programmers since they can make a function behave
differently.
Additionally, Perl function prototypes are useless when writing OO
modules, which is more than likely the direction that Automake is
heading.
I would suggest that any benefits which Automake would derive from Perl
function prototypes would pale in comparison to the problems I fear they
would cause. I would also worry that their introduction into automake
would hinder the "OO module" effort.
--
Matthew D. Langston
SLD, Stanford Linear Accelerator Center
langston@SLAC.Stanford.EDU
650.926.3279