On Feb 22, 2014, at 16:56, gvim <gvimrc / gmail.com> wrote:

> According to "The Well Grounded Rubyist" 2nd edition the following =
should increment the size of the all_symbols array by 2 for variables a =
and b but it doesn't:
>=20
>>> Symbol.all_symbols.size
> =3D> 3812
>>> a =3D 1
> =3D> 1
>>> Symbol.all_symbols.size
> =3D> 3812
>>> b =3D 2
> =3D> 2
>>> Symbol.all_symbols.size
> =3D> 3812
>>> Symbol.all_symbols.include? :a
> =3D> true
>>> Symbol.all_symbols.include? :b
> =3D> true
>>> Symbol.all_symbols.size
> =3D> 3812
>=20
> I'm running Ruby version 2.1.0 on Mac OS X.

That's certainly true _in_theory_ but you're running irb, which is a =
complicated mess:

>> Symbol.all_symbols.sort.grep(/^a/).first 5
=3D> [:a, :a1, :a2, :abort, :abort_on_exception]

but even without irb, there's plenty of symbols defined:

10004 % ruby -e 'p Symbol.all_symbols.sort.grep(/^a/).first 5'
[:a, :abort, :abort_on_exception, :abort_on_exception=3D, :abs]