Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
appending an array to a frozen array
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="James French, post: 4634946"] Ah, I understand - thanks. My next question is - is it possible to prevent = this? ________________________________________ From: lasitha [lasitha.ranatunga@gmail.com] Sent: 25 March 2009 10:48 To: ruby-talk ML Subject: Re: appending an array to a frozen array +=3D creates a new array and assigns it to @dependencies. The original array remains frozen but @dependencies no longer refers to it. To illustrate: $: irb 01> a =3D b =3D [1, 2] --> [1, 2] 02> a.freeze --> [1, 2] 03> b.frozen? --> true 04> b +=3D [3, 4] --> [1, 2, 3, 4] 05> a.frozen? --> true solidarity, lasitha= [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
appending an array to a frozen array
Top