| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Date: Tue, 27 Oct 2009 01:29:40 +0000
From: Zefram <zefram@fysh.org>
To: perl5-porters@perl.org
Subject: bareword sub lookups
Attached is a patch that changes how the tokeniser looks up subroutines,
when they're referenced by a bareword, for prototype and const-sub
purposes. Formerly, it has looked up bareword subs directly in the
package, which is contrary to the way the generated op tree looks up
the sub, via an rv2cv op. The patch makes the tokeniser generate the
rv2cv op earlier, and dig around in that.
The motivation for this is to allow modules to hook the rv2cv op
creation, to affect the name->subroutine lookup process. Currently,
such hooking affects op execution as intended, but everything goes wrong
with a bareword ref where the tokeniser looks at some unrelated CV,
or a blank space, in the package. With the patch in place, an rv2cv
hook correctly affects the tokeniser and therefore the prototype-based
aspects of parsing.
The patch also changes ck_subr (which applies the argument context and
checking parts of prototype behaviour) to handle subs referenced by an
RV const op inside the rv2cv, where formerly it would only handle a gv
op inside the rv2cv. This is to support the most likely kind of modified
rv2cv op.
[This commit includes the Makefile.PL for XS-APITest-KeywordRPN missing
from the original patch, as well as updates to perldiag.pod and a
MANIFEST sort]
|
|
|
|
| |
(suggested by Aristotle Pagaltzis -- see [perl #69957])
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This makes ~~ commutative with regard to undef, and fixes an
inconsistency, since C<undef ~~ [0]> was not matching, and ~~
should be distributive in this case.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The reasons for that are :
- $_ ~~ 1..42 actually parses as ($_ ~~ 1) .. 42
- in when(), a range 1..42 will be expanded, and not treated as a
boolean flip-flop operator
- It will not distribute properly with array smart-matching, as
in $foo ~~ [1, 2, [4..5]] (that won't match for $foo = 4.2 for
example.)
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
t/op/switch.t
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Hash slice existence now uses 'exists' instead of the complex recursive
invocation to ~~.
Any ~~ Array matches now keep the "any" element on the LHS of the smart
match. More special cases have been added for complex values of "Any".
|
| |
| |
| |
| |
| |
| | |
It's an "any", not an "all". The synopsis 3 for Perl 6 has this code :
when $_ is an Array, and X is a Hash, $_ ~~ X means X.{any @$_}:exists.
Note that the implementation is right already (and was right in 5.10).
|
| |
| |
| |
| | |
(and not from the value being checked, as Zefram remarks)
|
| |
| |
| |
| | |
(Zefram remarks that all(empty set) is true)
|
| |
| |
| |
| |
| | |
Make documentation more precise about the different cases,
and add tests.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This allows to remove a special case (Hash ~~ Array).
We're also going to reuse ~~ in the Array ~~ Hash smart match
definition.
More tests will be needed.
|
| | |
|
| |
| |
| |
| | |
(and implement this for the C<~~ coderef> form)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This /does/ break backwards compatibility. Changes to come are:
- ~~ is no longer commutative. Dispatch is now done based on the
(run-time) type of the right side argument.
- The right side can be a ".." range, which will be treated specially,
and no longer as a boolean operator (as in scalar context).
- when() should treat "..." as a boolean operator.
- Coderefs with an empty prototype are no longer special.
- Any ~~ Array distributes the smart match test.
- Comparing two coderefs is no longer a special case and does not
perform referential equality. (Use \&foo ~~ "".\&bar for that.)
This patch also documents that ~~ won't work on objects that don't
overload it, except in the expression $object ~~ undef.
|
| | |
|
|/
|
|
| |
(plus minor documentation updates about "when")
|
|
|
|
|
| |
Message-ID: <070620082359221579%brian.d.foy@gmail.com>
p4raw-id: //depot/perl@34027
|
|
|
|
|
| |
Message-ID: <47D73DA3.8050300@perltraining.com.au>
p4raw-id: //depot/perl@33488
|
|
|
|
|
| |
Message-Id: <2AF110D6-9183-47C5-BBBA-26C3FB97C3D3@free.fr>
p4raw-id: //depot/perl@32805
|
|
|
|
|
|
|
| |
Message-ID: <20071128204959.GA68977@tetsuo.karasik.eu.org>
plus more tests.
p4raw-id: //depot/perl@32559
|
|
|
|
|
|
| |
From: "Jan Dubois" <jand@activestate.com>
Message-ID: <076601c82bce$a4fcfe00$eef6fa00$@com>
p4raw-id: //depot/perl@32430
|
|
|
| |
p4raw-id: //depot/perl@31334
|
|
|
| |
p4raw-id: //depot/perl@29613
|
|
|
|
|
| |
Message-ID: <20060824212957.GA32557@fury.crisman.org>
p4raw-id: //depot/perl@28764
|
|
|
|
|
| |
so remove the one in the source code
p4raw-id: //depot/perl@28349
|
|
|
|
|
| |
Message-ID: <20051230134534.GA18675@rpc142.cs.man.ac.uk>
p4raw-id: //depot/perl@26537
|
|
|
|
|
| |
Fix indentation of code examples in perlsyn.
p4raw-id: //depot/perl@26443
|
|
|
|
|
| |
Message-ID: <20051221135118.GC26527@rpc142.cs.man.ac.uk>
p4raw-id: //depot/perl@26442
|
|
|
| |
p4raw-id: //depot/perl@26408
|
|
|
|
|
| |
Message-Id: <20051217204431.GB28940@rpc142.cs.man.ac.uk>
p4raw-id: //depot/perl@26400
|
|
|
|
|
| |
Message-ID: <434D9A32.4050305@cpan.org>
p4raw-id: //depot/perl@25748
|
|
|
| |
p4raw-id: //depot/perl@24903
|
|
|
|
|
|
| |
From: Eric Amick (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.0.11-36328-115949.3.38667506136829@perl.org>
p4raw-id: //depot/perl@24902
|
|
|
|
|
|
|
|
|
|
|
|
| |
From: Steve Peters via RT <perlbug-followup@perl.org>
Date: 11 May 2005 16:58:22 -0000
Message-Id: <rt-3.0.11-33765-112475.14.5633321030279@perl.org>
Subject: [perl #33766] [PATCH] perldoc -f split lacks basic null example
From: Steve Peters via RT <perlbug-followup@perl.org>
Date: 11 May 2005 17:13:29 -0000
Message-Id: <rt-3.0.11-33766-112476.1.84217630998887@perl.org>
p4raw-id: //depot/perl@24449
|
|
|
| |
p4raw-id: //depot/perl@21435
|
|
|
| |
p4raw-id: //depot/perl@21422
|
|
|
|
|
| |
sv.c (Tim Bunce), t/op/pow.t (John P. Linderman).
p4raw-id: //depot/perl@21420
|
|
|
|
|
|
| |
Message-Id: <Pine.LNX.4.56.0310031233580.28640@vipe.technion.ac.il>
(Applied with minor tweaks.)
p4raw-id: //depot/perl@21405
|