{"id":2108,"date":"2023-02-21T14:11:41","date_gmt":"2023-02-21T06:11:41","guid":{"rendered":"https:\/\/courtship.top\/?p=2108"},"modified":"2023-02-21T14:11:41","modified_gmt":"2023-02-21T06:11:41","slug":"lua%e9%97%ad%e5%8c%85","status":"publish","type":"post","link":"https:\/\/courtship.top\/index.php\/2023\/02\/21\/lua%e9%97%ad%e5%8c%85\/","title":{"rendered":"Lua\u95ed\u5305"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">upvalue<\/h2>\n\n\n\n<p>\u5982\u679c\u51fd\u6570f2\u5b9a\u4e49\u5728\u51fd\u6570f1\u4e2d\uff0c\u90a3\u4e48f2\u4e3af1\u7684\u5185\u5d4c\u51fd\u6570\uff0cf1\u4e3af2\u7684\u5916\u5305\u51fd\u6570\uff0c\u5916\u5305\u548c\u5185\u5d4c\u90fd\u5177\u6709\u4f20\u9012\u6027\uff0c\u5373f2\u7684\u5185\u5d4c\u5fc5\u7136\u662ff1\u7684\u5185\u5d4c\uff0c\u800cf1\u7684\u5916\u5305\u4e5f\u4e00\u5b9a\u662ff2\u7684\u5916\u5305\u3002<\/p>\n\n\n\n<p><strong>\u5185\u5d4c\u51fd\u6570\u53ef\u4ee5\u8bbf\u95ee\u5916\u5305\u51fd\u6570\u5df2\u7ecf\u521b\u5efa\u7684\u5c40\u90e8\u53d8\u91cf\uff0c\u800c\u8fd9\u4e9b\u5c40\u90e8\u53d8\u91cf\u5219\u79f0\u4e3a\u8be5\u5185\u5d4c\u51fd\u6570\u7684\u5916\u90e8\u5c40\u90e8\u53d8\u91cf\uff08\u6216\u8005upvalue\uff09<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function\u3000f1(n)\n\t--\u3000\u51fd\u6570\u53c2\u6570\u4e5f\u662f\u5c40\u90e8\u53d8\u91cf\n\tlocal\u3000function\u3000f2()\n\t\tprint(n)\u3000--\u3000\u5f15\u7528\u5916\u5305\u51fd\u6570\u7684\u5c40\u90e8\u53d8\u91cf\n\tend\n\treturn\u3000f2\nend\ng1\u3000=\u3000f1(1979)\ng1()\u3000--\u3000\u6253\u5370\u51fa1979\ng2\u3000=\u3000f1(500)\ng2()\u3000--\u3000\u6253\u5370\u51fa500<\/code><\/pre>\n\n\n\n<p>\u5f53\u6267\u884c\u5b8cg1=f1(1979)\u540e\uff0c\u5c40\u90e8\u53d8\u91cfn\u7684\u751f\u547d\u672c\u8be5\u7ed3\u675f\uff0c\u4f46\u56e0\u4e3a\u5b83\u5df2\u7ecf\u6210\u4e86\u5185\u5d4c\u51fd\u6570f2\u7684upvalue\uff0cf2\u53c8\u88ab\u8d4b\u7ed9\u4e86\u53d8\u91cfg1\uff0c\u6240\u4ee5\u5b83\u4ecd\u7136\u80fd\u4ee5\u67d0\u79cd\u5f62\u5f0f\u7ee7\u7eed\u201c\u5b58\u6d3b\u201d\u4e0b\u6765\uff0c\u4ece\u800c\u4ee4g1()\u6253\u5370\u51fa\u6b63\u786e\u7684\u503c<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u95ed\u5305<\/h2>\n\n\n\n<p><strong>\u5728Lua\u4e2d\uff0c\u95ed\u5305\uff08closure\uff09\u662f\u7531\u4e00\u4e2a\u51fd\u6570\u548c\u8be5\u51fd\u6570\u4f1a\u8bbf\u95ee\u5230\u7684\u975e\u5c40\u90e8\u53d8\u91cf\uff08\u6216\u8005\u662fupvalue\uff09\u7ec4\u6210\u7684<\/strong>\uff0c\u5176\u4e2d\u975e\u5c40\u90e8\u53d8\u91cf\uff08non-local variable\uff09\u662f\u6307\u4e0d\u662f\u5728\u5c40\u90e8\u4f5c\u7528\u8303\u56f4\u5185\u5b9a\u4e49\u7684\u4e00\u4e2a\u53d8\u91cf\uff0c\u4f46\u540c\u65f6\u53c8\u4e0d\u662f\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\uff0c\u4e3b\u8981\u5e94\u7528\u5728\u5d4c\u5957\u51fd\u6570\u548c\u533f\u540d\u51fd\u6570\u91cc\uff0c\u56e0\u6b64\u82e5\u4e00\u4e2a\u95ed\u5305\u6ca1\u6709\u4f1a\u8bbf\u95ee\u7684\u975e\u5c40\u90e8\u53d8\u91cf\uff0c\u90a3\u4e48\u5b83\u5c31\u662f\u901a\u5e38\u8bf4\u7684\u51fd\u6570\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728Lua\u4e2d\uff0c\u51fd\u6570\u662f\u95ed\u5305\u4e00\u79cd\u7279\u6b8a\u60c5\u51b5\u3002\u53e6\u5916\u5728Lua\u7684C API\u4e2d\uff0c\u6240\u6709\u5173\u4e8eLua\u4e2d\u7684\u51fd\u6570\u7684\u6838\u5fc3API\u90fd\u662f\u4ee5closure\uff08\u800c\u975efunction\uff09\u6765\u547d\u540d\u7684\uff0c\u4e5f\u53ef\u89c6\u4e3a\u8fd9\u4e00\u89c2\u70b9\u7684\u5ef6\u7eed\u3002\u5728Lua\u4e2d\uff0c\u51fd\u6570\u662f\u4e00\u79cd\u7b2c\u4e00\u7c7b\u578b\u503c\uff08First-Class Value\uff09\uff0c\u5b83\u4eec\u5177\u6709\u7279\u5b9a\u7684\u8bcd\u6cd5\u57df\uff08Lexical Scoping\uff09\u3002<\/p>\n\n\n\n<p><strong>\u7b2c\u4e00\u7c7b\u578b\u503c\u8868\u793a\u51fd\u6570\u4e0e\u5176\u4ed6\u4f20\u7edf\u7c7b\u578b\u7684\u503c\uff08\u4f8b\u5982\u6570\u5b57\u548c\u5b57\u7b26\u4e32\u7c7b\u578b\uff09\u5177\u6709\u76f8\u540c\u7684\u6743\u5229<\/strong>\u3002<strong>\u5373\u51fd\u6570\u53ef\u4ee5\u5b58\u50a8\u5728\u53d8\u91cf\u6216table\u4e2d\uff0c\u53ef\u4ee5\u4f5c\u4e3a\u5b9e\u53c2\u4f20\u9012\u7ed9\u5176\u4ed6\u51fd\u6570\uff0c\u8fd8\u53ef\u4ee5\u4f5c\u4e3a\u5176\u4ed6\u51fd\u6570\u7684\u8fd4\u56de\u503c\uff0c\u53ef\u4ee5\u5728\u8fd0\u884c\u671f\u95f4\u88ab\u521b\u5efa\u3002<\/strong>\u5728Lua\u4e2d\uff0c\u51fd\u6570\u4e0e\u6240\u6709\u5176\u4ed6\u7684\u503c\u662f\u4e00\u6837\u90fd\u662f\u533f\u540d\u7684\uff0c\u5373\u4ed6\u4eec\u6ca1\u6709\u540d\u79f0\u3002\u5f53\u8ba8\u8bba\u4e00\u4e2a\u51fd\u6570\u65f6\uff08\u4f8b\u5982print\uff09\uff0c\u5b9e\u8d28\u4e0a\u5728\u8ba8\u8bba\u4e00\u4e2a\u6301\u6709\u67d0\u4e2a\u51fd\u6570\u7684\u53d8\u91cf<\/p>\n\n\n\n<figure class=\"wp-block-pullquote\"><blockquote><p><strong>\u5728\u8fd0\u884c\u65f6\uff0c\u6bcf\u5f53Lua\u6267\u884c\u4e00\u4e2a\u5f62\u5982function...end\u8fd9\u6837\u7684\u51fd\u6570\u65f6\uff0c\u5b83\u5c31\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5bf9\u8c61\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u76f8\u5e94\u51fd\u6570\u539f\u578b\u7684\u5f15\u7528\u3001\u73af\u5883(\u7528\u6765\u67e5\u627e\u5168\u5c40\u53d8\u91cf\u7684\u8868)\u7684\u5f15\u7528\u4ee5\u53ca\u4e00\u4e2a\u7531\u6240\u6709upvalue\u5f15\u7528\u7ec4\u6210\u7684\u6570\u7ec4\uff0c\u800c\u8fd9\u4e2a\u6570\u636e\u5bf9\u8c61\u5c31\u79f0\u4e3a\u95ed\u5305\u3002<\/strong><\/p><\/blockquote><\/figure>\n\n\n\n<p><strong>\u7531\u6b64\u53ef\u89c1\uff0c\u51fd\u6570\u662f\u7f16\u8bd1\u671f\u6982\u5ff5\uff0c\u662f\u9759\u6001\u7684\uff0c\u800c\u95ed\u5305\u662f\u8fd0\u884c\u671f\u6982\u5ff5\uff0c\u662f\u52a8\u6001\u7684\u3002<\/strong>g1\u548cg2\u7684\u503c\u4e25\u683c\u6765\u8bf4\u4e0d\u662f\u51fd\u6570\u800c\u662f\u95ed\u5305\uff0c\u5e76\u4e14\u662f\u4e24\u4e2a\u4e0d\u76f8\u540c\u7684\u95ed\u5305\uff0c\u800c\u8fd9\u4e24\u4e2a\u95ed\u5305\u6709\u5404\u81ea\u7684upvalue\u503c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function\u3000f1(n)\n\tlocal\u3000function\u3000f2()\n\t\tprint(n)\n\tend\n\tn\u3000=\u3000n\u3000+\u300010\n\treturn\u3000f2\nend\n\ng1\u3000=\u3000f1(1979)\ng1()\u3000--\u3000\u6253\u5370\u51fa1989<\/code><\/pre>\n\n\n\n<p>g1()\u6253\u5370\u51fa\u6765\u7684\u662f1989\uff0c\u539f\u56e0\u662f\u6253\u5370\u7684\u662fupvalue\u7684\u503c\u3002<\/p>\n\n\n\n<p><strong>upvalue\u5b9e\u9645\u662f\u5c40\u90e8\u53d8\u91cf\uff0c\u800c\u5c40\u90e8\u53d8\u91cf\u662f\u4fdd\u5b58\u5728\u51fd\u6570\u5806\u6808\u6846\u67b6\u4e0a\u7684\uff0c\u6240\u4ee5\u53ea\u8981upvalue\u8fd8\u6ca1\u6709\u79bb\u5f00\u81ea\u5df1\u7684\u4f5c\u7528\u57df\uff0c\u5b83\u5c31\u4e00\u76f4\u751f\u5b58\u5728\u51fd\u6570\u5806\u6808\u4e0a<\/strong>\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u95ed\u5305\u5c06\u901a\u8fc7\u6307\u5411\u5806\u6808\u4e0a\u7684upvalue\u7684\u5f15\u7528\u6765\u8bbf\u95ee\u5b83\u4eec\uff0c<strong>\u4e00\u65e6upvalue\u5373\u5c06\u79bb\u5f00\u81ea\u5df1\u7684\u4f5c\u7528\u57df\uff0c\u5728\u4ece\u5806\u6808\u4e0a\u6d88\u9664\u4e4b\u524d\uff0c\u95ed\u5305\u5c31\u4f1a\u4e3a\u5b83\u5206\u914d\u7a7a\u95f4\u5e76\u4fdd\u5b58\u5f53\u524d\u7684\u503c\uff0c\u4ee5\u540e\u4fbf\u53ef\u901a\u8fc7\u6307\u5411\u65b0\u5206\u914d\u7a7a\u95f4\u7684\u5f15\u7528\u6765\u8bbf\u95ee\u8be5upvalue<\/strong>\u3002<\/p>\n\n\n\n<p>\u5f53\u6267\u884c\u5230f1(1979)\u7684n=n+10\u65f6\uff0c\u95ed\u5305\u5df2\u7ecf\u521b\u5efa\u4e86\uff0c\u4f46\u662f\u53d8\u91cfn\u5e76\u6ca1\u6709\u79bb\u5f00\u4f5c\u7528\u57df\uff0c\u6240\u4ee5\u95ed\u5305\u4ecd\u7136\u5f15\u7528\u5806\u6808\u4e0a\u7684n\uff0c\u5f53return f2\u5b8c\u6210\u65f6\uff0cn\u5373\u5c06\u7ed3\u675f\u751f\u547d\uff0c\u6b64\u65f6\u95ed\u5305\u4fbf\u5c06\u53d8\u91cfn(\u5df2\u7ecf\u662f1989\u4e86)\u590d\u5236\u5230\u81ea\u5df1\u7ba1\u7406\u7684\u7a7a\u95f4\u4e2d\u4ee5\u4fbf\u5c06\u6765\u8bbf\u95ee\u3002&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">upvalue\u548c\u95ed\u5305\u6570\u636e\u5171\u4eab<\/h2>\n\n\n\n<p><strong>upvalue\u8fd8\u53ef\u4ee5\u4e3a\u95ed\u5305\u4e4b\u95f4\u63d0\u4f9b\u4e00\u79cd\u6570\u636e\u5171\u4eab\u7684\u673a\u5236\u3002<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5355\u91cd\u5185\u5d4c\u51fd\u6570\u7684\u95ed\u5305 \uff08\u51fd\u6570\u521b\u5efa\u7684\u95ed\u5305\uff09<\/h3>\n\n\n\n<p>\u4e00\u4e2a\u51fd\u6570\u521b\u5efa\u7684\u95ed\u5305\u5171\u4eab\u4e00\u4efdupvalue\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>local function g1(n)\n    local function g2()\n        print(n)\n    end\n\n    local function g3()\n        n = n + 10\n    end\n    return g2,g3\nend\n\nx1,x2 = g1(123)\nx1() \/\/123\nx2()\nx1() \/\/133\nx2()\nx1() \/\/143<\/code><\/pre>\n\n\n\n<p>f1,f2\u8fd9\u4e24\u4e2a\u95ed\u5305\u7684\u539f\u578b\u5206\u522b\u662fCreate\u4e2d\u7684\u5185\u5d4c\u51fd\u6570foo1\u548cfoo2\uff0c\u800cfoo1\u548cfoo2\u5f15\u7528\u7684upvalue\u662f\u540c\u4e00\u4e2a\uff0c\u5373Create\u7684\u5c40\u90e8\u53d8\u91cfn\u3002\u6267\u884c\u5b8cCreate\u8c03\u7528\u540e\uff0c\u95ed\u5305\u4f1a\u628a\u5806\u6808\u4e0an\u7684\u503c\u590d\u5236\u51fa\u6765\uff0c\u90a3\u4e48\u662f\u5426f1\u548cf2\u5c31\u5206\u522b\u62e5\u6709\u4e00\u4e2an\u7684\u62f7\u8d1d\u5462\uff1f<strong>\u5176\u5b9e\u4e0d\u7136\uff0c\u5f53Lua\u53d1\u73b0\u4e24\u4e2a\u95ed\u5305\u7684upvalue\u6307\u5411\u7684\u662f\u5f53\u524d\u5806\u6808\u4e0a\u7684\u76f8\u540c\u53d8\u91cf\u65f6\uff0c\u4f1a\u806a\u660e\u5730\u53ea\u751f\u6210\u4e00\u4e2a\u62f7\u8d1d\uff0c\u7136\u540e\u8ba9\u8fd9\u4e24\u4e2a\u95ed\u5305\u5171\u4eab\u8be5\u62f7\u8d1d<\/strong><\/p>\n\n\n\n<p>\u8fd9\u6837\u4efb\u4e00\u4e2a\u95ed\u5305\u5bf9\u8be5upvalue\u8fdb\u884c\u4fee\u6539\u90fd\u4f1a\u88ab\u53e6\u4e00\u4e2a\u63a2\u77e5\u3002\u4e0a\u8ff0\u4f8b\u5b50\u5f88\u6e05\u695a\u5730\u8bf4\u660e\u4e86\u8fd9\u70b9\uff1a\u6bcf\u6b21\u8c03\u7528f2\u90fd\u5c06upvalue\u7684\u503c\u589e\u52a0\u4e8610\uff0c\u968f\u540ef1\u5c06\u66f4\u65b0\u540e\u7684\u503c\u6253\u5370\u51fa\u6765\u3002<strong>upvalue\u7684\u8fd9\u79cd\u8bed\u4e49\u5f88\u6709\u4ef7\u503c\uff0c\u5b83\u4f7f\u5f97\u95ed\u5305\u4e4b\u95f4\u53ef\u4ee5\u4e0d\u4f9d\u8d56\u5168\u5c40\u53d8\u91cf\u8fdb\u884c\u901a\u8baf\uff0c\u4ece\u800c\u4f7f\u4ee3\u7801\u7684\u53ef\u9760\u6027\u5927\u5927\u63d0\u9ad8\u3002<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u591a\u91cd\u5185\u5d4c\u51fd\u6570\u7684\u95ed\u5305\uff08\u95ed\u5305\u521b\u5efa\u7684\u95ed\u5305\uff09<\/h3>\n\n\n\n<p><strong>\u540c\u4e00\u95ed\u5305\u521b\u5efa\u7684\u5176\u4ed6\u7684\u95ed\u5305\u5171\u4eab\u4e00\u4efdupvalue\u3002<\/strong><\/p>\n\n\n\n<p>\u5185\u5c42\u95ed\u5305\u5728\u521b\u5efa\u4e4b\u65f6\u5176\u9700\u8981\u7684\u53d8\u91cf\u5c31\u5df2\u7ecf\u4e0d\u5728\u5806\u6808\u4e0a\uff0c\u800c\u662f\u5f15\u7528\u66f4\u5916\u5c42\u5916\u5305\u51fd\u6570\u7684\u5c40\u90e8\u53d8\u91cf\uff08\u5b9e\u9645\u4e0a\u662fupvalue\uff09\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>local function C(n)\n    local function c1()\n        local function cc1()\n            print(n)\n        end\n\n        local function cc2()\n            n = n + 10\n        end\n\n        return cc1,cc2\n    end\n    return c1\nend\n\nt = C(1883)\n\ntt1,tt2 = t()\ntt1() --1883\ntt2()\ntt1() --1893\n\nkk1,kk2 = t()\nkk1() --1893\nkk2()\nkk1() --1903\ntt2()\ntt1() --1903<\/code><\/pre>\n\n\n\n<p><strong>tt1\u548ctt2\u4e0ekk1\u548ckk2\u5171\u4eab\u540c\u4e00\u4e2aupvalue\u3002\u56e0\u4e3att1\u548ctt2\u4e0ekk1\u548ckk2\u90fd\u662f\u540c\u4e00\u4e2a\u95ed\u5305t\u521b\u5efa\u7684<\/strong>\uff0c<strong>\u6240\u4ee5\u5b83\u4eec\u5f15\u7528\u7684upvalue &nbsp;(\u53d8\u91cfn)\u5b9e\u9645\u4e5f\u662f\u540c\u4e00\u4e2a\u53d8\u91cf\uff0c\u800c\u5b83\u4eec\u7684upvalue\u5f15\u7528\u90fd\u4f1a\u6307\u5411\u540c\u4e00\u4e2a\u5730\u65b9\u3002<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u95ed\u5305\u7684\u5e94\u7528<\/h2>\n\n\n\n<p>\u5728\u8bb8\u591a\u573a\u5408\u4e2d\u95ed\u5305\u90fd\u662f\u4e00\u79cd\u5f88\u6709\u4ef7\u503c\u7684\u5de5\u5177\uff0c\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4f5c\u4e3a\u9ad8\u9636\u51fd\u6570\u7684\u53c2\u6570<\/strong>\uff0c\u6bd4\u5982\u50cftable.sort\u51fd\u6570\u7684\u53c2\u6570\u3002<\/li>\n\n\n\n<li><strong>\u521b\u5efa\u5176\u4ed6\u7684\u51fd\u6570\u7684\u51fd\u6570\uff0c\u5373\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u95ed\u5305<\/strong>\u3002<\/li>\n\n\n\n<li><strong>\u95ed\u5305\u5bf9\u4e8e\u56de\u8c03\u51fd\u6570\u4e5f\u975e\u5e38\u6709\u7528\u3002<\/strong>\u5178\u578b\u7684\u4f8b\u5b50\u5c31\u662f\u754c\u9762\u4e0a\u6309\u94ae\u7684\u56de\u8c03\u51fd\u6570\uff0c\u8fd9\u4e9b\u51fd\u6570\u4ee3\u7801\u903b\u8f91\u53ef\u80fd\u662f\u4e00\u6a21\u4e00\u6837\uff0c\u53ea\u662f\u56de\u8c03\u51fd\u6570\u53c2\u6570\u4e0d\u4e00\u6837\u800c\u5df2\uff0c\u5373upvalue\u7684\u503c\u4e0d\u4e00\u6837\u800c\u5df2\u3002<\/li>\n\n\n\n<li><strong>\u521b\u5efa\u4e00\u4e2a\u5b89\u5168\u7684\u8fd0\u884c\u73af\u5883<\/strong>\uff0c\u5373\u6240\u8c13\u7684\u6c99\u76d2\uff08sandbox\uff09\u3002\u5f53\u6267\u884c\u4e00\u4e9b\u672a\u53d7\u4fe1\u4efb\u7684\u4ee3\u7801\u65f6\u5c31\u9700\u8981\u4e00\u4e2a\u5b89\u5168\u7684\u8fd0\u884c\u73af\u5883\u3002\u6bd4\u5982\u8981\u9650\u5236\u4e00\u4e2a\u7a0b\u5e8f\u8bbf\u95ee\u6587\u4ef6\u7684\u8bdd\uff0c\u53ea\u9700\u8981\u4f7f\u7528\u95ed\u5305\u6765\u91cd\u5b9a\u4e49\u51fd\u6570io.open\u5c31\u53ef\u4ee5\u4e86<\/li>\n\n\n\n<li><strong>\u5b9e\u73b0\u8fed\u4ee3\u5668<\/strong>\u3002\u6240\u8c13\u8fed\u4ee3\u5668\u5c31\u662f\u4e00\u79cd\u53ef\u4ee5\u904d\u5386\u4e00\u79cd\u96c6\u5408\u4e2d\u6240\u8c13\u5143\u7d20\u7684\u673a\u5236\u3002\u6bcf\u4e2a\u8fed\u4ee3\u5668\u90fd\u9700\u8981\u5728\u6bcf\u6b21\u6210\u529f\u8c03\u7528\u4e4b\u95f4\u4fdd\u6301\u4e00\u4e9b\u72b6\u6001\uff0c\u8fd9\u6837\u624d\u80fd\u77e5\u9053\u5b83\u6240\u5728\u7684\u4f4d\u7f6e\u53ca\u5982\u4f55\u8fdb\u5230\u4e0b\u4e00\u4e2a\u4f4d\u7f6e\u3002\u95ed\u5305\u521a\u597d\u9002\u5408\u8fd9\u79cd\u573a\u666f\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>upvalue \u5982\u679c\u51fd\u6570f2\u5b9a\u4e49\u5728\u51fd\u6570f1\u4e2d\uff0c\u90a3\u4e48f2\u4e3af1\u7684\u5185\u5d4c\u51fd\u6570\uff0cf1\u4e3af2\u7684\u5916\u5305\u51fd\u6570\uff0c\u5916\u5305\u548c\u5185\u5d4c\u90fd\u5177\u6709\u4f20\u9012\u6027\uff0c\u5373f2\u7684\u5185\u5d4c &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[24],"tags":[],"class_list":["post-2108","post","type-post","status-publish","format-standard","hentry","category-lua"],"_links":{"self":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/posts\/2108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/comments?post=2108"}],"version-history":[{"count":0,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/posts\/2108\/revisions"}],"wp:attachment":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/media?parent=2108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/categories?post=2108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/tags?post=2108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}