ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: takeshinoda@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:91859] [Ruby trunk Bug#15672] Lambda implicit arguments, differences between lambda {} and -> {} specifications
Date: Mon, 18 Mar 2019 03:34:33 +0000 (UTC)	[thread overview]
Message-ID: <redmine.issue-15672.20190318033432.fa8f3436a7a51d78@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15672.20190318033432@ruby-lang.org

Issue #15672 has been reported by takeshinoda (Takeshi Shinoda).

----------------------------------------
Bug #15672: Lambda implicit arguments, differences between lambda {} and -> {} specifications
https://bugs.ruby-lang.org/issues/15672

* Author: takeshinoda (Takeshi Shinoda)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-03-18 trunk 67291) [x86_64-darwin18]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Hi

Are the following differences intentional?

```
$ ruby -v
ruby 2.7.0dev (2019-03-18 trunk 67291) [x86_64-darwin18]
```

```
$ cat ptn1.rb
a = -> { p @1 }
a.call(1)
 $ ruby ptn1.rb
Traceback (most recent call last):
        1: from ptn1.rb:2:in `<main>'
ptn1.rb:1:in `block in <main>': wrong number of arguments (given 1, expected 0) (ArgumentError)
```

```
$ cat ptn2.rb
a = lambda { p @1 }
a.call(1)
 $ ruby ptn2.rb
1
```

thanks



-- 
https://bugs.ruby-lang.org/

       reply	other threads:[~2019-03-18  3:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-15672.20190318033432@ruby-lang.org>
2019-03-18  3:34 ` takeshinoda [this message]
2019-03-18  6:12 ` [ruby-core:91863] [Ruby trunk Bug#15672] Lambda implicit arguments, differences between lambda {} and -> {} specifications hanmac
2019-03-18 11:51 ` [ruby-core:91866] " shevegen

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.issue-15672.20190318033432.fa8f3436a7a51d78@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).