the new raku.org is really beautiful (and tought about spurt)
[email protected] (Marc Chantreux) Sun, 7 Sep 2025 10:51:55 +0200
| Newsgroups | perl.perl6.users |
|---|---|
| Message-ID | <aL1Hq6mAVmNcyJdm@prometheus> |
hello rakoons,
I just gave a look on the new raku.org website and would like to
congrat as it's really beautiful.
Aside, I saw the example which reminds me an old dicsussion about
"spurt parameters should be flipped" and there is a perfect exemple
in the homepage:
my $content = "example.txt".IO.slurp; # Read file
$content ~~ s/Hello/Hi/; # Modify content
spurt $filename, $content; # Write back to file
which could be writen
with "example.txt".IO.slurp {
s/Hello/Hi/;
spurt $filename, $_
}
but it we were able to write this:
with "example.txt".IO.slurp {
s/Hello/Hi/;
.&spurt: $filename;
}
or if Str had a spurt method:
with "example.txt".IO.slurp {
s/Hello/Hi/;
.spurt: $filename;
}
regards,
--
Marc Chantreux
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQrhynLytp14smlCwy+er2aYc+1WAUCaL1HpgAKCRC+er2aYc+1 WJtHAP4zZdf6jMULhmOKOM63xcqnbVvqjXyZda0/Fvl+YwdpdQD/QQTHiWdxvElp ks6Bru/vSdpm93IYqf39O/xF+h7WCw0= =Wo+K -----END PGP SIGNATURE-----