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

Re: sub signatures - status - I'm going quiet for a while ...

Thread Previous | Thread Next
Aaron Crane
November 1, 2012 03:23
Re: sub signatures - status - I'm going quiet for a while ...
Message ID:
Reini Urban <> wrote:
> On 10/29/2012 06:20 AM, Paul LeoNerd Evans wrote:
>> "proto" could conceivably also mean "protocol". "prototype" is nicely
>> explicit.
>> And also aligns with the CORE::prototype() function to retrieve it.
> But it doesn't align with perl6 and signatures, which already use proto.

I don't follow your reasoning there.  Perl 6 uses the term "signature"
for the thing that describes a subroutine's formal parameters; that
terminology is widely used, including by relevant Perl 5 modules on
CPAN.  Perl 6 further uses the term `proto` (in code) or "prototype"
(in prose) to denote the thing that all the multimethod versions of a
subroutine (or grammar rule) must conform to.  This isn't at all the
same thing as Perl 5's prototypes, of course.

In fact, I think the Perl 6 facts offer another argument in favour of
choosing `:prototype` over `:proto` in Perl 5, beyond the ones that
Paul mentions above: the `proto` token in Perl 6 does something
completely different, so picking `:prototype` would reduce the risk of
confusion between Perl 5 and Perl 6 prototypes.


Specifically, that's a suggestion that a future version of
Method::Signatures might use `is proto` to set the Perl 5 prototype
for a signatureful subroutine.  It is just a suggestion — not a report
on experiences of using something of that sort, or even a description
of a working feature.  So while it's certainly useful to mine it for
ideas, I don't think it's compulsory for a core signature mechanism to
follow it exactly.

Aaron Crane **

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