æ¦è¦ åèè ã®è¨±è«¾ãå¾ã¦ç¿»è¨³ã»å ¬éãããã¾ãã è±èªè¨äº: It is not what you expect, but it is what you want: how Data#initialize is designed åæå ¬éæ¥: 2023/01/03 åèè : zverok æ¥æ¬èªã¿ã¤ãã«ã¯å 容ã«å³ãããã®ã«ãã¾ããã åè: class Data (Ruby 3.2 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã«) åè: class Struct (Ruby 3.2 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã«) ãªããDataãStructããnewã§ä½ç½®å¼æ°ã¨ãã¼ã¯ã¼ãå¼æ°ã"æ··ãã¦"åæã«æ¸¡ããã¨ã¯æ³å®ããã¦ãã¾ããï¼æ¬è¨äºã«ãããããç¨ä¾ã¯ããã¾ããï¼ãä½ç½®å¼æ°ããã¼ã¯ã¼ãå¼æ°ã®ã©ã¡ãã1種é¡ã«çµ±ä¸ãã¦æ¸¡ãå¿ è¦ãããã¾ãã new(x:1, 2)ã¯ãDataã¨Structã©ã¡ãã®å ´åãSyntaxErrorã«ãª
{{#tags}}- {{label}}
{{/tags}}