Re: shorter way to set states in -n?

2022-07-02 Thread Marc Chantreux
Ralph, On Sat, Jul 02, 2022 at 08:27:19PM +0100, Ralph Mellor wrote: > Does this do what you want: > BEGIN my (@o, @f) = 0 xx 3; > @o.push: "ok"; > say @o; > seq 2|raku -ne ' BEGIN my (@o, @f) = 0 xx 3; @o.push: "ok"; say @o; ' works fine! thank you

Re: shorter way to set states in -n?

2022-07-02 Thread Gianni Ceccarelli
On 2022-07-02 Marc Chantreux wrote: > AFAIK about raku -n, I need 2 lines to setup a > state with a default value > > seq 2| raku -ne ' > state (@o, @f); > BEGIN @o = 0 xx 3; > @o.push: "ok"; > say @o; > ' > > but is there a

Re: shorter way to set states in -n?

2022-07-02 Thread Ralph Mellor
On Sat, Jul 2, 2022 at 5:26 PM Marc Chantreux wrote: > > AFAIK about raku -n, I need 2 lines to setup a state with a default value Does this do what you want: BEGIN my (@o, @f) = 0 xx 3; @o.push: "ok"; say @o; ? love, raiph

shorter way to set states in -n?

2022-07-02 Thread Marc Chantreux
hello rakoons, AFAIK about raku -n, I need 2 lines to setup a state with a default value seq 2| raku -ne ' state (@o, @f); BEGIN @o = 0 xx 3; @o.push: "ok"; say @o; ' but is there a shorter way ? regards, marc