Project

General

Profile

Feature #13333

block to yield

Added by nobu (Nobuyoshi Nakada) 9 months ago. Updated 7 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:80246]

Description

Currently, blocks can take a block by do |&block| end construct.
But the only way to pass a block or a bloc argument is making a Proc and calling Proc#call with a blockarg.
I think yield should take a block or a block argument now.

https://github.com/ruby/ruby/compare/trunk...nobu:feature/yield-blockarg

History

#1 [ruby-core:80260] Updated by duerst (Martin Dürst) 9 months ago

Out of curiosity: What's the use case(s)?

#2 [ruby-core:80345] Updated by shevegen (Robert A. Heiler) 9 months ago

Out of curiosity: What's the use case(s)?

Could be simply due to reciprocity. :)

#3 [ruby-core:81270] Updated by nobu (Nobuyoshi Nakada) 7 months ago

I think it would make generator happy.

Also available in: Atom PDF