Re: Objects, TWEAK and return

2021-03-22 Thread yary
Agreed! -y On Mon, Mar 22, 2021 at 6:45 PM Ralph Mellor wrote: > On Mon, Mar 22, 2021 at 2:12 PM yary wrote: > > > > It's not good practice to use "map" for side effects only, discarding > > the returned value–which happens here > > I agree. > > > Would [using `for`] also work-around the lack

Re: Objects, TWEAK and return

2021-03-22 Thread Ralph Mellor
On Mon, Mar 22, 2021 at 2:12 PM yary wrote: > > It's not good practice to use "map" for side effects only, discarding > the returned value–which happens here I agree. > Would [using `for`] also work-around the lack of sink context in TWEAK? Yes. > I think it is a cause of the unexpected

Re: Working with a regex using positional captures stored in a variable

2021-03-22 Thread Ralph Mellor
On Mon, Mar 22, 2021 at 2:50 PM yary wrote: > > how to get all nested captures worked for me ... not sure I agree with the > design I think the current flattening aspect is awkward in a couple ways: * Having to specify ``. I half like Brad's suggestion. * Having to write `.pairs` to extract

Re: Working with a regex using positional captures stored in a variable

2021-03-22 Thread yary
Hi all, Thanks Bill for posting your results from my samples. Seems like we both get lots of warnings/errors from our REPL's, me even with 2021.02.01. I suspect there must be something going on with what the REPL is trying to print, after all it does want to display the results of every line. I

Re: Objects, TWEAK and return

2021-03-22 Thread yary
Good to see this investigated down to the details, yet I just realized something that was bothering me about it. Going back to the original post: submethod TWEAK { $!filelist.lines».split(',').map( -> ($a, $b) { @!show.push: ( $a, $b ) }); } It's not good practice to use "map" for side