develooper Front page | perl.perl5.porters | Postings from January 2011

Re: Time to update

Thread Previous | Thread Next
Eric Brine
January 30, 2011 21:19
Re: Time to update
Message ID:
On Sun, Jan 30, 2011 at 2:07 PM, Mark Overmeer <> wrote:

> * Eric Brine ( [110130 02:46]:
> > On Sat, Jan 29, 2011 at 5:48 PM, Mark Overmeer <>
> wrote:
> > There's no way to simply check parameter list length using "function
> > signatures", if by that you mean prototypes,
> In the common case you can.  Of course, there are situations where it
> does not work.  A prototype of ($$)  works as well as  @_==2

I demonstrated that it isn't true. Again,

>perl -E"sub f { @_==2 or die; say qq{$_[0], $_[1]} } @a=(4,5); f(@a)"
4, 5

>perl -E"sub f($$) { say qq{$_[0], $_[1]} } @a=(4,5); f(@a);"
Not enough arguments for main::f at -e line 1, near "@a)"
Execution of -e aborted due to compilation errors.

Let's be realistic, the    exit(@args)   in the original code is a bug.
No-one is his right mind will call exit with multiple values.

Not at all. Who said anything about multiple values? And some of the
functions DO take multiple arguments. I just picked the first one I saw.

Do you really wish to keep back the evolvement of the language because
> you want to stay compatible with (all imaginable) sleeping bugs?

That is a loaded question L<>.
Doubly so, even. I resent your implications that I'm preventing some
evolution and that the code that would get broken is buggy code. I am not,
and the code is perfectly valid.

- Eric

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About