From: mame@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:97527] [Ruby master Bug#12671] Hash#to_proc result is not a lambda, but enforces arity
Date: Mon, 16 Mar 2020 13:45:40 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-84683.20200316134539.286@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-12671.20160812012555.286@ruby-lang.org
Issue #12671 has been updated by mame (Yusuke Endoh).
This ticket was briefly discussed at today's dev meeting, and matz said that the result of Hash#to_proc should be a lambda.
----------------------------------------
Bug #12671: Hash#to_proc result is not a lambda, but enforces arity
https://bugs.ruby-lang.org/issues/12671#change-84683
* Author: headius (Charles Nutter)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
```
$ ruby23 -e 'pr = {foo:1}.to_proc; puts pr.lambda?; pr.call rescue puts $!; pr.call(1, 2) rescue puts $!'
false
wrong number of arguments (given 0, expected 1)
wrong number of arguments (given 2, expected 1)
```
I believe it should be marked as a lambda, since it enforces arity.
--
https://bugs.ruby-lang.org/
next parent reply other threads:[~2020-03-16 13:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-12671.20160812012555.286@ruby-lang.org>
2020-03-16 13:45 ` mame [this message]
2020-07-27 20:14 ` [ruby-core:99361] [Ruby master Bug#12671] Hash#to_proc result is not a lambda, but enforces arity marcandre-ruby-core
2020-07-28 18:30 ` [ruby-core:99368] " eregontp
2020-07-28 18:42 ` [ruby-core:99369] " eregontp
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-84683.20200316134539.286@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).