From: shyouhei@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:82988] [Ruby trunk Feature#13630][Closed] :[] method should accept block in nice syntax
Date: Mon, 25 Sep 2017 12:18:03 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-66896.20170925121802.7760db0218185d73@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13630.20170603122409@ruby-lang.org
Issue #13630 has been updated by shyouhei (Shyouhei Urabe).
Status changed from Open to Closed
We looked at this at a developer meeting today and confirmed that this is already done.
----------------------------------------
Feature #13630: :[] method should accept block in nice syntax
https://bugs.ruby-lang.org/issues/13630#change-66896
* Author: khoan (khoa nguyen)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
~~~ ruby
# given
module Bam
def self.[](bam)
yield bam
end
end
# SyntaxError: unexpected keyword_do_block
Bam['bam'] do |b|
puts b
end
# SyntaxError: unexpected { arg, expecting end-of-input
Bam['bam'] { |b|
puts b
}
# Valid but more verbose
Bam.[]('bam') do |b|
puts b
end
Bam.[]('bam') { |b|
puts b
}
~~~
--
https://bugs.ruby-lang.org/
next prev parent reply other threads:[~2017-09-25 12:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-13630.20170603122409@ruby-lang.org>
2017-06-03 12:24 ` [ruby-core:81559] [Ruby trunk Feature#13630] :[] method should accept block in nice syntax huukhoanguyen
2017-06-03 16:39 ` [ruby-core:81564] " shevegen
2017-08-31 5:25 ` [ruby-core:82544] " nobu
2017-09-25 12:18 ` shyouhei [this message]
2017-09-25 13:31 ` [ruby-core:82998] " matz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-66896.20170925121802.7760db0218185d73@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).