From: Akinori MUSHA Date: 2008-04-17T20:52:17+09:00 Subject: Re: Rails broken with 1.8.7 bc Symbol#to_proc --pgp-sign-Multipart_Thu_Apr_17_20:52:16_2008-1 Content-Type: text/plain; charset=US-ASCII At Thu, 17 Apr 2008 19:13:17 +0900, Ola Bini wrote: > Not sure if anyone has noticed this, but Rails doesn't startup with > the 1.8.7-preview. This is because of the native Symbol#to_proc that > seems to have a slightly different behavior than the Ruby-implemented > one. Thank you for the report. We recognize the problem and will be fixing it shortly. http://rubyforge.org/tracker/index.php?func=detail&aid=19551&group_id=426&atid=22040 It would be an option to bring the Rails' code in if the right way to fix the current implementation were to cost too much. > Example: > > on 1.8.6 this: > class Symbol > def to_proc > proc { |*args| args.shift.__send__(self, *args) } > end > end > > p([[proc{ },1]].each(&:call)) > > Will fail with: > t1.rb:3:in `__send__': undefined method `call' for > [#, 1]:Array (NoMethodError) > from t1.rb:3:in `to_proc' > from t1.rb:7:in `each' > from t1.rb:7 > > While with 1.8.7-preview this line > p([[proc{ },1]].each(&:call)) > > will not fail, but print > [[1]] > > The error Rails gives is related: > /Users/olabini/workspace/optimize_jruby/vendor/rails/activesupport/lib/active_support/inflector.rb:257:in > `object_id': wrong number of arguments (1 for 0) (ArgumentError) > from Yes, this behavior reflects the messy argument list handling in Ruby <=1.8 and we'll have to work it around. Regards, -- Akinori MUSHA / http://akinori.org/ --pgp-sign-Multipart_Thu_Apr_17_20:52:16_2008-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEABECAAYFAkgHOfAACgkQkgvvx5/Z4e45EACgqoc1vDv8E67rOgbfT94Xx1p5 X38AoKxBpEDPZasqDhSfF71KMENYqmS0 =JjYq -----END PGP SIGNATURE----- --pgp-sign-Multipart_Thu_Apr_17_20:52:16_2008-1--