Skip Menu |
Report information
Id: 130971
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: pm [at] vrkosk.iki.fi
Cc:
AdminCc:

Operating System: Linux
PatchStatus: (no value)
Severity: Wishlist
Type: core
Perl Version: 5.24.1
Fixed In: (no value)



Date: Fri, 10 Mar 2017 11:05:24 +0000
Subject: Cannot use refalias with subroutine signatures
From: Ville Koskinen <pm [...] vrkosk.iki.fi>
To: perlbug [...] perl.org
Download (untitled) / with headers
text/plain 3.6k
This is a bug report for perl from pm@vrkosk.iki.fi, generated with the help of perlbug 1.40 running under perl 5.24.1. ----------------------------------------------------------------- [Please describe your issue here] It would be very nice to be able to use the refalias feature in combination with subroutine signatures. On 5.24.1, the following is a syntax error: use feature 'refaliasing'; use feature 'signatures'; sub test ($scalar, \@array, \%hash) { } The following of course works and has the same intended meaning: use feature 'refaliasing'; sub test { (my $scalar, \my @array, \my %hash) = @_; } Probably intimately related to refalias + signatures is that the following is also a syntax error: use feature 'refaliasing'; sub test { my ($scalar, \@array, \%hash) = @_; } [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=wishlist --- Site configuration information for perl 5.24.1: Configured by villek at Thu Mar 9 10:29:14 GMT 2017. Summary of my perl5 (revision 5 version 24 subversion 1) configuration: Platform: osname=linux, osvers=4.4.49-16-default, archname=x86_64-linux-thread-multi uname='linux t440p-vrk 4.4.49-16-default #1 smp sun feb 19 17:40:35 utc 2017 (70e9954) x86_64 x86_64 x86_64 gnulinux ' config_args='-Dprefix=/home/villek/perldist/perl-5.24.1' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.8.5', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/lib /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.22.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.22' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector' --- @INC for perl 5.24.1: /home/villek/perldist/perl-5.24.1/lib/site_perl/5.24.1/x86_64-linux-thread-multi /home/villek/perldist/perl-5.24.1/lib/site_perl/5.24.1 /home/villek/perldist/perl-5.24.1/lib/5.24.1/x86_64-linux-thread-multi /home/villek/perldist/perl-5.24.1/lib/5.24.1 --- Environment for perl 5.24.1: HOME=/home/villek LANG=de_DE.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH=/usr/lib64/mpi/gcc/openmpi/lib64 LOGDIR (unset) PATH=/usr/lib64/mpi/gcc/openmpi/bin:/home/villek/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin PERL_BADLANG (unset) SHELL=/bin/bash
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 222b
I, too, would like to see refaliasing via subroutine signatures. There is or was another ticket related to being able to put the \ on the inside of my declarations. I believe sprout did some work on that front. -- rjbs
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 521b
On Tue, 21 Mar 2017 06:08:14 -0700, rjbs wrote: Show quoted text
> I, too, would like to see refaliasing via subroutine signatures. > > There is or was another ticket related to being able to put the \ on > the inside of my declarations. I believe sprout did some work on that > front.
In 5.26-to-be, you can use the ‘declared_refs’ feature to allow my(\%foo). I honestly don’t remember whether I got as far as applying it to signatures. I don’t think so. I am too lazy to build blead to find out. -- Father Chrysostomos
Date: Wed, 22 Mar 2017 10:50:43 +0000
CC: perl5-porters [...] perl.org
To: Father Chrysostomos via RT <perlbug-followup [...] perl.org>
Subject: Re: [perl #130971] Cannot use refalias with subroutine signatures
From: Dave Mitchell <davem [...] iabyn.com>
Download (untitled) / with headers
text/plain 549b
On Tue, Mar 21, 2017 at 05:43:32PM -0700, Father Chrysostomos via RT wrote: Show quoted text
> In 5.26-to-be, you can use the ‘declared_refs’ feature to allow > my(\%foo). I honestly don’t remember whether I got as far as applying > it to signatures. I don’t think so. I am too lazy to build blead to > find out.
I suggested holding off, as I was working on signatures at the time, and probably wanted to do things a bit differently. -- I don't want to achieve immortality through my work... I want to achieve it through not dying. -- Woody Allen
Date: Wed, 22 Mar 2017 09:53:15 +0000
To: Father Chrysostomos via RT <perlbug-followup [...] perl.org>
From: Ville Koskinen <pm [...] vrkosk.iki.fi>
Subject: Re: [perl #130971] Cannot use refalias with subroutine signatures
Download (untitled) / with headers
text/plain 592b
On Wed, 22 Mar 2017, at 00:43, Father Chrysostomos via RT wrote: Show quoted text
> In 5.26-to-be, you can use the ‘declared_refs’ feature to allow > my(\%foo). I honestly don’t remember whether I got as far as applying it > to signatures. I don’t think so. I am too lazy to build blead to find > out.
Oh, that's fantastic! If declared_refs doesn't do it for signatures in 5.26, I don't mind at all waiting for 5.28. (For years at $work, I've been documenting function return values using my (\@foo, \%bar) and so on. It's very nice to find it will be a real feature.) Regards, Ville Koskinen


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