From: "zverok (Victor Shepelev)" Date: 2021-09-15T10:00:20+00:00 Subject: [ruby-core:105265] [Ruby master Feature#14579] Hash value omission Issue #14579 has been updated by zverok (Victor Shepelev). @duerst > I don't think using `if` as the name of a local variable is a good idea, It is good (and widely used, BTW) name for a method parameter, in contexts like ```ruby validate :foo, if: :something? ``` I don't see how it is bad idea, while producing the clearest method call convention for "conditional" DSLs. ---------------------------------------- Feature #14579: Hash value omission https://bugs.ruby-lang.org/issues/14579#change-93675 * Author: shugo (Shugo Maeda) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- How about to allow value omission in Hash literals: ```ruby x = 1 y = 2 h = {x:, y:} p h #=> {:x=>1, :y=>2} ``` And in keyword arguments: ```ruby def login(username: ENV["USER"], password:) p(username:, password:) end login(password: "xxx") #=> {:username=>"shugo", :password=>"xxx"} ``` ---Files-------------------------------- hash_value_omission.diff (619 Bytes) -- https://bugs.ruby-lang.org/ Unsubscribe: