{"id":1902,"date":"2024-04-26T07:48:01","date_gmt":"2024-04-25T23:48:01","guid":{"rendered":"https:\/\/wp.minicoda.com\/?p=1902"},"modified":"2024-10-25T17:05:28","modified_gmt":"2024-10-25T09:05:28","slug":"%e5%a4%9a%e5%8f%98%e9%87%8f%e5%88%9d%e5%a7%8b%e5%8c%96","status":"publish","type":"post","link":"https:\/\/wp.minicoda.com\/index.php\/%e5%a4%9a%e5%8f%98%e9%87%8f%e5%88%9d%e5%a7%8b%e5%8c%96\/","title":{"rendered":"\u591a\u53d8\u91cf\u521d\u59cb\u5316"},"content":{"rendered":"\n<p>  \u9664\u4e86\u7f16\u7a0b\u8bed\u8a00\u63d0\u4f9b\u7684\u521d\u59cb\u5316\u8d4b\u503c\u5bf9\u591a\u4e2a\u53d8\u91cf\u521d\u59cb\u5316\uff0c\u8fde\u7eed\u8d4b\u503c\u540c\u65f6\u521d\u59cb\u5316\u591a\u4e2a\u76f8\u540c\u53d8\u91cf\u3002\u8fd9\u4e9b\u57fa\u672c\u7684\u521d\u59cb\u5316\u7c7b\u4f3c\u4e8e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>int a = 1, b = 2;<\/li>\n\n\n\n<li>a = b = 1;<\/li>\n<\/ul>\n\n\n\n<p>  C\/ObjC\/C++\/VB\/Java\u90fd\u652f\u6301\u5982\u4e0a\u57fa\u672c\u7684\u591a\u53d8\u91cf\u7edf\u4e00\u521d\u59cb\u5316\u65b9\u5f0f\u3002<\/p>\n\n\n\n<p>  \u9664\u4e86\u4e0a\u9762\uff0c\u8fd8\u6709\u4e00\u4e9b\u66f4\u8212\u9002\u7684\u521d\u59cb\u5316\u65b9\u5f0f\uff1a\u591a\u53d8\u91cf\u5206\u522b\u521d\u59cb\u5316\u65b9\u5f0f\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Swift\u548cRust\u63d0\u4f9btuple\u5bf9\u591a\u4e2a\u53d8\u91cf\u521d\u59cb\u5316<br>\u4f8b\u5982let (x, y) = (1, 2)\u4f1a\u5c06x\u8d4b\u503c\u4e3a1\uff0cy\u8d4b\u503c\u4e3a2.<\/li>\n\n\n\n<li>Go\u8bed\u8a00\u63d0\u4f9b\u5f62\u5982 x, y := 1, 2 \u521d\u59cb\u5316x\u548cy\u4e24\u4e2a\u53d8\u91cf\uff0c\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u4e24\u4e2a\u53d8\u91cf\u7684\u5feb\u901f\u4ea4\u6362\uff0c\u5982 a, b = b, a<\/li>\n\n\n\n<li>Python\u53ef\u4ee5\u76f4\u63a5\u7528\u4e0b\u9762\u5b8c\u62103\u4e2a\u53d8\u91cf\u521d\u59cb\u5316\uff1aa, b, c = 1, 2, 3<\/li>\n\n\n\n<li>C# 7.0\u5f15\u5165\u89e3\u6784\u8d4b\u503c\uff0c\u7c7b\u4f3ctuple\u7684\u591a\u53d8\u91cf\u521d\u59cb\u5316\u4e5f\u53ef\u4ee5\u8f7b\u677e\u5b8c\u6210\uff1a<br>(int x, int y) = (10, 20);<br>(x, y) = (1, 2);<\/li>\n\n\n\n<li>JS\u4e5f\u63d0\u4f9b\u89e3\u6784\u8d4b\u503c\u521d\u59cb\u5316\u591a\u4e2a\u53d8\u91cf\uff0c\u5982\u4e0b\u793a\u4f8b\u7684x, y, z\u53ef\u4ee5\u5355\u72ec\u4f7f\u7528\u3002<br>let { x, y, z } = { x: 1, y: 2, z: 3 };<\/li>\n\n\n\n<li>C++\u867d\u7136\u63d0\u4f9btuple\u5143\u7ec4\uff0c\u4f46\u521d\u59cb\u5316\u65b9\u5f0f\u5e76\u4e0d\u50cf\u4e0b\u9762\u63d0\u5230\u7684\u65b9\u4fbf\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e0d\u540c\u7c7b\u578b\u7684\u591a\u53d8\u91cf\u521d\u59cb\u5316<\/h3>\n\n\n\n<p>  \u6709\u7684\u65f6\u5019\uff0c\u6211\u4eec\u60f3\u8981\u5728\u4e00\u884c\u4ee3\u7801\u4e2d\u521d\u59cb\u5316\u4e24\u4e2a\u4e0d\u540c\u7c7b\u578b\u7684\u53d8\u91cf\uff1aint a = 1, double b = 3.14; \u5982\u679c\u662f\u7c7b\u578b\u653e\u5728\u53d8\u91cf\u524d\u9762\u7684\u7f16\u7a0b\u8bed\u8a00\u4e00\u822c\u90fd\u4e0d\u80fd\u652f\u6301\uff0c\u4f46\u7c7b\u578b\u653e\u5728\u7c7b\u578b\u540e\u9762\u7684\u7f16\u7a0b\u8bed\u8a00\u5374\u5f88\u5bb9\u6613\u652f\u6301\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\/ObjC\/C++\/Java\/C# \u5747\u4e0d\u80fd\u652f\u6301\u8fd9\u79cd\u884c\u4e3a\u3002<\/li>\n\n\n\n<li>Swift \u53ef\u4ee5\u5b9e\u73b0\uff1alet a: Int = 1, b: Double = 3.14<\/li>\n\n\n\n<li>Go\u8bed\u8a00\u652f\u6301\u591a\u4e2a\u4e0d\u540c\u7c7b\u578b\u53d8\u91cf\u521d\u59cb\u5316\uff0c\u9700\u8981\u653e\u5728\u62ec\u53f7\u91cc\u9762<br>var (<br>  name string = \"alex\"<br>  age int = 28<br>)<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u591a\u4e2a\u53d8\u91cf\u521d\u59cb\u5316\u53ea\u7528\u90e8\u5206<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5c3d\u7ba1\u7c7b\u4f3cGo\u8bed\u8a00\u63d0\u4f9b\u591a\u4e2a\u53d8\u91cf\u540c\u65f6\u521d\u59cb\u5316\uff0c\u4f46\u6709\u65f6\u53c8\u4e0d\u60f3\u591a\u4e2a\u53d8\u91cf\u90fd\u8981\u7528\uff0c\u53ea\u60f3\u7528\u5173\u5fc3\u7684\u3002Go\u8bed\u8a00\u63d0\u4f9b\u7a7a\u767d\u6807\u8bc6\u7b26\"_\"\u6765\u9690\u85cf\u53d8\u91cf\uff0c\u6b64\u53d8\u91cf\u53c8\u88ab\u79f0\u4e3a\u533f\u540d\u53d8\u91cf\uff0c\u4e0d\u8fc7\u4e0d\u80fd\u8f93\u51fa\u533f\u540d\u53d8\u91cf\u3002<br>\u4f8b\u5982\u53ea\u60f3\u83b7\u53d6HTTP\u7684status:<br>  status, _ = 200, \"HTTP request is OK\"<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u9664\u4e86\u7f16\u7a0b\u8bed\u8a00\u63d0\u4f9b\u7684\u521d\u59cb\u5316\u8d4b\u503c\u5bf9\u591a\u4e2a\u53d8\u91cf\u521d\u59cb\u5316\uff0c\u8fde\u7eed\u8d4b\u503c\u540c\u65f6\u521d\u59cb\u5316\u591a\u4e2a\u76f8\u540c\u53d8\u91cf\u3002\u8fd9\u4e9b\u57fa\u672c\u7684\u521d\u59cb\u5316\u7c7b\u4f3c\u4e8e\uff1a C\/ObjC\/C++\/VB\/Java\u90fd\u652f\u6301\u5982\u4e0a\u57fa\u672c\u7684\u591a\u53d8\u91cf\u7edf\u4e00\u521d\u59cb\u5316\u65b9\u5f0f\u3002 \u9664\u4e86\u4e0a\u9762\uff0c\u8fd8\u6709\u4e00\u4e9b\u66f4&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299],"tags":[],"class_list":["post-1902","post","type-post","status-publish","format-standard","hentry","category-think"],"views":168,"_links":{"self":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/1902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/comments?post=1902"}],"version-history":[{"count":10,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/1902\/revisions"}],"predecessor-version":[{"id":3125,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/posts\/1902\/revisions\/3125"}],"wp:attachment":[{"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/media?parent=1902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/categories?post=1902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.minicoda.com\/index.php\/wp-json\/wp\/v2\/tags?post=1902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}