Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature documentation does not include warnings #14167

Open
p5pRT opened this issue Oct 17, 2014 · 5 comments
Open

feature documentation does not include warnings #14167

p5pRT opened this issue Oct 17, 2014 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 17, 2014

Migrated from rt.perl.org#122998 (status was 'open')

Searchable as RT122998$

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2014

From jakob.voss@gbv.de

The documentation of "feature" (http​://perldoc.perl.org/feature.html)
only describes the 'lexical_subs' and 'signatures' features as
experimental and they are not included in the default feature
bundles. At least feature 'switch', however produces a warning.
The section "FEATURE BUNDLES" in the documentation should clarify
which features can be used without warning in which bundle.



Flags​:
  category=core
  severity=low


--
Jakob Voß <jakob.voss@​gbv.de>
Verbundzentrale des GBV (VZG) / Common Library Network
Platz der Goettinger Sieben 1, 37073 Göttingen, Germany
+49 (0)551 39-10242, http​://www.gbv.de/

@p5pRT
Copy link
Author

p5pRT commented Oct 18, 2014

From madcityzen@gmail.com

On Oct 17, 2014, at 2​:38 AM, Jakob Voß (via RT) <perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Jakob Voß
# Please include the string​: [perl #122998]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122998 >

The documentation of "feature" (http​://perldoc.perl.org/feature.html)
only describes the 'lexical_subs' and 'signatures' features as
experimental and they are not included in the default feature
bundles. At least feature 'switch', however produces a warning.

Here is a patch to regen/feature.pl (and its regenerated lib/feature.pm) that adds an appropriate note about switch and tells how to disable that warning (given warns because smartmatch is experimental).

Was I supposed to run regen.pl?

OT​: I can see the ticket via http​://rt.perl.org <http​://rt.perl.org/> when I am anonymous, but when I'm logged in I get "You don't have permission". Is that expected?

The section "FEATURE BUNDLES" in the documentation should clarify
which features can be used without warning in which bundle.

'switch' is the only feature that is affected by this (experimental but in a feature bundle), so I could add a note down there, but I don't think it needs anything fancy. If it does need something fancy to plan for if this happens again, I've got an idea.

Doug Bell
madcityzen@​gmail.com <mailto​:madcityzen@​gmail.com>

@p5pRT
Copy link
Author

p5pRT commented Oct 18, 2014

From madcityzen@gmail.com

0001-mention-switch-is-experimental-in-feature.pm.patch
From d9ffdd271cc0b1bd091387a6e90c70613ce8b638 Mon Sep 17 00:00:00 2001
From: Doug Bell <madcityzen@gmail.com>
Date: Fri, 17 Oct 2014 21:33:27 -0500
Subject: [PATCH] mention 'switch' is experimental in feature.pm

The other experimental features already have nice warnings in feature.pm
---
 lib/feature.pm   | 6 ++++++
 regen/feature.pl | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/lib/feature.pm b/lib/feature.pm
index 3f93f23..fe78881 100644
--- a/lib/feature.pm
+++ b/lib/feature.pm
@@ -135,6 +135,12 @@ This feature is available starting with Perl 5.10.
 
 =head2 The 'switch' feature
 
+B<WARNING>: Because the L<smartmatch operator|perlop/"Smartmatch Operator"> is
+experimental, Perl will warn when you use this feature, unless you have
+explicitly disabled the warning:
+
+    no warnings "experimental::smartmatch";
+
 C<use feature 'switch'> tells the compiler to enable the Perl 6
 given/when construct.
 
diff --git a/regen/feature.pl b/regen/feature.pl
index 1ffca38..b58381c 100755
--- a/regen/feature.pl
+++ b/regen/feature.pl
@@ -450,6 +450,12 @@ This feature is available starting with Perl 5.10.
 
 =head2 The 'switch' feature
 
+B<WARNING>: Because the L<smartmatch operator|perlop/"Smartmatch Operator"> is
+experimental, Perl will warn when you use this feature, unless you have
+explicitly disabled the warning:
+
+    no warnings "experimental::smartmatch";
+
 C<use feature 'switch'> tells the compiler to enable the Perl 6
 given/when construct.
 
-- 
2.0.0

@p5pRT
Copy link
Author

p5pRT commented Oct 18, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Oct 18, 2014

From @cpansprout

On Fri Oct 17 19​:52​:56 2014, madcityzen@​gmail.com wrote​:

On Oct 17, 2014, at 2​:38 AM, Jakob Voß (via RT) <perlbug-
followup@​perl.org> wrote​:

# New Ticket Created by Jakob Voß
# Please include the string​: [perl #122998]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122998 >

The documentation of "feature" (http​://perldoc.perl.org/feature.html)
only describes the 'lexical_subs' and 'signatures' features as
experimental and they are not included in the default feature
bundles. At least feature 'switch', however produces a warning.

Here is a patch to regen/feature.pl (and its regenerated
lib/feature.pm) that adds an appropriate note about switch and tells
how to disable that warning (given warns because smartmatch is
experimental).

Thank you. Applied as 7caca87.

Was I supposed to run regen.pl?

By patching feature.pm as well, you have effectively done that.

OT​: I can see the ticket via http​://rt.perl.org <http​://rt.perl.org/>
when I am anonymous, but when I'm logged in I get "You don't have
permission". Is that expected?

I’m not seeing that here​: <https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122998>

The section "FEATURE BUNDLES" in the documentation should clarify
which features can be used without warning in which bundle.

'switch' is the only feature that is affected by this (experimental
but in a feature bundle), so I could add a note down there, but I
don't think it needs anything fancy. If it does need something fancy
to plan for if this happens again, I've got an idea.

I have no opinion on this. But I guess this means the ticket should stay open a bit.

--

Father Chrysostomos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants