The.Failboat.me
Everything about Nothing
Skip to content
  • Home
  • About
    • Lifestream

Tag Archives: at.exit

Tips and Tricks for Lua Beginners: Writing an at.exit registry

Posted on July 16, 2010 by Lee

It’s relatively simple to write a function that takes in a function and executes it once Lua terminates.

at = {}
function at.exit(fn)
     getmetatable(newproxy(true)).__gc = fn
end
Posted in Blog, Lua, Programming, Snippets | Tagged at.exit, exit, Lua, metamethod, process, tips and tricks, __gc | 725Leave a commenthttp%3A%2F%2Ffailboat.me%2F2010%2Ftips-and-tricks-for-lua-beginners-writing-an-at-exit-registry%2FTips+and+Tricks+for+Lua+Beginners%3A+Writing+an+at.exit+registry2010-07-16+18%3A24%3A36Leehttp%3A%2F%2Ffailboat.me%2F%3Fp%3D725
  • Categories

    • Blog (104)
      • Lua (13)
      • Miscellaneous (48)
      • Photos (6)
      • Programming (33)
      • Python (15)
      • Sample (3)
      • Web Design (3)
      • Writing (2)
    • Portfolio (40)
    • Snippets (28)
  • Recent Comments

    • Kieth Mckelvey on [Theme] SubIP.Board Cloudy
    • PramUpdaphrer on [Theme] SubIP.Board 3.0
    • Venisqueeds on [Theme] SubIP.Board Cloudy
    • Lee on Javascript Syntax Highlighted Editor in 1Kb
    • Lee on Javascript Syntax Highlighted Editor in 1Kb
  • Archives

    • August 2010 (3)
    • July 2010 (15)
    • April 2010 (2)
    • February 2010 (7)
    • December 2009 (3)
    • November 2009 (2)
    • October 2009 (5)
    • September 2009 (1)
    • August 2009 (8)
    • July 2009 (5)
    • June 2009 (8)
    • May 2009 (3)
    • April 2009 (1)
    • August 2008 (1)
    • March 2008 (1)
    • February 2008 (1)
    • January 2008 (2)
    • December 2007 (3)
    • November 2007 (7)
    • October 2007 (16)
    • September 2007 (13)
    • August 2007 (1)
    • July 2007 (5)
    • June 2007 (1)
    • April 2007 (1)
    • January 2007 (1)
    • December 2006 (1)
The.Failboat.me
Proudly powered by WordPress.