[#114348] [Ruby master Feature#19832] Method#destructive?, UnboundMethod#destructive? — "sawa (Tsuyoshi Sawada) via ruby-core" <ruby-core@...>

Issue #19832 has been reported by sawa (Tsuyoshi Sawada).

15 messages 2023/08/06

[#114365] [Ruby master Bug#19834] Segmentation fault while running in docker — "ramachandran@... (Ramachandran A) via ruby-core" <ruby-core@...>

Issue #19834 has been reported by ramachandran@mallow-tech.com (Ramachandran A).

7 messages 2023/08/09

[#114380] [Ruby master Bug#19837] Concurrent calls to Process.waitpid2 misbehave on Ruby 3.1 & 3.2 — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>

Issue #19837 has been reported by kjtsanaktsidis (KJ Tsanaktsidis).

7 messages 2023/08/11

[#114399] [Ruby master Feature#19839] Need a method to check if two ranges overlap — "shouichi (Shouichi KAMIYA) via ruby-core" <ruby-core@...>

Issue #19839 has been reported by shouichi (Shouichi KAMIYA).

27 messages 2023/08/18

[#114410] [Ruby master Bug#19841] Marshal.dump stack overflow with recursive Time — "segiddins (Samuel Giddins) via ruby-core" <ruby-core@...>

Issue #19841 has been reported by segiddins (Samuel Giddins).

9 messages 2023/08/18

[#114422] [Ruby master Feature#19842] Intorduce M:N threads — "ko1 (Koichi Sasada) via ruby-core" <ruby-core@...>

Issue #19842 has been reported by ko1 (Koichi Sasada).

30 messages 2023/08/21

[#114590] [Ruby master Bug#19857] Eval coverage is reset after each `eval`. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #19857 has been reported by ioquatix (Samuel Williams).

21 messages 2023/08/30

[ruby-core:114487] [Ruby master Misc#19777] Make `Kernel#lambda` raise when called without a literal block

From: "mame (Yusuke Endoh) via ruby-core" <ruby-core@...>
Date: 2023-08-24 11:49:10 UTC
List: ruby-core #114487
Issue #19777 has been updated by mame (Yusuke Endoh).


Discussed at the dev meeting. @matz said go ahead.

----------------------------------------
Misc #19777: Make `Kernel#lambda` raise when called without a literal block
https://bugs.ruby-lang.org/issues/19777#change-104273

* Author: alanwu (Alan Wu)
* Status: Open
* Priority: Normal
----------------------------------------
Since 3.0.0, released in 2020, calling `Kernel#lambda` without a literal block
has been issuing a deprecation warning:

```ruby
Warning[:deprecated] = true
def foo(&b) lambda(&b) end
foo {}
# => test.rb:2: warning: lambda without a literal block is deprecated; use the proc without lambda instead
```

I think enough time has passed and we should make it raise in all situations
where it currently issues a deprecation warning. The original decision to
deprecate is here: https://bugs.ruby-lang.org/issues/15973#note-46

The new behavior allows one to predict whether `Kernel#lambda` will return by
inspecting its direct caller, checking whether the call site has a literal
block. It will remove some hard-to-predict cases where `Kernel#lambda` receives
a non-literal block forwarded with `super` or `rb_funcall_passing_block`. The
method will always return a lambda, if it returns. However, note that `send`
will be a special exception in this new model:

```ruby
Warning[:deprecated] = true

singleton_class.send(:public, :lambda)

p (send(:lambda) {}).lambda?         # => true without warning
p (public_send(:lambda) {}).lambda?  # => true with warning, would raise instead
```

This newer model is friendlier to some optimization we're investigating for
YJIT as it has fewer moving parts.




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

In This Thread

Prev Next