[#118346] [Ruby master Bug#20586] Some filesystem calls in dir.c are missing error handling and can return incorrect results if interrupted — "ivoanjo (Ivo Anjo) via ruby-core" <ruby-core@...>
Issue #20586 has been reported by ivoanjo (Ivo Anjo).
13 messages
2024/06/19
[ruby-core:118256] [Ruby master Feature#20565] Relax formal argument at label
From:
"zverok (Victor Shepelev) via ruby-core" <ruby-core@...>
Date:
2024-06-08 14:30:20 UTC
List:
ruby-core #118256
Issue #20565 has been updated by zverok (Victor Shepelev). > I knew you can use keywords as names here but am not quite sure about thi= s. Positional arguments (against my expectations from keyword arguments) do= n't allow any of these three versions. Should they also work? The reason why keywords can be used in names is expressiveness on the calle= r site (not relevant to positional argument), like ```ruby validate :something, if: :something_else association :name, class: "Blah" ``` It is inconvenient to fetch such argument values, but it allows to create v= ery expressive APIs.=20 The alternative would be to have=E2=80=94sometimes discussed=E2=80=94=E2=80= =9Crenaming=E2=80=9D declarations in signatures, something like ```ruby def validate(name, condition if: nil) ``` With argument named `if:` by the caller, but available as a local variable = `condition` in the method body. ---------------------------------------- Feature #20565: Relax formal argument at label https://bugs.ruby-lang.org/issues/20565#change-108753 * Author: nobu (Nobuyoshi Nakada) * Status: Open ---------------------------------------- Just a thought: if `def foo(if:)` is possible, shouldn't `def foo(C:)` and = `def foo($g:)` also be possible...? --=20 https://bugs.ruby-lang.org/