From: "esad (Esad Hajdarevic) via ruby-core" Date: 2024-09-04T21:04:37+00:00 Subject: [ruby-core:119047] [Ruby master Feature#16378] Support leading arguments together with ... Issue #16378 has been updated by esad (Esad Hajdarevic). Is there a reason why this doesn't work with keyword arguments too? For example: ``` def foo(bar:, ...) other(...) end ``` results in syntax error ---------------------------------------- Feature #16378: Support leading arguments together with ... https://bugs.ruby-lang.org/issues/16378#change-109625 * Author: Eregon (Benoit Daloze) * Status: Closed * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.0 ---------------------------------------- I think this is very important, otherwise `...` can be used only very rarely. For instance, `method_missing` typically want to access the method name like: ```ruby def method_missing(name, ...) if name.to_s.end_with?('?') self[name] else fallback(name, ...) end end ``` See the original feature: https://bugs.ruby-lang.org/issues/16253#note-19. I think most people expect `def method_missing(name, ...)` to work. ---Files-------------------------------- ruby_2_7_lead_args_forwarding.patch (8.98 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/lists/ruby-core.ml.ruby-lang.org/