summaryrefslogtreecommitdiff
path: root/pod/perlsyn.pod
Commit message (Collapse)AuthorAgeFilesLines
* add a mention of smartmatch being deprecatedKaren Etheridge2023-04-301-1/+2
|
* perlsyn: Clarify loop localizationEugen Konkov2022-04-161-2/+2
| | | | | | Currently `foreach` and `for` loops are synonyms. Thus implicit localization occurs not only for `foreach`. This change clarifies that implicit localization occurs depending on style
* Document the new try/catch/finally syntaxPaul "LeoNerd" Evans2022-01-201-1/+26
|
* Pod improvements suggested by Matthew HorsfallNicholas Clark2021-10-151-7/+7
|
* n-at-a-time for loops now warn by default (as 'experimental::for_list').Nicholas Clark2021-10-151-0/+1
|
* Regression tests and documentation for n-at-a-time for.Nicholas Clark2021-10-151-0/+37
|
* Create `defer` syntax and `OP_PUSHDEFER` opcodePaul "LeoNerd" Evans2021-08-251-0/+81
| | | | | | | | | | | | | | | Adds syntax `defer { BLOCK }` to create a deferred block; code that is deferred until the scope exits. This syntax is guarded by use feature 'defer'; Adds a new opcode, `OP_PUSHDEFER`, which is a LOGOP whose `op_other` field gives the start of an optree to be deferred until scope exit. That op pointer will be stored on the save stack and invoked as part of scope unwind. Included is support for `B::Deparse` to deparse the optree back into syntax.
* collapse 3 whitespace to 2Karen Etheridge2021-08-201-4/+4
|
* fix typo in podKaren Etheridge2021-08-061-1/+1
|
* perlsyn: note that v5.36 will not enable "switch"Ricardo Signes2021-07-251-1/+1
|
* Document that caller() does not see try{} blocksPaul "LeoNerd" Evans2021-03-191-0/+7
|
* Use the wording 'subroutine signatures' more consistently in perlsyn.podPaul "LeoNerd" Evans2021-02-201-1/+1
|
* Document and test that do {try/catch} behaves as expected; yielding the ↵Paul "LeoNerd" Evans2021-02-141-0/+16
| | | | final expression value
* Specifically document that return/goto/next/last/redo work as expected ↵Paul "LeoNerd" Evans2021-02-091-1/+8
| | | | inside both try {} and catch {} blocks
* Emphasize need for variable declaration after 'catch'James E Keenan2021-02-071-1/+1
| | | | For: https://github.com/Perl/perl5/issues/18541
* Grammar: predicate should "agree by number" with subjectJames E Keenan2021-02-061-1/+1
|
* Initial attempt at feature 'try'Paul "LeoNerd" Evans2021-02-041-0/+40
| | | | | | | | | * Add feature, experimental warning, keyword * Basic parsing * Basic implementation as optree fragment See also https://github.com/Perl/perl5/issues/18504
* perlsyn.pod - Minor rewording for while/untilRichard Leach2021-02-011-1/+1
| | | Originally missing the word "at", but rather than just adding it, this wording seemed nicer.
* Provide code example for 'my' declared in initialization of 'for' loopJames E Keenan2020-12-261-1/+15
| | | | For: https://github.com/Perl/perl5/issues/18260
* Perl 6 -> Raku where appropriateH.Merijn Brand2020-05-301-10/+10
|
* perlsyn - Mention that postfix foreach cannot specify a lexical variableDan Book2020-05-201-0/+2
|
* Link to the definition of true and false from perlsynE. Choroba2020-04-281-1/+2
| | | | | | | There used to be a section on Truth and Falsehood there, as the following paragraphs talk about conditions and booleans a lot. It was moved to perldata in 77fae4394e3ad9f159a74a6731a8d347cd2466c7, but without a trace. Let's have a link to the new destination in the old one.
* perlsyn.pod: correct typo in docAndreas Koenig2019-02-111-1/+1
|
* perlsyn: Be more explicit about what is fasterEugen Konkov2018-08-251-1/+1
| | | | | | This paragraph can lead to ambiguity because it uses at example `for` keyword but then says: Perl executes a foreach statement more rapidly than it would the equivalent **for** loop.
* Spelling corrections in pod/*.pod from Alexandr Savca.Alexandr Savca2018-04-191-1/+1
| | | | | | | | | Alexandr Savca is now a Perl AUTHOR. For: RT #133120 Committer: holding off on the corrections to pod/perlartistic.pod until clarification of change to license text.
* revert smartmatch to 5.27.6 behaviourZefram2017-12-291-115/+414
| | | | | | | | | | | | | The pumpking has determined that the CPAN breakage caused by changing smartmatch [perl #132594] is too great for the smartmatch changes to stay in for 5.28. This reverts most of the merge in commit da4e040f42421764ef069371d77c008e6b801f45. All core behaviour and documentation is reverted. The removal of use of smartmatch from a couple of tests (that aren't testing smartmatch) remains. Customisation of a couple of CPAN modules to make them portable across smartmatch types remains. A small bugfix in scope.c also remains.
* better document while condition magicZefram2017-12-231-8/+18
| | | | | | | | The operators affected by while-condition magic variously didn't mention the implicit "defined" part of the magic or didn't mention it at all. In perlsyn.pod there was a partial mention of the magic in the context of the "for" loop, but none for the "while" loop. Describe the magic more fully on both ends. [perl #132644]
* merge branch zefram/dumb_matchZefram2017-12-171-414/+115
|\
| * add "whereis"Zefram2017-12-061-22/+35
| | | | | | | | | | "whereis" is like "whereso" except that it performs an implicit smartmatch.
| * change "when" keyword to "whereso"Zefram2017-12-051-28/+28
| |
| * make "when" do implicit "next"Zefram2017-11-291-12/+7
| | | | | | | | | | | | | | | | A "when" construct, upon reaching the end of its conditionally-executed block, used to perform an implicit jump to the end of the enclosing topicalizer, defined as either a "given" block or a "foreach" operating on $_. Change it to jump to the enclosing loop of any kind (which now includes "given" blocks).
| * remove useless "break" mechanismZefram2017-11-291-10/+3
| |
| * make loop control apply to "given"Zefram2017-11-291-2/+7
| | | | | | | | A "given" construct is now officially a one-iteration loop.
| * remove useless "default" mechanismZefram2017-11-281-15/+10
| |
| * revise all given/when documentationZefram2017-11-211-119/+70
| | | | | | | | | | | | Update documentation that describes old behaviour of given/when (of various vintages) as current. Remove duplication. Edit the main section in perlsyn for clarity. Properly document details of "break".
| * merge switch sections in perlsyn.podZefram2017-11-211-95/+90
| | | | | | | | | | | | Now that the biggest parts of the "Experimental Details on given and when" are gone, merge the remaining part of the section into the "Switch Statements" section.
| * regularise "when"Zefram2017-11-211-263/+12
| | | | | | | | | | | | | | | | | | | | | | Remove from "when" the implicit enreferencement of array/hash conditions and the implicit smartmatch of most conditions. Delete most of the documentation about behaviour of older versions of given/when, because explaining the now-old "when" behaviour would be excessively cumbersome and there's little compatibility to take advantage of. Delete the documentation about differences of given/when from the Perl 6 feature, because the differences are now even more extensive and it's too much difference to sensibly explain. Add tests of "when" in isolation.
| * regularise "given"Zefram2017-11-211-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Change "given" from implicitly enreferencing array and hash topics to just giving the topic scalar context. It's difficult to say whether this is a change of the intended behaviour or merely a bugfix, because the implicit enreferencement was not documented, and there were no tests exercising it. The documentation merely said that the argument is in scalar context, which correctly describes the new behaviour. Add a documentation note about the old behaviour, alongside the existing notes about historical given/when behaviour. Incidentally fix doc that referred to assiging to $_, to instead refer to aliasing. Add tests for "given".
* | document hash/block disambig in perlsynZefram2017-12-051-2/+10
|/ | | | Fixes [perl #130958].
* mv "Truth and Falsehood" from perlsyn to perldataZefram2017-11-141-11/+1
| | | | | This one-paragraph section didn't belong in perlsyn. perldata already had a paragraph on the topic; merge them. [perl #115650]
* parse yada-yada only as a statementZefram2017-11-101-21/+12
| | | | | | | | | | | | | | Commit f5727a1c71878a34f6255eb1a506c0b21af7d36f tried to make yada-yada be parsed consistently as a term expression, but actually things are more complicated than that. The tokeniser didn't accept yada-yada in the right contexts to make it usable as an expression, and changing that would require decisions on resolving ambiguities between yada-yada and flip-flop. It's also documented as being a statement rather than an expression, though with some incorrect information about ambiguities. Overall it looks more like the intent was for yada-yada to be a statement. This commit makes it grammatically treated as such, and also fixes up the dubious parts of the documentation. [perl #132150]
* Clarify use of 'continue' keyword after 'given'.James E Keenan2016-12-231-3/+3
| | | | For: RT #130324
* perlsyn: remove deprecated L<"section"> syntaxLukas Mai2016-06-111-3/+3
| | | | ... and fix a typo.
* perlsyn: change = to == in conditional in do/while exampleLukas Mai2016-01-061-7/+19
| | | | | | ... also remove unused LOOP label from 'last' example, mention 'redo' (works like 'next' in this case), add example that combines 'next'/'last' (and requires the label).
* remove documentation for the now-removed lexical topicRicardo Signes2015-10-021-7/+2
|
* Convert tabs to spaces and remove trailing space.Shlomi Fish2014-12-071-126/+126
| | | | For: RT #123377
* Rename lvalue referencesFather Chrysostomos2014-10-171-3/+3
| | | | | Also correct the description of lvref magic. When it was first added, it was for list assignments only, but that soon changed.
* Document lvalue referencesFather Chrysostomos2014-10-111-1/+16
|
* perlsyn: Remove reference to potential Unicode opKarl Williamson2014-09-181-3/+1
| | | | | See thread beginning at http://nntp.perl.org/group/perl.perl5.porters/219796
* Semicolon before ellipsis inside block disambiguates.James E Keenan2014-09-131-6/+5
| | | | | | | | | | | | Correct documentation which indicated that, inside a block, a semicolon after an ellipsis statement would disambiguate between a block and a hash reference constructor. The semicolon must precede the ellipsis to perform this disambiguation. Add tests to demonstrate that whitespace around the ellipsis statement does not impeded the disambiguation. Add perldelta entry. For: RT #122661