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
From:
Reini Urban
Date:
November 1, 2012 08:26
Subject:
Re: sub signatures - status - I'm going quiet for a while ...
Message ID:
CAHiT=DGQ8gaw3OhqGj7Y6ithnZBa-MNRxvm0ryQWiqLEzPNoSg@mail.gmail.com
On Thu, Nov 1, 2012 at 5:22 AM, Aaron Crane <perl@aaroncrane.co.uk> wrote:
> Reini Urban <rurban@x-ray.at> 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.
>>
>> http://perlcabal.org/syn/S06.html#Named_parameters
>
> 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.

Yes, you are right.
Perl6 proto means defgeneric, not signature parsing rules.

Thanks.

>> http://search.cpan.org/~barefoot/Method-Signatures-20120523/lib/Method/Signatures.pm#How_does_this_relate_to_Perl's_built-in_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.

-- 
Reini Urban
http://cpanel.net/   http://www.perl-compiler.org/

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