Skip Menu |
Report information
Id: 105278
Status: rejected
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: ikegami [at] adaelis.com
Cc:
AdminCc:

Operating System: All
PatchStatus: Applied
Severity: low
Type: core
Perl Version: (no value)
Fixed In: (no value)

Attachments


Subject: Add warning for exists($a[0]) and delete($a[0])
Date: Sun, 4 Dec 2011 04:47:23 -0500
To: perlbug [...] perl.org
From: Eric Brine <ikegami [...] adaelis.com>

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

This is a bug report for perl from ikegami@adaelis.com,
generated with the help of perlbug 1.39 running under perl 5.14.0.


-----------------------------------------------------------------
[Please describe your issue here]

Hi,

exists($a[$i]) and delete($a[0]) are deprecated, yet they don't emit a deprecation warning. There has been talk about removing them from core or changing their functionality, which required the deprecated warning to be emitted. The attached patches add a deprecation warning for those operations.

I have previously gotten most use of exists($a[$i]) and delete($a[0]) removed from the cpan/ directory, but two remain:

- Object::Accessor has one remaining use, and there's an open ticket to have it fixed.
- Tie::File needs to have C<< no warnings 'deprecated'; >> added around its tests for its EXISTS and DELETE handler. I'll be happy to submit a patch once this is committed.

Thanks,
Eric

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl 5.14.0:

Configured by gecko at Thu May 12 09:33:39 2011.

Summary of my perl5 (revision 5 version 14 subversion 0) configuration:
  
  Platform:
    osname=MSWin32, osvers=5.2, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='C:/Progs/PERL51~4/site/bin/gcc.exe', ccflags ='-DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields',
    optimize='-O2',
    cppflags='-DWIN32'
    ccversion='', gccversion='3.4.5 (mingw-vista special r3)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='C:\Progs\PERL51~4\site\bin\g++.exe', ldflags ='-L"C:\Progs\perl5140-ap1400\lib\CORE"'
    libpth=\lib
    libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -lmsvcrt
    perllibs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -lmsvcrt
    libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl514.lib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll -L"C:\Progs\perl5140-ap1400\lib\CORE"'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY

---
@INC for perl 5.14.0:
    C:/Progs/perl5140-ap1400/site/lib
    C:/Progs/perl5140-ap1400/lib
    .

---
Environment for perl 5.14.0:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;c:\bin;C:\Progs\perl5140-ap1400\site\bin;C:\Progs\perl5140-ap1400\bin;C:\Program Files (x86)\UltraEdit;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Common Files\Ulead Systems\MPEG;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\
    PERL_BADLANG (unset)
    SHELL (unset)

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.1k
On Sun Dec 04 01:47:40 2011, ikegami@adaelis.com wrote: Show quoted text
> This is a bug report for perl from ikegami@adaelis.com, > generated with the help of perlbug 1.39 running under perl 5.14.0. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > Hi, > > exists($a[$i]) and delete($a[0]) are deprecated, yet they don't emit a > deprecation warning. There has been talk about removing them from core > or > changing their functionality, which required the deprecated warning to > be > emitted. The attached patches add a deprecation warning for those > operations. > > I have previously gotten most use of exists($a[$i]) and delete($a[0]) > removed from the cpan/ directory, but two remain: > > - Object::Accessor has one remaining use, and there's an open ticket > to > have it fixed. > - Tie::File needs to have C<< no warnings 'deprecated'; >> added > around its > tests for its EXISTS and DELETE handler. I'll be happy to submit a > patch > once this is committed.
Seeing that I maintain code that would produce literally thousands of warnings as a result (and there’s nothing wrong with the code), I’m opposed to this. -- Father Chrysostomos
Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Date: Tue, 6 Dec 2011 21:53:35 -0500
To: perlbug-followup [...] perl.org
From: Eric Brine <ikegami [...] adaelis.com>
Download (untitled) / with headers
text/plain 363b
On Sun, Dec 4, 2011 at 9:34 AM, Father Chrysostomos via RT <perlbug-followup@perl.org> wrote:
Show quoted text
Seeing that I maintain code that would produce literally thousands of
warnings as a result (and there’s nothing wrong with the code), I’m
opposed to this.

That only applies to #3 and maybe #2. #1 simply removes deprecated uses of exists from XS-APItest.

CC: perlbug-followup [...] perl.org
Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Date: Wed, 7 Dec 2011 11:49:19 +0000
To: Eric Brine <ikegami [...] adaelis.com>
From: Nicholas Clark <nick [...] ccl4.org>
Download (untitled) / with headers
text/plain 693b
On Tue, Dec 06, 2011 at 09:53:35PM -0500, Eric Brine wrote: Show quoted text
> On Sun, Dec 4, 2011 at 9:34 AM, Father Chrysostomos via RT < > perlbug-followup@perl.org> wrote: >
> > Seeing that I maintain code that would produce literally thousands of > > warnings as a result (and there?s nothing wrong with the code), I?m > > opposed to this. > >
> > That only applies to #3 and maybe #2. #1 simply removes deprecated uses of > exists from XS-APItest.
Independent of everything else, I don't think that's a good idea. Historically we've continued to test deprecated stuff until the commit that actually removes it, to ensure that it doesn't change behaviour without us knowing about it. Nicholas Clark
Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Date: Wed, 7 Dec 2011 12:44:41 -0500
To: perlbug-followup [...] perl.org
From: Eric Brine <ikegami [...] adaelis.com>
Download (untitled) / with headers
text/plain 848b


On Wed, Dec 7, 2011 at 6:50 AM, Nicholas Clark via RT <perlbug-followup@perl.org> wrote:
Show quoted text
On Tue, Dec 06, 2011 at 09:53:35PM -0500, Eric Brine wrote:
> On Sun, Dec 4, 2011 at 9:34 AM, Father Chrysostomos via RT <
> perlbug-followup@perl.org> wrote:
>
> > Seeing that I maintain code that would produce literally thousands of
> > warnings as a result (and there?s nothing wrong with the code), I?m
> > opposed to this.
> >
>
> That only applies to #3 and maybe #2. #1 simply removes deprecated uses of
> exists from XS-APItest.

Independent of everything else, I don't think that's a good idea.

Historically we've continued to test deprecated stuff until the commit that
actually removes it, to ensure that it doesn't change behaviour without us
knowing about it.

None of the patches remove any tests.

- Eric

Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Date: Fri, 16 Dec 2011 14:25:43 -0500
To: perl5-porters [...] perl.org
From: Eric Brine <ikegami [...] adaelis.com>
Download (untitled) / with headers
text/plain 1.4k
Hi,

The text of the opening post (below) describes patches #2 and #3.

Patch #1 changes two C<< exist($_[1]) >> to C<< @_ >= 2 >>. Any objections to that? They aren't part of tests for exists($a[]) or delete($a[]).

- Eric


On Sun, Dec 4, 2011 at 4:47 AM, Eric Brine <perlbug-followup@perl.org> wrote:
Show quoted text
# New Ticket Created by  "Eric Brine"
# Please include the string:  [perl #105278]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=105278 >


This is a bug report for perl from ikegami@adaelis.com,
generated with the help of perlbug 1.39 running under perl 5.14.0.


-----------------------------------------------------------------
[Please describe your issue here]

Hi,

exists($a[$i]) and delete($a[0]) are deprecated, yet they don't emit a
deprecation warning. There has been talk about removing them from core or
changing their functionality, which required the deprecated warning to be
emitted. The attached patches add a deprecation warning for those
operations.

I have previously gotten most use of exists($a[$i]) and delete($a[0])
removed from the cpan/ directory, but two remain:

- Object::Accessor has one remaining use, and there's an open ticket to
have it fixed.
- Tie::File needs to have C<< no warnings 'deprecated'; >> added around its
tests for its EXISTS and DELETE handler. I'll be happy to submit a patch
once this is committed.

Thanks,
Eric


Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Date: Sat, 31 Dec 2011 00:34:55 -0500
To: perl5-porters [...] perl.org
From: Eric Brine <ikegami [...] adaelis.com>
Download (untitled) / with headers
text/plain 276b
On Fri, Dec 16, 2011 at 2:25 PM, Eric Brine <ikegami@adaelis.com> wrote:
Show quoted text
Hi,

Patch #1 changes two
unecessary uses of
Show quoted text
C<< exist($_[1]) >> to C<< @_ >= 2 >>. Any objections to that? They aren't part of tests for exists($a[]) or delete($a[]).

Warnocked.

- Eric

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 382b
On Fri Dec 16 11:26:15 2011, ikegami@adaelis.com wrote: Show quoted text
> Hi, > > The text of the opening post (below) describes patches #2 and #3. > > Patch #1 changes two C<< exist($_[1]) >> to C<< @_ >= 2 >>. Any > objections > to that? They aren't part of tests for exists($a[]) or delete($a[]).
I actually think the code reads more clearly with the exists() form. -- Father Chrysostomos
Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Date: Sat, 31 Dec 2011 01:12:16 -0500
To: perlbug-followup [...] perl.org
From: Eric Brine <ikegami [...] adaelis.com>
Download (untitled) / with headers
text/plain 582b
On Sat, Dec 31, 2011 at 12:53 AM, Father Chrysostomos via RT <perlbug-followup@perl.org> wrote:
Show quoted text
On Fri Dec 16 11:26:15 2011, ikegami@adaelis.com wrote:
> Hi,
>
> The text of the opening post (below) describes patches #2 and #3.
>
> Patch #1 changes two C<< exist($_[1]) >> to C<< @_ >= 2 >>. Any
> objections
> to that? They aren't part of tests for exists($a[]) or delete($a[]).

I actually think the code reads more clearly with the exists() form.

But it's not valid code according to the documentation. Are you saying the documentation should be changed?
CC: perlbug-followup [...] perl.org
Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Date: Sat, 31 Dec 2011 04:17:44 -0600
To: Eric Brine <ikegami [...] adaelis.com>
From: Jesse Luehrs <doy [...] tozt.net>
Download (untitled) / with headers
text/plain 824b
On Sat, Dec 31, 2011 at 01:12:16AM -0500, Eric Brine wrote: Show quoted text
> On Sat, Dec 31, 2011 at 12:53 AM, Father Chrysostomos via RT < > perlbug-followup@perl.org> wrote: >
> > On Fri Dec 16 11:26:15 2011, ikegami@adaelis.com wrote:
> > > Hi, > > > > > > The text of the opening post (below) describes patches #2 and #3. > > > > > > Patch #1 changes two C<< exist($_[1]) >> to C<< @_ >= 2 >>. Any > > > objections > > > to that? They aren't part of tests for exists($a[]) or delete($a[]).
> > > > I actually think the code reads more clearly with the exists() form. > >
> > But it's not valid code according to the documentation. Are you saying the > documentation should be changed?
The documentation says that it is deprecated, not invalid. That said, I think it being deprecated is enough reason to agree with the patch. -doy
CC: perlbug-followup [...] perl.org
Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Date: Tue, 3 Jul 2012 01:16:05 -0500
To: Eric Brine <ikegami [...] adaelis.com>
From: Jesse Luehrs <doy [...] tozt.net>
On Sat, Dec 31, 2011 at 04:17:44AM -0600, Jesse Luehrs wrote: Show quoted text
> On Sat, Dec 31, 2011 at 01:12:16AM -0500, Eric Brine wrote:
> > On Sat, Dec 31, 2011 at 12:53 AM, Father Chrysostomos via RT < > > perlbug-followup@perl.org> wrote: > >
> > > On Fri Dec 16 11:26:15 2011, ikegami@adaelis.com wrote:
> > > > Hi, > > > > > > > > The text of the opening post (below) describes patches #2 and #3. > > > > > > > > Patch #1 changes two C<< exist($_[1]) >> to C<< @_ >= 2 >>. Any > > > > objections > > > > to that? They aren't part of tests for exists($a[]) or delete($a[]).
> > > > > > I actually think the code reads more clearly with the exists() form. > > >
> > > > But it's not valid code according to the documentation. Are you saying the > > documentation should be changed?
> > The documentation says that it is deprecated, not invalid. That said, I > think it being deprecated is enough reason to agree with the patch.
And patch #1 is now applied as 5e5bb7c. Leaving #2 and #3 for now until we come to a consensus on this issue. -doy
CC: Eric Brine <ikegami [...] adaelis.com>, perlbug-followup [...] perl.org
Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Date: Mon, 23 Jul 2012 23:11:33 -0400
To: Jesse Luehrs <doy [...] tozt.net>
From: Ricardo Signes <perl.p5p [...] rjbs.manxome.org>
Download (untitled) / with headers
text/plain 568b
* Jesse Luehrs <doy@tozt.net> [2012-07-03T02:16:05] Show quoted text
> And patch #1 is now applied as 5e5bb7c. Leaving #2 and #3 for now until > we come to a consensus on this issue.
"this issue" here is "should using the deprecated exists($a[$i]) and delete($a[$i])" warn? Or is it going back to the notion of removing tests, which I believe was rebutted, and not erroneously? The use of exists and delete on array elements has been marked as deprecated since 5.12, and I believe it should be issuing a deprecation warning if we are ever to follow through and remove it. -- rjbs
Download signature.asc
application/pgp-signature 490b

Message body not shown because it is not plain text.

CC: Eric Brine <ikegami [...] adaelis.com>, perlbug-followup [...] perl.org
Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Date: Mon, 23 Jul 2012 22:18:19 -0500
To: Ricardo Signes <perl.p5p [...] rjbs.manxome.org>
From: Jesse Luehrs <doy [...] tozt.net>
Download (untitled) / with headers
text/plain 911b
On Mon, Jul 23, 2012 at 11:11:33PM -0400, Ricardo Signes wrote: Show quoted text
> * Jesse Luehrs <doy@tozt.net> [2012-07-03T02:16:05]
> > And patch #1 is now applied as 5e5bb7c. Leaving #2 and #3 for now until > > we come to a consensus on this issue.
> > "this issue" here is "should using the deprecated exists($a[$i]) and > delete($a[$i])" warn? > > Or is it going back to the notion of removing tests, which I believe was > rebutted, and not erroneously? > > The use of exists and delete on array elements has been marked as deprecated > since 5.12, and I believe it should be issuing a deprecation warning if we are > ever to follow through and remove it.
"This issue" being if whether or not we are planning on actually removing exists and delete on arrays. I think we should, but it has been fairly contentious when brought up in the past. I agree that these warnings need to go in if we want to remove them. -doy
Date: Tue, 12 Dec 2017 06:46:44 +0000
To: perl5-porters [...] perl.org
From: Zefram <zefram [...] fysh.org>
Subject: Re: [perl #105278] Add warning for exists($a[0]) and delete($a[0])
Download (untitled) / with headers
text/plain 257b
exists() and delete() on array elements are no longer officially deprecated, but merely discouraged. The documentation changed in commit 2fbadc08f550cedfc8690b365310c2f6d81e960d. That undermines the basis for the warning proposed in this ticket. -zefram
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 435b
On Mon, 11 Dec 2017 22:47:10 -0800, zefram@fysh.org wrote: Show quoted text
> exists() and delete() on array elements are no longer officially > deprecated, but merely discouraged. The documentation changed in commit > 2fbadc08f550cedfc8690b365310c2f6d81e960d. That undermines the basis > for the warning proposed in this ticket.
Agreed. Rejecting ticket as it is no longer relevant to have a deprecation warning on something that is not deprecated.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org