Project

General

Profile

Actions

Bug #17193

closed

Endless method definition doesn't work with lambdas in IRB

Added by kodnin (David Boot) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0preview1 (2020-09-25 master 0096d2b895) [x86_64-darwin19]
[ruby-core:100166]

Description

Endless method definition doesn't work with lambdas. Please check the attached screenshot.

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:

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

Files

Screenshot 2020-09-26 at 09.19.24.png (714 KB) Screenshot 2020-09-26 at 09.19.24.png kodnin (David Boot), 09/26/2020 07:19 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0