summaryrefslogtreecommitdiff
path: root/pod/perlsyn.pod
Commit message (Collapse)AuthorAgeFilesLines
* Implement facility to plug in syntax triggered by keywordsJesse Vincent2009-11-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Better wording for the hash ~~ array docsRafael Garcia-Suarez2009-10-271-2/+2
| | | | (suggested by Aristotle Pagaltzis -- see [perl #69957])
* better document smart match overloadingDavid Mitchell2009-08-221-2/+12
|
* incremental improvement in ~~ documentation, already in maint-5.10Chip Salzenberg2009-08-201-9/+8
|
* Thinko in given() description, found by chromaticRafael Garcia-Suarez2009-07-241-1/+1
|
* Make C<undef ~~ 0> and C<undef ~~ ""> not match (like in 5.10.0)Rafael Garcia-Suarez2009-07-011-0/+1
| | | | | | 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.
* Minor doc fix for the smart table legend (clarify the "Object" entry).Rafael Garcia-Suarez2009-06-011-3/+2
|
* Remove now-obsolete note on ~~ overloading working only on the right.Rafael Garcia-Suarez2009-05-251-3/+1
|
* Allow ~~ overloading on the left side, when the right side is a plain scalarRafael Garcia-Suarez2009-05-241-0/+1
|
* Change the specs of %h~~%h to avoid mentioning ~~ recursivelyRafael Garcia-Suarez2009-05-241-1/+1
|
* Remove proposed (but unimplemented) $foo ~~ Range smart matching.Rafael Garcia-Suarez2009-05-121-11/+3
| | | | | | | | | | | 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.)
* Document what to do with object on the left and add some TODO tests for thatRafael Garcia-Suarez2009-05-081-2/+3
|
* Merge branch 'blead' into smartmatchRafael Garcia-Suarez2009-05-051-2/+21
|\ | | | | | | | | Conflicts: t/op/switch.t
| * Document when as a syntax modifierVincent Pit2009-03-301-2/+21
| |
* | Clarify that @a ~~ @b recursively smart matchesRafael Garcia-Suarez2009-05-051-2/+2
| |
* | Remove some empty lines in a code exampleRafael Garcia-Suarez2009-04-201-5/+0
| |
* | Document that ~~ overload will only work on the RHSRafael Garcia-Suarez2009-04-201-4/+5
| |
* | Adjustments to the ~~ dispatch tableRafael Garcia-Suarez2009-03-251-2/+5
| | | | | | | | | | | | | | | | 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".
* | Fix equivalent code in perlsyn for Array~~HashRafael Garcia-Suarez2009-03-241-1/+1
| | | | | | | | | | | | 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).
* | Specify that the behaviour of $foo ~~ Range should only depend on the RHSRafael Garcia-Suarez2009-03-241-3/+3
| | | | | | | | (and not from the value being checked, as Zefram remarks)
* | Make []~~\&f and {}~~\&f matchRafael Garcia-Suarez2009-03-241-3/+3
| | | | | | | | (Zefram remarks that all(empty set) is true)
* | Implement "~~ $scalar" for numbers and stringsRafael Garcia-Suarez2009-03-241-2/+1
| | | | | | | | | | Make documentation more precise about the different cases, and add tests.
* | Revert order of ~~ in definition of smart matching against arraysRafael Garcia-Suarez2009-03-231-3/+2
| | | | | | | | | | | | | | | | 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.
* | Add more tests with an empty hash on the right of ~~Rafael Garcia-Suarez2009-03-231-1/+1
| |
* | Document that empty sets don't smart-matchRafael Garcia-Suarez2009-03-171-16/+17
| | | | | | | | (and implement this for the C<~~ coderef> form)
* | The new smart match dispatch table for 5.10.1 onwardsRafael Garcia-Suarez2009-03-041-26/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Document that when() treats specially most of the filetest operatorsRafael Garcia-Suarez2009-03-041-0/+5
| |
* | Make // behave like || in when clausesRafael Garcia-Suarez2009-03-041-7/+8
|/ | | | (plus minor documentation updates about "when")
* perlsyn: equivalent code for HASH ~~ ARRAYbrian d foy2008-06-081-1/+1
| | | | | Message-ID: <070620082359221579%brian.d.foy@gmail.com> p4raw-id: //depot/perl@34027
* Correct misleading example in perlsyn.pod (given/when/default)Paul Fenwick2008-03-121-1/+1
| | | | | Message-ID: <47D73DA3.8050300@perltraining.com.au> p4raw-id: //depot/perl@33488
* Small documentation nitsSébastien Aperghis-Tramoni2008-01-021-5/+5
| | | | | Message-Id: <2AF110D6-9183-47C5-BBBA-26C3FB97C3D3@free.fr> p4raw-id: //depot/perl@32805
* Re: smart match: array ~~ hashDmitry Karasik2007-11-301-1/+1
| | | | | | | Message-ID: <20071128204959.GA68977@tetsuo.karasik.eu.org> plus more tests. p4raw-id: //depot/perl@32559
* Improve example codeJan Dubois2007-11-211-1/+1
| | | | | | From: "Jan Dubois" <jand@activestate.com> Message-ID: <076601c82bce$a4fcfe00$eef6fa00$@com> p4raw-id: //depot/perl@32430
* There is no more a ~~ feature, noticed by Moritz LenzRafael Garcia-Suarez2007-06-051-4/+2
| | | p4raw-id: //depot/perl@31334
* The Perl 6 specification is still evolving, so don't refer to it.Rafael Garcia-Suarez2006-12-221-10/+3
| | | p4raw-id: //depot/perl@29613
* perlsyn incomplete duplicate definition of truthDaniel Frederick Crisman2006-08-271-1/+1
| | | | | Message-ID: <20060824212957.GA32557@fury.crisman.org> p4raw-id: //depot/perl@28764
* The smart match table was duplicated in source code and in perlsyn,Rafael Garcia-Suarez2006-06-041-1/+3
| | | | | so remove the one in the source code p4raw-id: //depot/perl@28349
* Differences from Perl 6Robin Houston2005-12-301-0/+35
| | | | | Message-ID: <20051230134534.GA18675@rpc142.cs.man.ac.uk> p4raw-id: //depot/perl@26537
* Regenerate perlapi.pod.Rafael Garcia-Suarez2005-12-221-4/+4
| | | | | Fix indentation of code examples in perlsyn. p4raw-id: //depot/perl@26443
* switch / ~~ doccosRobin Houston2005-12-221-10/+97
| | | | | Message-ID: <20051221135118.GC26527@rpc142.cs.man.ac.uk> p4raw-id: //depot/perl@26442
* Fix internal broken link ; reindent code examplesRafael Garcia-Suarez2005-12-191-24/+21
| | | p4raw-id: //depot/perl@26408
* latest switch/say/~~Robin Houston2005-12-191-109/+122
| | | | | Message-Id: <20051217204431.GB28940@rpc142.cs.man.ac.uk> p4raw-id: //depot/perl@26400
* POD index entries with X<>Ivan Tubert-Brohman2005-10-131-0/+27
| | | | | Message-ID: <434D9A32.4050305@cpan.org> p4raw-id: //depot/perl@25748
* Missed a chunk in previous commitRafael Garcia-Suarez2005-06-201-0/+2
| | | p4raw-id: //depot/perl@24903
* [perl #36328] Until Statement Undocumented Eric Amick2005-06-201-0/+2
| | | | | | 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
* [perl #33765] [PATCH] perlop: mention why 'print !!0' doesn't Steve Peters2005-05-111-0/+3
| | | | | | | | | | | | 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
* Make everyone stop posting to p5p about 0e0.Abhijit Menon-Sen2003-10-101-3/+0
| | | p4raw-id: //depot/perl@21435
* "Are implicit undefs true?" asks Gisle.Abhijit Menon-Sen2003-10-081-3/+2
| | | p4raw-id: //depot/perl@21422
* Minor tweaks to pod/perlsyn.pod (as suggested by Yves Orton),Abhijit Menon-Sen2003-10-071-7/+7
| | | | | sv.c (Tim Bunce), t/op/pow.t (John P. Linderman). p4raw-id: //depot/perl@21420
* Re: [PATCH] perlsyn.pod Revision - ResendShlomi Fish2003-10-061-25/+57
| | | | | | Message-Id: <Pine.LNX.4.56.0310031233580.28640@vipe.technion.ac.il> (Applied with minor tweaks.) p4raw-id: //depot/perl@21405