Re: Brace interpolation in strings creates a new scope?

2020-10-26 Thread Sean McAfee
On Mon, Oct 26, 2020 at 12:04 PM Elizabeth Mattijsen wrote: > Personally, I would avoid the use of the anonymous state variable. I > think it is an example where Larry would nowadays apply rule #2. > Well, I wouldn't use a construction like that in real code. It just seems like one of the

Re: Brace interpolation in strings creates a new scope?

2020-10-26 Thread Patrick R. Michaud
On Mon, Oct 26, 2020 at 08:04:21PM +0100, Elizabeth Mattijsen wrote: > > On 26 Oct 2020, at 18:40, Sean McAfee wrote: > > Is this the intended behavior? The doc page on quoting constructs > > just says that values can be interpolated with braces, but (at least > > to my eyes) doesn't suggest

Re: Brace interpolation in strings creates a new scope?

2020-10-26 Thread Elizabeth Mattijsen
> On 26 Oct 2020, at 18:40, Sean McAfee wrote: > Is this the intended behavior? The doc page on quoting constructs just says > that values can be interpolated with braces, but (at least to my eyes) > doesn't suggest that this involves creating a new scope, or a new function, > or however it

Brace interpolation in strings creates a new scope?

2020-10-26 Thread Sean McAfee
I'm putting together a Raku presentation for my co-workers and have a section on state variables. This is my example: sub how-many { state $times; say "You called me {++$times} times"; } > how-many You called me 1 times > how-many You called me 2 times > how-many You called me 3 times