ml.ruby-lang.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

ruby-dev

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
ruby-dev@ml.ruby-lang.org

  • 1 participants
  • 86 discussions
[ruby-dev:52091] [Cloudflare]: Verify Email Routing address
by Cloudflare 03 Jul '24

03 Jul '24
Hello, Verify this Email Routing address to begin receiving forwarded emails by clicking the verify email address link Account Name: Ruby Association https://dash.cloudflare.com/email_fwdr/verify?token=67vHX-KxAIKHClX5I2AzjaT… Once you have verified this email address, manage your Email Routing addresses at https://dash.cloudflare.com/?to=/:account/:zone/email We appreciate your help in building a better Internet. Thank you, Cloudflare If you believe you received this email in error, please contact dash.cloudflare.com/support
1 0
0 0
[ruby-dev:52090] 警告メッセージ - 電子メールのクォータ制限 ruby-dev@ruby-lang.org
by Do-not-reply@ruby-lang.org 26 May '24

26 May '24
1 0
0 0
[ruby-dev:52089] 警告メッセージ - 電子メールのクォータ制限 ruby-dev@ruby-lang.org
by Do-not-reply@ruby-lang.org 23 May '24

23 May '24
1 0
0 0
[ruby-dev:52088] 警告メッセージ - 電子メールのクォータ制限 ruby-dev@ruby-lang.org
by Do-not-reply@ruby-lang.org 23 May '24

23 May '24
1 0
0 0
[ruby-dev:52085] メール通知: 電子メール アカウントをアップグレードします。 Ref#UdnpS
by MailNotification@ruby-lang.org 10 May '24

10 May '24
1 0
0 0
[ruby-dev:52084] [Ruby master Feature#5133] Array#unzip as an alias of Array#transpose
by matz (Yukihiro Matsumoto) 16 Apr '24

16 Apr '24
Issue #5133 has been updated by matz (Yukihiro Matsumoto). Status changed from Assigned to Rejected `unzip` is not really intuitive with Ruby's OO design. Unlike Haskell, Ruby does not have static type issues. Matz. ---------------------------------------- Feature #5133: Array#unzip as an alias of Array#transpose https://bugs.ruby-lang.org/issues/5133#change-107939 * Author: mrkn (Kenta Murata) * Status: Rejected * Assignee: mrkn (Kenta Murata) ---------------------------------------- Array#zip の逆は Array#transpose なんですけど、 この対応関係が非常に分かり難いなと思いました。 Haskell には zip の逆をやる関数として unzip が用意されています。 unzip という名前は、「zip の逆をやりたい」と思ったときに (transpose よりは) 思い付きやすい名前だと思います。 ということで Array#unzip を Array#transpose のエイリアスとして 導入してはどうでしょう? 以下パッチです: diff --git a/array.c b/array.c index 8caad66..dc411b7 100644 --- a/array.c +++ b/array.c @@ -4720,6 +4720,7 @@ Init_Array(void) rb_define_method(rb_cArray, "reject!", rb_ary_reject_bang, 0); rb_define_method(rb_cArray, "zip", rb_ary_zip, -1); rb_define_method(rb_cArray, "transpose", rb_ary_transpose, 0); + rb_define_alias(rb_cArray, "unzip", "transpose"); rb_define_method(rb_cArray, "replace", rb_ary_replace, 1); rb_define_method(rb_cArray, "clear", rb_ary_clear, 0); rb_define_method(rb_cArray, "fill", rb_ary_fill, -1); -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-dev:52082] [Ruby master Feature#5133] Array#unzip as an alias of Array#transpose
by duerst 22 Mar '24

22 Mar '24
Issue #5133 has been updated by duerst (Martin Dürst). In issue #20336, @matheusrich wrote: ``` * [Feature #5133] Array#unzip as an alias of Array#transpose * Seems a more friendly name for this method (easier if you don't have a strong math background) * It is nice that we can do an operation an reverse it with two similar-named methods: ```rb [1, 2, 3, 4].zip(["a", "b", "c", "d"], ["I", "II", "III", "IV"]) # => [[[1, "a"], "I"], [[2, "b"], "II"], [[3, "c"], "III"], [[4, "d"], "IV"]] [[[1, "a"], "I"], [[2, "b"], "II"], [[3, "c"], "III"], [[4, "d"], "IV"]].unzip # => [[1, 2, 3, 4], ["a", "b", "c", "d"], ["I", "II", "III", "IV"]] ``` It's already alluded in some of the comments above: `transpose` is it's own inverse, so if we define `unzip` as an alias for `transpose`, `unzip` will be its own inverse. The reason Haskell has `zip`/`unzip` as inverses is that `zip` in Haskell converts from two lists to a list of pairs, and `unzip` converts from a list of pairs to a pair of lists. In Haskell, `zip` and `unzip` are inverses (up to (un)currying). In Haskell, the arguments of `zip` are limited to two lists. In Ruby, it's one array as receiver and one or more arrays as arguments. For `transpose`, it's an array of arrays. Only the later is fully generic and thus can be made exactly invertible. ---------------------------------------- Feature #5133: Array#unzip as an alias of Array#transpose https://bugs.ruby-lang.org/issues/5133#change-107431 * Author: mrkn (Kenta Murata) * Status: Assigned * Assignee: mrkn (Kenta Murata) ---------------------------------------- Array#zip の逆は Array#transpose なんですけど、 この対応関係が非常に分かり難いなと思いました。 Haskell には zip の逆をやる関数として unzip が用意されています。 unzip という名前は、「zip の逆をやりたい」と思ったときに (transpose よりは) 思い付きやすい名前だと思います。 ということで Array#unzip を Array#transpose のエイリアスとして 導入してはどうでしょう? 以下パッチです: diff --git a/array.c b/array.c index 8caad66..dc411b7 100644 --- a/array.c +++ b/array.c @@ -4720,6 +4720,7 @@ Init_Array(void) rb_define_method(rb_cArray, "reject!", rb_ary_reject_bang, 0); rb_define_method(rb_cArray, "zip", rb_ary_zip, -1); rb_define_method(rb_cArray, "transpose", rb_ary_transpose, 0); + rb_define_alias(rb_cArray, "unzip", "transpose"); rb_define_method(rb_cArray, "replace", rb_ary_replace, 1); rb_define_method(rb_cArray, "clear", rb_ary_clear, 0); rb_define_method(rb_cArray, "fill", rb_ary_fill, -1); -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-dev:52080] [Ruby master Feature#6317] Range#cover?の引数としてRangeインスタンスを受けられるようにして欲しい
by matheusrich (Matheus Richard) 19 Mar '24

19 Mar '24
Issue #6317 has been updated by matheusrich (Matheus Richard). @mame @naruse This currently works on Ruby. Can we close this as completed? ---------------------------------------- Feature #6317: Range#cover?の引数としてRangeインスタンスを受けられるようにして欲しい https://bugs.ruby-lang.org/issues/6317#change-107335 * Author: masaakiaoyagi (Masaaki Aoyagi) * Status: Assigned * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- 青柳と申します。 以下のように、Range#cover?の引数としてRangeインスタンスを 受けられるようにして欲しいです。 (1..4).cover?(2..3) # => true (1..4).cover?(0..3) # => false 取り敢えず実装してみましたので、添付いたします。 ---Files-------------------------------- range_cover.diff (2.17 KB) -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-dev:52076] [Ruby master Bug#16297] calling undefined allocator by `Class.instance_method(:allocate)`
by jhawthorn (John Hawthorn) 29 Feb '24

29 Feb '24
Issue #16297 has been updated by jhawthorn (John Hawthorn). I'm not sure if there's a deeper problem this causes, but it is still possible after this patch to call the allocator on a Rational through defining an arbitrary `allocate` method. ``` ruby >> def Rational.allocate; end => :allocate >> Class.instance_method(:allocate).bind_call(Rational) => (0/1) ``` ---------------------------------------- Bug #16297: calling undefined allocator by `Class.instance_method(:allocate)` https://bugs.ruby-lang.org/issues/16297#change-107083 * Author: nobu (Nobuyoshi Nakada) * Status: Closed * Backport: 2.5: REQUIRED, 2.6: DONE ---------------------------------------- For instance, `Rational.allocate` is undefined. ```ruby Rational.allocate #=> undefined method `allocate' for Rational:Class (NoMethodError) ``` But it can be called by `Class.instance_method(:allocate)`. ```ruby Class.instance_method(:allocate).bind_call(Rational) #=> (0/1) Class.instance_method(:allocate).bind(Rational).call #=> (0/1) ``` These allocators are defined for Marshal, and undefined as methods. -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-dev:52068] [Ruby master Bug#10436] ruby -c and ripper inconsistency: m(&nil) {}
by yui-knk (Kaneko Yuichiro) 20 Feb '24

20 Feb '24
Issue #10436 has been updated by yui-knk (Kaneko Yuichiro). Status changed from Open to Closed This is solved by https://bugs.ruby-lang.org/issues/20257 (https://github.com/ruby/ruby/pull/9923) ---------------------------------------- Bug #10436: ruby -c and ripper inconsistency: m(&nil) {} https://bugs.ruby-lang.org/issues/10436#change-106914 * Author: akr (Akira Tanaka) * Status: Closed * Priority: Normal * ruby -v: ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- m(&nil) {} というまちがったコードは ruby -c でちゃんとエラーになるのに、 Ripper.sexp ではならないようです。 ``` % cat z.rb m(&nil) {} % ruby -c z.rb z.rb:1: both block arg and actual block given % ruby -rripper -e 'p Ripper.sexp(STDIN.read)' < z.rb [:program, [[:method_add_block, [:method_add_arg, [:fcall, [:@ident, "m", [1, 0]]], [:arg_paren, [:args_add_block, [], [:var_ref, [:@kw, "nil", [1, 3]]]]]], [:brace_block, nil, [[:void_stmt]]]]]] % ruby -v ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux] ``` ---Files-------------------------------- ripper-block_dup_check-10436.patch (2.2 KB) -- https://bugs.ruby-lang.org/
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.