You are right it should probably work... still $it->() is visually more appealing i.e. look more as iterator/closure than &$it() .. ... anyway it is fine with me as far as the workaround works :).
On Mon, Nov 4, 2013 at 9:56 PM, David Mertens <[email protected]> wrote: > Do you need those curlies? I mean, wouldn't &$it() work? Must it be &{$it}() > ? Off the top of my head I'm not quite sure, and I'm a bit too lazy to try > it out at the moment. :-) > > This makes me think about the current postfix dereferencing discussion. > Riccardo formally proposed it back in late June and chromatic wrote about it > recently. > > David > > > On Mon, Nov 4, 2013 at 9:35 PM, mraptor <[email protected]> wrote: >> >> Option will be nice ..:) >> no PDL::NiceSlice, worked thanks.. >> Also &{$it}() , works too... but is so ugly .. >> >> On Mon, Nov 4, 2013 at 9:30 PM, David Mertens <[email protected]> >> wrote: >> > The quick solution is to do say "no PDL::NiceSlice", i.e. something like >> > this: >> > >> > use PDL::NiceSlice; >> > >> > ... PDL code here ... >> > >> > no PDL::NiceSlice; >> > >> > my $result = $subref->($first_arg, $second_arg); >> > >> > use PDL::NiceSlice; >> > >> > ... etc ... >> > >> > I know: less than ideal. >> > >> > Actually, that has me thinking. I wonder if we could configure >> > PDL::NiceSlice to take an optional parameter to prevent this sort of >> > thing, >> > like: >> > >> > use PDL::NIceSlice -noderef; >> > >> > and/or something like this >> > >> > no PDL::NiceSlice -deref; >> > >> > (I think you can do that without quotes, but if I'm wrong, then of >> > course we >> > would simply quote those things words, and probably drop the leading >> > dash.) >> > >> > CHM, what do you think? Doable? >> > >> > David >> > >> > >> > On Mon, Nov 4, 2013 at 9:12 PM, mraptor <[email protected]> wrote: >> >> >> >> Have a package in which I have to use PDL::NiceSlice and also have a >> >> closure ( which I call like this $it->() ), but this conflict with >> >> NiceSlice...:( >> >> >> >> How to solve that.. >> >> I'm getting similar problem for the second time.. first was when I had >> >> a attribute was called 'stats', renaming it to 'xstats' solved my >> >> problem, but in this case it is different. >> >> >> >> >> Can't call method "nslice" on unblessed reference .... >> >> >> >> _______________________________________________ >> >> Perldl mailing list >> >> [email protected] >> >> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl >> > >> > >> > >> > >> > -- >> > "Debugging is twice as hard as writing the code in the first place. >> > Therefore, if you write the code as cleverly as possible, you are, >> > by definition, not smart enough to debug it." -- Brian Kernighan > > > > > -- > "Debugging is twice as hard as writing the code in the first place. > Therefore, if you write the code as cleverly as possible, you are, > by definition, not smart enough to debug it." -- Brian Kernighan _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
