#7 new
Brian Ford

Adding proxy methods in lazy_array.rb doesn't account for assignment methods

Reported by Brian Ford | February 24th, 2009 @ 05:44 PM

LazyArray dynamically defines all the Array and Enumerable instance methods on itself. However, it does not account for the difference in assignment methods. While you can define a method as follows in Ruby, you can't call it directly (you can #send to it though):


$ irb
>> def foo=(*args, &block)
>> p args, block
>> end
=> nil
>> args = [:a, :b, :c]
=> [:a, :b, :c]
>> block = lambda { 1 }
=> #<Proc:0x005d4f30@(irb):5>
>> foo = *args, &block
SyntaxError: compile error
(irb):6: syntax error, unexpected ',', expecting $end
foo = *args, &block
            ^
        from (irb):6

This causes an exception in Rubinius where we have same addition accessors on Array:

http://pastie.org/399089

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Lightweight fast Ruby core extensions library for DataMapper and Merb.

People watching this ticket