{"id":6760,"date":"2024-05-10T09:21:14","date_gmt":"2024-05-10T00:21:14","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=6760"},"modified":"2024-05-13T10:43:37","modified_gmt":"2024-05-13T01:43:37","slug":"%e8%a4%87%e6%95%b0%e3%81%ae%e9%96%a2%e6%95%b0%e6%88%bb%e3%82%8a%e5%80%a4%e3%82%92%e8%bf%94%e5%8d%b4%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/6760","title":{"rendered":"\u8907\u6570\u306e\u95a2\u6570\u623b\u308a\u5024\u3092\u8fd4\u5374\u3059\u308b"},"content":{"rendered":"<h3>Ruby<\/h3>\n<h4>\u591a\u91cd\u4ee3\u5165<\/h4>\n<h5>\u5358\u7d14\u306a\u591a\u91cd\u4ee3\u5165\u306e\u30b3\u30fc\u30c9\u4f8b<\/h5>\n<pre class=\"lang:ruby decode:true \" >foo, bar, baz = 1, 2, 3<\/pre>\n<h5>\u591a\u91cd\u4ee3\u5165\u3067\u8907\u6570\u306e\u623b\u308a\u5024\u3092\u8fd4\u3059\u30b3\u30fc\u30c9\u4f8b<\/h5>\n<pre class=\"lang:ruby decode:true \" >def swap(x,y)\r\n  return y, x      # \u8907\u6570\u306e\u5024\u3092\u8fd4\u3059\r\nend\r\n\r\na, b = swap(a, b)<\/pre>\n<h4>\u516c\u5f0f\u30ea\u30f3\u30af<\/h4>\n<ul>\n<li><a href=\"https:\/\/docs.ruby-lang.org\/ja\/latest\/doc\/spec=2foperator.html#multiassign\">\u591a\u91cd\u4ee3\u5165<\/a><\/li>\n<\/ul>\n<hr>\n<h3>Python<\/h3>\n<h4>\u30bf\u30d7\u30eb (tuple)<\/h4>\n<h5>\u5358\u7d14\u306a\u30bf\u30d7\u30eb\u306e\u30b3\u30fc\u30c9\u4f8b<\/h5>\n<pre class=\"lang:python decode:true \" >t = 12345, 54321, 'hello!'<\/pre>\n<h5>\u30bf\u30d7\u30eb\u3067\u8907\u6570\u306e\u623b\u308a\u5024\u3092\u8fd4\u3059\u30b3\u30fc\u30c9\u4f8b<\/h5>\n<pre class=\"lang:python decode:true \" >def foo():\r\n  return 100, 'Hello'<\/pre>\n<p>\u30ab\u30f3\u30de <code>,<\/code> \u3067\u533a\u5207\u308b\u3053\u3068\u3067\u30bf\u30d7\u30eb\u3068\u306a\u308b\u3002\u4e38\u62ec\u5f27 <code>( )<\/code> \u306f\u5fc5\u305a\u3057\u3082\u5fc5\u9808\u306e\u69cb\u6587\u3067\u306f\u306a\u3044\u3002\u53ef\u8aad\u6027\u5411\u4e0a\u3084\u30cd\u30b9\u30c8\u69cb\u9020\u306e\u3070\u3042\u3044\u306b <code>( )<\/code> \u304c\u5fc5\u8981\u3068\u306a\u308b\u3002<\/p>\n<h4>\u516c\u5f0f\u30ea\u30f3\u30af<\/h4>\n<ul>\n<li><a href=\"https:\/\/docs.python.org\/ja\/3\/tutorial\/datastructures.html#tuples-and-sequences\">\u30bf\u30d7\u30eb\u3068\u30b7\u30fc\u30b1\u30f3\u30b9<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Ruby \u591a\u91cd\u4ee3\u5165 \u5358\u7d14\u306a\u591a\u91cd\u4ee3\u5165\u306e\u30b3\u30fc\u30c9\u4f8b foo, bar, baz = 1, 2, 3 \u591a\u91cd\u4ee3\u5165\u3067\u8907\u6570\u306e\u623b\u308a\u5024\u3092\u8fd4\u3059\u30b3\u30fc\u30c9\u4f8b def swap(x,y) return y, x # \u8907\u6570\u306e\u5024\u3092\u8fd4\u3059 end a, b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[52,12],"class_list":["post-6760","post","type-post","status-publish","format-standard","hentry","category-memo","tag-python","tag-ruby"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/6760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=6760"}],"version-history":[{"count":9,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/6760\/revisions"}],"predecessor-version":[{"id":6776,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/6760\/revisions\/6776"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=6760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=6760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=6760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}