develooper Front page | perl.perl5.porters | Postings from October 2012

Re: sub signatures - too few arguments

Thread Previous
Peter Martini
October 27, 2012 17:03
Re: sub signatures - too few arguments
Message ID:
On Sat, Oct 27, 2012 at 7:47 PM, Aristotle Pagaltzis <>wrote:

> * Peter Martini <> [2012-10-28 01:25]:
> > I'm not quite ready to get into optional arguments yet, just pointing
> > out that the strict vs lax debate can (will?) have repercussions so we
> > don't block our path forward.
> I think full strictness for now and telling people to use non-signature
> subs if they need to default their arguments based on existence is fine
> for the very first iteration.

It's clear I need to go to full strictness anyway :-)  My concerns at this
point are: do we want to separate the overflow and underflow strictness
checks, and can we allow the caller to disable one or both of them?

> Optional arguments will come up very quickly though. So they cannot
> honestly be punted on for long, which I am wary about.
> Regards,
> --
> Aristotle Pagaltzis // <>

I get the sense there won't be *too* much disagreement over optional
arguments, so that'll be the first order of business after the basic
signatures are sorted out.  sub foo($bar, $baz = 5) {} seems like a clear
winner, but the boundaries need to be explored further, and that's where
I'm trying not to get distracted yet.

We've got about 3 months left til contentions code freeze for 5.18, which
is something I'm keeping track of.

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