This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
subroutine signatures
authorZefram <zefram@fysh.org>
Sat, 1 Feb 2014 01:27:13 +0000 (01:27 +0000)
committerZefram <zefram@fysh.org>
Sat, 1 Feb 2014 01:27:15 +0000 (01:27 +0000)
commit30d9c59b5f3cba8b5d632d20c2370e82d8ba69ca
tree989db43c82b395cec053b341532db7a145827254
parentef463b6d87c1ce4e4946bdf785d47e481c1f33f2
subroutine signatures

Declarative syntax to unwrap argument list into lexical variables.
"sub foo ($a,$b) {...}" checks number of arguments and puts the
arguments into lexical variables.  Signatures are not equivalent to the
existing idiom of "sub foo { my($a,$b) = @_; ... }".  Signatures are only
available by enabling a non-default feature, and generate warnings about
being experimental.  The syntactic clash with prototypes is managed by
disabling the short prototype syntax when signatures are enabled.
23 files changed:
MANIFEST
embed.fnc
embed.h
feature.h
lib/feature.pm
lib/warnings.pm
op.h
perly.act
perly.c
perly.h
perly.tab
perly.y
pod/perldiag.pod
pod/perllexwarn.pod
pod/perlsub.pod
proto.h
regen/feature.pl
regen/warnings.pl
t/lib/warnings/op
t/op/lexsub.t
t/op/signatures.t [new file with mode: 0644]
toke.c
warnings.h