develooper Front page | perl.perl5.porters | Postings from February 2015

Re: [perl #123069] signature/attribute syntax is awful

Thread Previous | Thread Next
Aristotle Pagaltzis
February 25, 2015 03:35
Re: [perl #123069] signature/attribute syntax is awful
Message ID:
* Zefram <> [2015-02-24 17:45]:
> wrote:
> > The syntax 'sub foo :attributes ($signature) { ... }' is awful. It
> > should be 'sub foo($signature) :attributes { ... }'. (This might be
> > a candidate for bug #121481.)
> I do not approve of this change. It gives the misleading impression
> that the signature is metadata that could reasonably be examined by
> distant code. I believe the request for this change comes largely from
> people misunderstanding signatures in precisely that manner.

I believe you are mistakenly deriving Ought from Is here. Sure, it *is*
not currently metadata in such a way, but that is not an argument either
way about whether it *ought* to be such metadata.

> > It's also what perl itself does in C. :-)
> >
> >   OP* Perl_newDEFSVOP(pTHX) __attribute__((warn_unused_result));
> Utterly irrelevant, because of fundamental differences between the two
> languages. […] Ultimately, gcc's placement of the attribute clause in
> the syntax is an arbitrary choice.

Perl itself is Larry’s thesis that both claims that you are making here
about language design are wrong. (That mathematical/logical consistency
has primacy and that all remaining choices are axiomatically arbitrary.)

Aristotle Pagaltzis // <>

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