develooper Front page | perl.perl6.users | Postings from July 2022

shorter way to set states in -n?

Thread Next
From:
Marc Chantreux
Date:
July 2, 2022 16:26
Subject:
shorter way to set states in -n?
Message ID:
YsBxnPwRZALYa+fX@prometheus.u-strasbg.fr

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

Thread Next


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