Iterating over an Array of Hashes

Chad Perrin wrote in post #996688:

> indicate a desire for the data to change in the original data structure?

No, I'm claiming that the original requester's statement didn't
indicate a need to protect against changes resulting from calling
mutating methods on the keys or values of the hashes, only protection
from changes resulting from mutations on the hash.

He didn't specify "only protection from changes resulting from mutations
on the hash." He said he didn't want his actions to change his data
structure, in a very general way.

So you think the folowing statement is a general, mamby-pamby statement:

What I want to do...is work on a *copy* of
each element of b,

In my opinion, you need to ask yourself two questions with regards to
that statement:

1) What are the elements of b?

2) Given the op's code example showing what each element of b looks
like, does copying such an element require a deep copy or a shallow
copy?

···

On Thu, May 05, 2011 at 06:21:00AM +0900, Christopher Dicely wrote:

--
Posted via http://www.ruby-forum.com/\.

What he specified was "data". Read it again if you like. It was "data",
and not "programming abstractions". I'm not aware of any definition of
"data" that means "not the actual data, but rather the programming
abstractions by which the data is managed".

I eagerly await a response from the guy who posed the question.

···

On Thu, May 05, 2011 at 07:42:58AM +0900, Christopher Dicely wrote:

Yes, which is why I used the word "indicated" rather than "specified";
those words have very different meanings.

--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]

From the original query:

    Is there a way to take a *copy* of the data, rather than a reference
    to the data

Data.

He seems, to me, to be talking about *data*.

···

--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]