From: Roelof Wobben Date: 2012-09-25T23:18:28+09:00 Subject: Re: inject problem --_fe6b8120-6305-42f2-b961-56c9bdc5ea20_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello=2C=20 One question so I can understand this way well. In this context x =3D 1 or 2 and y is the place in the hash ? Roelof > Date: Tue=2C 25 Sep 2012 22:04:50 +0900 > From: peterhickman386@googlemail.com > Subject: Re: inject problem > To: ruby-talk@ruby-lang.org >=20 > just do: >=20 > array =3D [ 1=2C 2 =2C 1 =2C 1] >=20 > p array.inject({}){|x=2Cy| x[y] +=3D 1 rescue x[y] =3D 1=3B x} >=20 = --_fe6b8120-6305-42f2-b961-56c9bdc5ea20_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello=2C

One question so I can understand this way well.

In = this context x =3B =3D 1 or 2 and y is the place in the hash ?

R= oelof


>=3B Date: Tu= e=2C 25 Sep 2012 22:04:50 +0900
>=3B From: peterhickman386@googlemail.= com
>=3B Subject: Re: inject problem
>=3B To: ruby-talk@ruby-lang= .org
>=3B
>=3B just do:
>=3B
>=3B array =3D [ 1=2C 2 = =2C 1 =2C 1]
>=3B
>=3B p array.inject({}){|x=2Cy| x[y] +=3D 1 re= scue x[y] =3D 1=3B x}
>=3B
= --_fe6b8120-6305-42f2-b961-56c9bdc5ea20_--