On Thu, Mar 9, 2023 at 2:50â¯PM Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> wrote: > One complication I can immediately see is that, I presume by "deep > constant" you would want this entire thing to be readonly: > > const $x = [ [ 1, 2, 3 ] ]; > > But what about references to *existing* variables that happen to be > found inside a data structure: > > my @nums = ( 1, 2, 3 ); # normal mutable array variable > const $y = [ \@nums ]; > > How would perl tell the difference between the two? > To me what people are looking for is read only structures. Thus 1. we need an actual read only mechanism for hashes (restricted hashes are too restrictive for this purpose), and 2. in your example the declaration would cause @nums to also become read only. -DanThread Previous | Thread Next