Enumerator constructor taking a block isn't implemented
-------------------------------------------------------

                 Key: JRUBY-4098
                 URL: http://jira.codehaus.org/browse/JRUBY-4098
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.4.0RC1
            Reporter: James Abley
            Assignee: Thomas E Enebo


{noformat}
$ cat test/test_enumerator.rb
 
def create_fib()
 Enumerator.new { |y|
    a = b = 1
    loop {
      y << a
      a, b = b, a + b
    }
  }
end
 
def run_fib(i)
  fib = create_fib
  fib.take i
end
 
def main
  p "not created enumerator yet"
  p run_fib 10
  p "enumerator should be eligible for GC"
end
 
main
 
$ ./bin/jruby --1.9 test/test_enumerator.rb
"not created enumerator yet"
test/test_enumerator.rb:2:in `create_fib': wrong # of arguments(0 for 1) 
(ArgumentError)
from test/test_enumerator.rb:12:in `run_fib'
from test/test_enumerator.rb:18:in `main'
from test/test_enumerator.rb:22
{noformat}

This is on head. I don't understand the code base well enough to provide a 
patch to RubyEnumerator which will address this. I should be able to add a 
rubyspec if there isn't already something though.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to