[#84280] [Ruby trunk Bug#14181] hangs or deadlocks from waitpid, threads, and trapping SIGCHLD — nobu@...
Issue #14181 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/12/15
[#84398] [Ruby trunk Bug#14220] WEBrick changes - failures on MSWIN, MinGW — Greg.mpls@...
Issue #14220 has been reported by MSP-Greg (Greg L).
3 messages
2017/12/22
[#84472] Re: [ruby-dev:50394] [Ruby trunk Bug#14240] warn four special variables: $; $, $/ $\ — Eric Wong <normalperson@...>
Shouldn't English posts be on ruby-core instead of ruby-dev?
3 messages
2017/12/26
[ruby-core:84110] [Ruby trunk Feature#11925] Struct construction with kwargs
From:
takashikkbn@...
Date:
2017-12-06 13:57:41 UTC
List:
ruby-core #84110
Issue #11925 has been updated by k0kubun (Takashi Kokubun). Similar to one commented by ko1, how about this interface? ~~~ ruby T = Struct.new(:a, :b, keyword_argument: true) T.new(a: 1, b: 2) ~~~ ---------------------------------------- Feature #11925: Struct construction with kwargs https://bugs.ruby-lang.org/issues/11925#change-68208 * Author: prijutme4ty (Ilya Vorontsov) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Propose to make Struct subclass constructors which accept keyword arguments. Not sure, if it's reasonable to allow `.new` accept kwargs, so may be should use different method named like `.create`: ```ruby Point = Struct.new(:x,:y, :color) pt_1 = Point.create(x: 1, y: 2) # => Point<x: 1, y: 2, color: nil> pt_2 = Point.create!(x: 1, y: 2) # => ArgumentError, color not specified. ``` It will greatly simplify work with big structures, especially in cases when struct layout changes and for cases when structure can have lots of non-significant values. It also allows simpler ways to use implement default values for struct members. -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>