On Thu, 9 Mar 2023 at 21:25, Martijn Lievaart <m@rtij.nl> wrote: > Op 09-03-2023 om 21:23 schreef Branislav ZahradnÃk: > > >> Causing @nums to be read-only sounds like a good idea, actually. >> Immutable data is often a huge win. >> > > It can come with "deep copy on write" (it should not affect values it > doesn't own yet data should be read-only. > > > That's also surprising behaviour. Especially when you can write simply [ > @nums ] instead of \@nums to achieve the same. > > > Don't by confused by simplicity of examples, eg: my @structs = ({ ... }, { ... }, ...); my $var : const = [ @structs ]; > HTH, > > M4 > > >Thread Previous | Thread Next