{"id":83914,"date":"2020-12-09T08:04:25","date_gmt":"2020-12-08T23:04:25","guid":{"rendered":"https:\/\/www.softantenna.com\/wp\/?p=83914"},"modified":"2020-12-09T08:04:25","modified_gmt":"2020-12-08T23:04:25","slug":"ruby-3-0-0-preview2-released","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/ruby-3-0-0-preview2-released\/","title":{"rendered":"Ruby 3.0.0-preview2\u304c\u30ea\u30ea\u30fc\u30b9 - 12\u670825\u65e5\u516c\u958b\u4e88\u5b9a\u306eRuby 3.0\u306b\u5411\u3051\u305f\u30d7\u30ec\u30d3\u30e5\u30fc\u7248"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2020\/12\/s_20201208_203300.jpg\" alt=\"S 20201208 203300\" title=\"s_20201208_203300.jpg\" border=\"0\" width=\"981\" height=\"611\" \/><\/p>\n<p>Ruby\u958b\u767a\u30c1\u30fc\u30e0\u306f12\u67088\u65e5\u3001Ruby 3.0\u30b7\u30ea\u30fc\u30ba\u306e2\u756a\u76ee\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u7248\u3067\u3042\u308b\u300cRuby 3.0.0-preview2\u300d\u3092\u516c\u958b\u3057\u305f\u307e\u3057\u305f(<a href=\"https:\/\/www.ruby-lang.org\/ja\/news\/2020\/12\/08\/ruby-3-0-0-preview2-released\/\">ruby-lang.org<\/a>)\u300212\u670825\u65e5\u306b\u516c\u958b\u4e88\u5b9a\u306eRuby 3.0\u306b\u5411\u3051\u3001\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u5f97\u308b\u305f\u3081\u306e\u30ea\u30ea\u30fc\u30b9\u3068\u4f4d\u7f6e\u3065\u3051\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Ruby 3.0\u306b\u306f\u3001\u591a\u304f\u306e\u65b0\u6a5f\u80fd\u3084\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6539\u826f\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001Ruby\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u578b\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308bRBS\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3001\u30af\u30e9\u30b9\u3084\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5b9a\u7fa9\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u3001RBS\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u30bf\u30a4\u30d7\u30d7\u30ed\u30d5\u30a1\u30a4\u30e9\u3084\u305d\u306e\u4ed6\u30c4\u30fc\u30eb\u304b\u3089\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>module ChatApp\r\n  VERSION: String\r\n  class Channel\r\n    attr_reader name: String\r\n    attr_reader messages: Array[Message]\r\n    attr_reader users: Array[User | Bot]              # `|` \u306f `User` \u304b `Bot` \u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8868\u73fe\u3059\u308b\u300c\u30e6\u30cb\u30aa\u30f3\u578b\u300d\u3067\u3059\r\n    def initialize: (String) -> void\r\n    def post: (String, from: User | Bot) -> Message   # \u30e1\u30bd\u30c3\u30c9\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\r\n            | (File, from: User | Bot) -> Message\r\n  end\r\nend<\/pre>\n<p>\u307e\u305f\u3001\u5b9f\u9a13\u7684\u306a\u6a5f\u80fd\u3068\u3057\u3066TypeProf\u3068\u547c\u3070\u308c\u308b\u578b\u89e3\u6790\u30c4\u30fc\u30eb\u304c\u540c\u68b1\u3055\u308c\u3066\u3044\u307e\u3059\u3002TypeProf\u3092\u4f7f\u7528\u3057\u3001\u578b\u6ce8\u91c8\u306e\u7121\u3044\u666e\u901a\u306eRuby\u30b3\u30fc\u30c9\u304b\u3089\u3001\u578b\u30b7\u30b0\u30cd\u30c1\u30e3\u306e\u30d7\u30ed\u30c8\u30bf\u30a4\u30d7\u3092RBS\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b\u3001\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u3092\u8003\u616e\u3059\u308b\u3053\u3068\u306a\u304f\u4e26\u5217\u5b9f\u884c\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u8a2d\u8a08\u3055\u308c\u305f\u3001\u30a2\u30af\u30bf\u30fc\u30e2\u30c7\u30eb\u306e\u3088\u3046\u306a\u4e26\u5217\u62bd\u8c61\u5316\u6a5f\u80fd\u3067\u3042\u308bRactor\u304c\u8a66\u9a13\u7684\u6a5f\u80fd\u3068\u3057\u3066\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u958b\u767a\u8005\u306f\u8907\u6570\u306eRactor\u3092\u4f5c\u6210\u3057\u3066\u4e26\u5217\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u901a\u5e38\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u306a\u4e26\u5217\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7c21\u5358\u306b\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Ractor\u9593\u306e\u901a\u4fe1\u306b\u306f\u30e1\u30c3\u30bb\u30fc\u30b8\u30d1\u30c3\u30b7\u30f3\u30b0\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>require 'prime'\r\n\r\n# n.prime? with sent integers in r1, r2 run in parallel\r\nr1, r2 = *(1..2).map do\r\n  Ractor.new do\r\n    n = Ractor.recv\r\n    n.prime?\r\n  end\r\nend\r\n\r\n# send parameters\r\nr1.send 2**61 - 1\r\nr2.send 2**61 + 15\r\n\r\n# wait for the results of expr1, expr2\r\np r1.take #=> true\r\np r2.take #=> true<\/pre>\n<p>\u305d\u306e\u4ed6\u30011\u884c\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u306e\u300c<code>in<\/code>\u300d\u304b\u3089\u300c<code>=><\/code>\u300d\u3078\u306e\u5909\u66f4\u3001\u4e00\u884c\u30e1\u30bd\u30c3\u30c9\u5b9a\u7fa9\u300c<code>def square(x) = x * x<\/code>\u300d\u306e\u8ffd\u52a0\u3001find\u30d1\u30bf\u30fc\u30f3\u306e\u8ffd\u52a0\u3001Hash#except\u306e\u7d44\u307f\u8fbc\u307f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6539\u826f\u306a\u3069\u3055\u307e\u3056\u307e\u306a\u65b0\u6a5f\u80fd\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>2.7\u304b\u3089\u306e\u5909\u66f4\u70b9\u3092\u542b\u3081\u8a73\u7d30\u306f<a href=\"https:\/\/www.ruby-lang.org\/ja\/news\/2020\/12\/08\/ruby-3-0-0-preview2-released\/\">\u3053\u3061\u3089<\/a>\u3067\u78ba\u8a8d\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<table>\n<tr>\n<th rowspan='4' style='white-space: nowrap;'><img decoding=\"async\" style=\"max-width: 52px; height: auto;\" src=\"\/assets\/pc-301b359275e3cfd18baf480ee6dd6d484a27fdc417431ff7dd5cd26d895260b0.png\" alt=\"Pc\" \/><\/th>\n<th style='white-space: nowrap;'>\u30bf\u30a4\u30c8\u30eb<\/th>\n<td>Ruby<\/td>\n<\/tr>\n<tr>\n<th style='white-space: nowrap;'>\u516c\u5f0f\u30b5\u30a4\u30c8<\/th>\n<td><a href=\"http:\/\/www.ruby-lang.org\/ja\/\">http:\/\/www.ruby-lang.org\/ja\/<\/a><\/td>\n<\/tr>\n<tr>\n<th style='white-space: nowrap;'>\u30bd\u30d5\u30c8\u30a2\u30f3\u30c6\u30ca<\/th>\n<td><a href=\"https:\/\/softantenna.com\/softwares\/1964-ruby\">https:\/\/softantenna.com\/softwares\/1964-ruby<\/a><\/td>\n<\/tr>\n<tr>\n<th style='white-space: nowrap;'>\u8aac\u660e<\/th>\n<td>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30b9\u30af\u30ea\u30d7\u30c8\u8a00\u8a9e\u3002<\/td>\n<\/tr>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Ruby\u958b\u767a\u30c1\u30fc\u30e0\u306f12\u67088\u65e5\u3001Ruby 3.0\u30b7\u30ea\u30fc\u30ba\u306e2\u756a\u76ee\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u7248\u3067\u3042\u308b\u300cRuby 3.0.0-preview2\u300d\u3092\u516c\u958b\u3057\u305f\u307e\u3057\u305f(ruby-lang.org)\u300212\u670825\u65e5\u306b\u516c\u958b\u4e88\u5b9a\u306eRuby 3.0\u306b\u5411\u3051 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":83916,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[154],"class_list":["post-83914","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-ruby"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/83914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=83914"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/83914\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/83916"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=83914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=83914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=83914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}