diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-11 22:15:05 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-12 06:28:09 -0700 |
commit | 93e6f00ed5ef68c787902ea1f88084f619b59561 (patch) | |
tree | 902af54a60b115dfb20e2d4b4c30042a5ce19ddd /pod | |
parent | 1766075810712c2dd8a5fd6ced3ee862f7de045c (diff) | |
download | perl-93e6f00ed5ef68c787902ea1f88084f619b59561.tar.gz |
Revert "[perl #95550] Remove prototypes from (l)stat"
It turns out this problem is more knotty than I initially realised.
stat had a prototype of (*), even though it could be called with no
arguments. Since the (*) prototype does not parse its argument the
same way that stat parses *its* argument, I thought that changing (*)
to (;*) would be no better, since it’s still not correct. So I simply
set the prototype to undef.
My thinking was faulty, for two reasons:
• The prototype serves to indicate the precedence, not just the types
of arguments. An undefined prototype on an overridable prefix func-
tion implies that it takes a list. So this causes problems for the
imminent &CORE::subs feature, as there is not yet a clean mechanism
for CVs to parse their arguments.
• The (*) prototype character does not parse the same way as *any*
built-in function with that character in its prototype. So stat is
no worse than any other built-in. It doesn’t make sense to remove
the prototype from stat without removing it from about 40 other
built-in functions; and that’s where pedantry conflicts with
usefulness.
This commit restores the (*) prototype to stat and lstat. The next
commit will give it a (;*) prototype, as that matches it more closely.
It’s not perfect, but it’s no worse that other built-ins with a * in
their prototypes.
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perldelta.pod | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index ba0d3a51f2..120cafec0a 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -462,12 +462,6 @@ was just wrong. =item * -The prototypes for the core functions C<stat> and C<lstat> have been -removed, as they were incorrect, because their syntax cannot be replicated -by Perl subroutines. - -=item * - Most dereferencing operators (C<${}>, etc.) used to call C<FETCH> twice on a tied operand when doing a symbolic dereference (looking up a variable by name, which is not permitted under C<use strict 'refs'>). Only C<&{}> did |