スクリプト言語 Lua は,基本的には命令型プログラミング言語であって,オブジェクト指向型言語としての機能は,本来持ち合わせていない。ただ,関数を first-class オブジェクトとして扱えることや, metatable 等の機能を使うことによって,「OOP のようなもの」は実現できるようになっている。 このような「OOP のようなもの」を意識した syntax sugar のひとつとして,「コロン構文」が用意されている。例えば,次のような記述によって「メソッドのようなもの」を定義することができる。 function counter:add(delta) self.count = self.count + delta end これは,以下の記述と同等に扱われる。 counter.add = function(self, delta) self.count = self.count +
Introduction Lunatic Python is a two-way bridge between Python and Lua, allowing these languages to intercommunicate. Being two-way means that it allows Lua inside Python, Python inside Lua, Lua inside Python inside Lua, Python inside Lua inside Python, and so on. Why? Even though the project was born as an experiment, it's already being used in real world projects to integrate features from both
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く