develooper Front page | perl.perl5.porters | Postings from July 2016

Re: Concerning the smoke-me/davem/sub_argsB2 branch

Thread Previous
From:
Dave Mitchell
Date:
July 25, 2016 22:02
Subject:
Re: Concerning the smoke-me/davem/sub_argsB2 branch
Message ID:
20160725084850.GU3477@iabyn.com
On Mon, Jul 25, 2016 at 03:27:30AM -0000, Father Chrysostomos wrote:
> I wrote:
> > I wrote:
> > > package T { sub TIESCALAR{bless[]} sub STORE { warn "Storing $_[1]" } }
> > > foo();
> > > use experimental "signatures";
> > > sub bar ($x=3) {
> > >     sub foo { tie $x, "T" }
> > > }
> > > bar();
> > 
> > Here is the goto version:
> > 
> > package T { sub TIESCALAR{bless[]} sub STORE { warn "Storing $_[1]" } }
> > use experimental "signatures";
> > sub bar ($=$_ == 1 && goto foo, $y=3) {
> >     foo:
> >     tie $y, "T" if $_ == 1
> > }
> > $_ = 1;
> > bar();
> > $_ = 0;
> > bar();
> 
> And since I am in the mood for torturing people right now:
> 
> $ ./perl -Ilib -e 'use experimental "signatures"; use Scalar::Util "weaken"; sub foo($x=weaken (my $y = \@_)) {} foo'
> Assertion failed: (!SvMAGICAL(defav)), function Perl_pp_argelem, file pp.c, line 6648.
> Abort trap: 6
> 
> :-)


You are a sick and twisted individual ;-)
I'll have to revisit my assumptions.


-- 
The Enterprise is captured by a vastly superior alien intelligence which
does not put them on trial.
    -- Things That Never Happen in "Star Trek" #10

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About