B
Brian Buckley
------=_Part_2806_28837954.1141754946901
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
require 'facet/symbol/to_proc'
[[1,2], [], [1,2,3]].map(&:length) #line 1 Blows up re undefined method
length for Fixnum?
["ab", "", "abc"].map(&:length) #line 2 =3D> [2, 0, 3] but this works fin=
e
Why does the first line fail by trying to call method length on Fixnum?
Shouldn't it be calling length on Array (which is defined) and thus return
[2,0,3] ? Note the next line behaves as I'd expect, but for Strings.
What's happening?
------=_Part_2806_28837954.1141754946901--
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
require 'facet/symbol/to_proc'
[[1,2], [], [1,2,3]].map(&:length) #line 1 Blows up re undefined method
length for Fixnum?
["ab", "", "abc"].map(&:length) #line 2 =3D> [2, 0, 3] but this works fin=
e
Why does the first line fail by trying to call method length on Fixnum?
Shouldn't it be calling length on Array (which is defined) and thus return
[2,0,3] ? Note the next line behaves as I'd expect, but for Strings.
What's happening?
------=_Part_2806_28837954.1141754946901--