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:22
Re: [perl #123069] signature/attribute syntax is awful
Message ID:
* Ricardo Signes <> [2015-02-24 18:45]:
> * Zefram <> [2015-02-24T12:37:26]
> > That the signature is part of the body is not an implementation
> > detail, it is fundamental to the definition of signatures.
> As far as the programmer who is writing a subroutine with a signature
> is concerned, how is this relevant, let alone fundamental?

There is exactly one actual point of relevance: forward declarations.

You can’t put a signature on one of those.

At least, last we discussed what to do, there was a can of worms in the
question of what each combination of absence vs presence of a signature
in the forward declaration vs the actual sub could mean, particularly in
light of pre-existing code.

It was this consideration that made me think and argue, at that time,
that signatures ought to come after attributes.

In retrospect, that just violates expectation – even my own! – too much.

So this point of contradiction will require some other resolution. And
maybe it’ll be ugly, with special-casey behaviour instead of a nice,
coherent inner logic, but I now believe that price has to be paid.

Aristotle Pagaltzis // <>


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