Pointers and references: Difference between revisions

m
→‎{{header|Perl 6}}: we no longer have a Parcel type
(Omit from Lily (there are no pointers in the language).)
m (→‎{{header|Perl 6}}: we no longer have a Parcel type)
Line 816:
@bar.say; # deref @bar name to array container, then call say on that, giving 2 3 4
 
@bar := (1,2,3); # bind name directly to a ParcelList
@bar»++; # ERROR, parcels are not mutable</lang>
References to hashes and functions work more like arrays, insofar as a method call acts directly on the container, not on what the container contains. That is, they don't do the extra dereference implied by calling a method on a scalar variable.
Anonymous user