Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

luaに関するnobu-qのブックマーク (3)

  • Home

    nobu-q
    nobu-q 2010/05/11
    gem的なもの?
  • 2008-05-12

    今回は、割と言語のコアな部分だけれど(VMじゃなくて)ライブラリ実装になってる部分を拾っておきます。 Luaには「coroutine(コルーチン)」という機能があって、Lua 5.0のVMのデザインもこれを楽に実装するために採用された面もあるらしいので、VMを学ぶにあたって重要なポイントです。こんな機能。 function countUp() local n = 0 while true do coroutine.yield(n) -- 対応するcoroutine.resumeにnを返す n = n+1 end end co = coroutine.create(countUp) repeat f,a = coroutine.resume(co) -- countUp実行開始、あるいはyieldから実行再開 print(a) until a>=10 他の言語でもよくある「スレッド」に似てい

    2008-05-12
    nobu-q
    nobu-q 2009/11/10
  • LPeg - Parsing Expression Grammars For Lua

    Introduction LPeg is a pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs). This text is a reference manual for the library. For those starting with LPeg, Mastering LPeg presents a good tutorial. For a more formal treatment of LPeg, as well as some discussion about its implementation, see A Text Pattern-Matching Tool based on Parsing Expression Grammars. You may also be i

    nobu-q
    nobu-q 2009/11/09
  • 1