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

Re: [perl #100190] RFE: fix sprintf to be consistent with printf andbe useful!

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
November 11, 2011 13:03
Subject:
Re: [perl #100190] RFE: fix sprintf to be consistent with printf andbe useful!
Message ID:
20111111210335.GA11156@plum.flirble.org
On Wed, Oct 05, 2011 at 05:20:17PM -0700, Father Chrysostomos via RT wrote:
> On Wed Oct 05 16:13:07 2011, LeonT wrote:
> >  On Wed, Oct 5, 2011 at 11:38 PM, Brian Fraser <fraserbn@gmail.com> wrote:
> > > And it's not like prototypes haven't been changed before (to tchrist's
> > > chagrin, e.g.
> > >
> http://www.nntp.perl.org/group/perl.perl5.porters/2011/04/msg171420.html).
> > 
> > Most of the changes are completely backwards compatible
> 
> In fact, most of the changes merely demonstrate how buggy prototype()
> has been in the past.  Many of the prototypes it has returned (even in
> 5.14) do not represent how the function is actually parsed.

I think we're all agreeing, and I'd like to add to it:

I think it's worth remembering that prototypes date from 5.003
The core parser dates from, well, Perl 1. Perl 5 attempted to regularise
the parser.

Prototypes were added (if I understand it correctly) mainly to permit one to
define functions that behaved like core builtins. The core's parser doesn't
use prototypes to parse the builtins.

Prototypes are attempting to converge on the core parser, not the other way.
When prototypes have been changed, I think it's usually without changes to
the core parser - ie it's trying to better approximate what the core parser
does.


Changing the "prototype" of a core builtin for the intent of changing
behaviour doesn't actually mean changing the prototype. That's a derived
property. It actually means changing the parser. Changing the parser is quite
possible. But it's not just "a function in isolation".

So I think it's important to realise what level the change is actually at.

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About