ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:100166] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas
@ 2020-09-26  7:23 kodnin
  2020-09-26  7:30 ` [ruby-core:100167] " s.wanabe
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: kodnin @ 2020-09-26  7:23 UTC (permalink / raw)
  To: ruby-core

Issue #17193 has been reported by kodnin (David Boot).

----------------------------------------
Bug #17193: Endless method definition doesn't work with lambdas
https://bugs.ruby-lang.org/issues/17193

* Author: kodnin (David Boot)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0preview1 (2020-09-25 master 0096d2b895) [x86_64-darwin19]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Endless method definition doesn't work with lambdas. Please check the attached screenshot.

``` ruby
def foo() = 123
# => :foo

foo
# => 123

def bar() = lambda { |x| x * x }
# I expected the method to be defined.

def bar() = ->(x) { x * x }
# Same issue.
```

Nice to have:

``` ruby
def bar = lambda { |x| x * x }
def bar = ->(x) { x * x }
```

---Files--------------------------------
Screenshot 2020-09-26 at 09.19.24.png (714 KB)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:100167] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas
  2020-09-26  7:23 [ruby-core:100166] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas kodnin
@ 2020-09-26  7:30 ` s.wanabe
  2020-09-26  7:40 ` [ruby-core:100168] " kodnin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: s.wanabe @ 2020-09-26  7:30 UTC (permalink / raw)
  To: ruby-core

Issue #17193 has been updated by wanabe (_ wanabe).


I think this is an irb problem, not a ruby problem.

```
$ ruby -ve 'def bar() = lambda { |x| x * x };p bar'
ruby 3.0.0dev (2020-09-25T22:52:04Z master 137fa5b27e) [x86_64-linux]
#<Proc:0x00005582978039e0 -e:1 (lambda)>
```

----------------------------------------
Bug #17193: Endless method definition doesn't work with lambdas
https://bugs.ruby-lang.org/issues/17193#change-87737

* Author: kodnin (David Boot)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0preview1 (2020-09-25 master 0096d2b895) [x86_64-darwin19]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Endless method definition doesn't work with lambdas. Please check the attached screenshot.

``` ruby
def foo() = 123
# => :foo

foo
# => 123

def bar() = lambda { |x| x * x }
# I expected the method to be defined.

def bar() = ->(x) { x * x }
# Same issue.
```

Nice to have:

``` ruby
def bar = lambda { |x| x * x }
def bar = ->(x) { x * x }
```

---Files--------------------------------
Screenshot 2020-09-26 at 09.19.24.png (714 KB)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:100168] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas
  2020-09-26  7:23 [ruby-core:100166] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas kodnin
  2020-09-26  7:30 ` [ruby-core:100167] " s.wanabe
@ 2020-09-26  7:40 ` kodnin
  2020-10-20 15:22 ` [ruby-core:100445] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas in IRB t
  2021-01-05 19:43 ` [ruby-core:101937] " aycabta
  3 siblings, 0 replies; 5+ messages in thread
From: kodnin @ 2020-09-26  7:40 UTC (permalink / raw)
  To: ruby-core

Issue #17193 has been updated by kodnin (David Boot).


wanabe (_ wanabe) wrote in #note-1:
> I think this is an irb problem, not a ruby problem.
> 
> ```
> $ ruby -ve 'def bar() = lambda { |x| x * x };p bar'
> ruby 3.0.0dev (2020-09-25T22:52:04Z master 137fa5b27e) [x86_64-linux]
> #<Proc:0x00005582978039e0 -e:1 (lambda)>
> ```

I can confirm that this works indeed.

```
$ ruby -e 'def bar() = ->(x) { x * x }; puts bar.(3)'
9
```

----------------------------------------
Bug #17193: Endless method definition doesn't work with lambdas
https://bugs.ruby-lang.org/issues/17193#change-87738

* Author: kodnin (David Boot)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0preview1 (2020-09-25 master 0096d2b895) [x86_64-darwin19]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Endless method definition doesn't work with lambdas. Please check the attached screenshot.

``` ruby
def foo() = 123
# => :foo

foo
# => 123

def bar() = lambda { |x| x * x }
# I expected the method to be defined.

def bar() = ->(x) { x * x }
# Same issue.
```

Nice to have:

``` ruby
def bar = lambda { |x| x * x }
def bar = ->(x) { x * x }
```

---Files--------------------------------
Screenshot 2020-09-26 at 09.19.24.png (714 KB)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:100445] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas in IRB
  2020-09-26  7:23 [ruby-core:100166] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas kodnin
  2020-09-26  7:30 ` [ruby-core:100167] " s.wanabe
  2020-09-26  7:40 ` [ruby-core:100168] " kodnin
@ 2020-10-20 15:22 ` t
  2021-01-05 19:43 ` [ruby-core:101937] " aycabta
  3 siblings, 0 replies; 5+ messages in thread
From: t @ 2020-10-20 15:22 UTC (permalink / raw)
  To: ruby-core

Issue #17193 has been updated by taiyoslime (Taiyo Mizuhashi).


This seems to be fixed in https://github.com/ruby/irb/pull/131. Please check it out.

----------------------------------------
Bug #17193: Endless method definition doesn't work with lambdas in IRB
https://bugs.ruby-lang.org/issues/17193#change-88064

* Author: kodnin (David Boot)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0preview1 (2020-09-25 master 0096d2b895) [x86_64-darwin19]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Endless method definition doesn't work with lambdas. Please check the attached screenshot.

``` ruby
def foo() = 123
# => :foo

foo
# => 123

def bar() = lambda { |x| x * x }
# I expected the method to be defined.

def bar() = ->(x) { x * x }
# Same issue.
```

Nice to have:

``` ruby
def bar = lambda { |x| x * x }
def bar = ->(x) { x * x }
```

---Files--------------------------------
Screenshot 2020-09-26 at 09.19.24.png (714 KB)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:101937] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas in IRB
  2020-09-26  7:23 [ruby-core:100166] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas kodnin
                   ` (2 preceding siblings ...)
  2020-10-20 15:22 ` [ruby-core:100445] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas in IRB t
@ 2021-01-05 19:43 ` aycabta
  3 siblings, 0 replies; 5+ messages in thread
From: aycabta @ 2021-01-05 19:43 UTC (permalink / raw)
  To: ruby-core

Issue #17193 has been updated by aycabta (aycabta .).

Status changed from Open to Closed

As @taiyoslime said, I confirmed that it was fixed in https://github.com/ruby/irb/pull/131.

----------------------------------------
Bug #17193: Endless method definition doesn't work with lambdas in IRB
https://bugs.ruby-lang.org/issues/17193#change-89785

* Author: kodnin (David Boot)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.0preview1 (2020-09-25 master 0096d2b895) [x86_64-darwin19]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Endless method definition doesn't work with lambdas. Please check the attached screenshot.

``` ruby
def foo() = 123
# => :foo

foo
# => 123

def bar() = lambda { |x| x * x }
# I expected the method to be defined.

def bar() = ->(x) { x * x }
# Same issue.
```

Nice to have:

``` ruby
def bar = lambda { |x| x * x }
def bar = ->(x) { x * x }
```

---Files--------------------------------
Screenshot 2020-09-26 at 09.19.24.png (714 KB)


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-05 19:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-26  7:23 [ruby-core:100166] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas kodnin
2020-09-26  7:30 ` [ruby-core:100167] " s.wanabe
2020-09-26  7:40 ` [ruby-core:100168] " kodnin
2020-10-20 15:22 ` [ruby-core:100445] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas in IRB t
2021-01-05 19:43 ` [ruby-core:101937] " aycabta

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).