{"id":1022,"date":"2013-10-27T21:59:39","date_gmt":"2013-10-27T12:59:39","guid":{"rendered":"http:\/\/mirror.boy.jp\/?p=1022"},"modified":"2013-10-27T22:05:22","modified_gmt":"2013-10-27T13:05:22","slug":"jit-gl-lua-%e3%81%a7%e8%a4%87%e6%95%b0%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e5%88%86%e5%89%b2%ef%bc%9acycling74-max-lua-jitter","status":"publish","type":"post","link":"https:\/\/mirror.boy.jp\/?p=1022","title":{"rendered":"jit.gl.lua \u3067\u8907\u6570\u30d5\u30a1\u30a4\u30eb\u5206\u5272\uff1aCycling74 Max, Lua, Jitter"},"content":{"rendered":"<p>jit.gl.lua \u3067\u8907\u6570\u30d5\u30a1\u30a4\u30eb\u5206\u5272\u3057\u305f\u3044\uff01\u3068\u3044\u3046\u5206\u3051\u3067\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002Dog.lua \u306f\u3001<a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.hakkaku.net\/articles\/20081118-286');\"  href=\"http:\/\/www.hakkaku.net\/articles\/20081118-286\">\u3053\u3061\u3089\u306e\u30b5\u30a4\u30c8\u306e\u30bd\u30fc\u30b9<\/a>\u3092\u6d41\u7528\u3055\u305b\u3066\u9802\u304d\u307e\u3057\u305f\u3002<\/p>\n<h3><\/h3>\n<h3>Main.lua<\/h3>\n<p>[javascript]<\/p>\n<p>&#8211;\u3053\u306e\u95a2\u6570\u306b\u3088\u3063\u3066Main.lua\u306epath\u306b\u7f6e\u3044\u3066\u3042\u308b .lua\u30d5\u30a1\u30a4\u30eb\u3082require\u3067\u8aad\u307f\u8fbc\u3081\u308b\u3088\u3046\u306b\u306a\u308b<\/p>\n<p>function addmodulepath(path)<br \/>\n &#8212; add to package paths (if not already present)<br \/>\n if not string.find(package.path, path, 0, true) then<br \/>\n package.path = string.format(&quot;%s\/?.lua;%s&quot;, path, package.path)<br \/>\n package.path = string.format(&quot;%s\/?\/init.lua;%s&quot;, path, package.path)<br \/>\n package.cpath = string.format(&quot;%s\/?.so;%s&quot;, path, package.cpath)<br \/>\n end<br \/>\nend<\/p>\n<p>&#8212; Main.lua \u306e\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3092\u767b\u9332<br \/>\naddmodulepath(this.path)<br \/>\n&#8212; Dog Class \u306e\u30ed\u30fc\u30c9<br \/>\nrequire(&quot;Dog&quot;)<\/p>\n<p>&#8211;\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316<br \/>\njiro = Dog.new(&quot;jiro&quot;, 3)<br \/>\nsabu = Dog.new(&quot;sabu&quot;, 2)<\/p>\n<p>jiro:showProfile()<br \/>\nsabu:showProfile()<\/p>\n<p>[\/javascript]<\/p>\n<h3>Dog.lua<\/h3>\n<p>[javascript]<\/p>\n<p>&#8212; Dog \u30af\u30e9\u30b9\u3092\u5b9a\u7fa9<\/p>\n<p>Dog = {}<\/p>\n<p>Dog.new = function(name, age)<\/p>\n<p>local obj = {}<\/p>\n<p>obj.name = name<\/p>\n<p>obj.age = age<\/p>\n<p>obj.showProfile = function(self) s = string.format(&quot;[name=%s,age=%d]&quot;, self.name, self.age) print(s) end<\/p>\n<p>return obj end<\/p>\n<p>[\/javascript]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jit.gl.lua \u3067\u8907\u6570\u30d5\u30a1\u30a4\u30eb\u5206\u5272\u3057\u305f\u3044\uff01\u3068\u3044\u3046\u5206\u3051\u3067\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002Dog.lua \u306f\u3001\u3053\u3061\u3089\u306e\u30b5\u30a4\u30c8\u306e\u30bd\u30fc\u30b9\u3092\u6d41\u7528\u3055\u305b\u3066\u9802\u304d\u307e\u3057\u305f\u3002 Main.lua [javascript] &#8211;\u3053\u306e\u95a2\u6570\u306b\u3088\u3063\u3066M &hellip; <a href=\"https:\/\/mirror.boy.jp\/?p=1022\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">jit.gl.lua \u3067\u8907\u6570\u30d5\u30a1\u30a4\u30eb\u5206\u5272\uff1aCycling74 Max, Lua, Jitter<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,47,45,46,26],"tags":[],"_links":{"self":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts\/1022"}],"collection":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1022"}],"version-history":[{"count":3,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts\/1022\/revisions"}],"predecessor-version":[{"id":1025,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts\/1022\/revisions\/1025"}],"wp:attachment":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}