Forum: Ruby-core [ruby-trunk - Bug #7692][Open] Enumerator::Lazy#drop_while and take_while should require a block.

Posted by marcandre (Marc-Andre Lafortune) (Guest)
on 2013-01-14 08:58
(Received via mailing list)
Issue #7692 has been reported by marcandre (Marc-Andre Lafortune).

----------------------------------------
Bug #7692: Enumerator::Lazy#drop_while and take_while should require a 
block.
https://bugs.ruby-lang.org/issues/7692

Author: marcandre (Marc-Andre Lafortune)
Status: Open
Priority: Normal
Assignee: marcandre (Marc-Andre Lafortune)
Category: core
Target version: 2.0.0
ruby -v: r38800


Enumerator::Lazy#drop_while and take_while should require a block.

Currently:

    [1].lazy.drop_while.force # => LocalJumpError: no block given
    [1].lazy.take_while.force # => LocalJumpError: no block given

After patch, these will raise an ArgumentError "tried to call lazy 
drop_while without a block"
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.