[#111712] [Ruby master Feature#19322] Support spawning "private" child processes — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5MzIyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtqdHNhbmFrdHNpZGlzIChLSiBUc2Fu
14 messages
2023/01/07
[ruby-core:111923] [Ruby master Bug#19286] What should kwargs' arity be?
From:
"mame (Yusuke Endoh) via ruby-core" <ruby-core@...>
Date:
2023-01-20 05:58:32 UTC
List:
ruby-core #111923
Issue #19286 has been updated by mame (Yusuke Endoh). Discussed at the dev meeting. @matz said the current behavior is fair, and @matsuda agreed with that. So keep it as is. ---------------------------------------- Bug #19286: What should kwargs' arity be? https://bugs.ruby-lang.org/issues/19286#change-101346 * Author: matsuda (Akira Matsuda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2022-12-28T16:43:05Z master cada537040) +YJIT [arm64-darwin21] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Hello, guys. It's time for a quick Ruby quiz. Q: What is this method's arity? def f(a:, b:) end It requires two arguments, hence it should be 2? Or if we call this method with one argument, the error message says "wrong number of arguments (given 1, expected 0; required keywords: a, b) (ArgumentError)", which means the arity is 0, maybe? A: The answer is, $ all-ruby -e 'p method(def f(a:, b:) end).arity' ruby-2.1.0-preview1 0 ... ruby-2.1.0 0 ruby-2.1.1 -1 ruby-2.1.2 1 ... ruby-3.1.0 1 it's been 1 since 2.1.2. But why 1? Why not 2 nor 0? I asked this question to the ruby-core people, and ko1's answer was that even he has no idea what the number 1 means.  So I thought it'd be worth asking this question here. ---Files-------------------------------- random_-_ruby-lang_-_Slack.png (40.1 KB) -- 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/