Skip to content

Instantly share code, notes, and snippets.

Created November 6, 2012 19:49
Show Gist options
  • Save anonymous/4027039 to your computer and use it in GitHub Desktop.
Save anonymous/4027039 to your computer and use it in GitHub Desktop.
Minimal Lua Livecoding Environment
local lfs = require("lfs")
local old = 0
local file_path = "livecoding.lua"
local t = 0
while true do
t = t + 1
if old < lfs.attributes( file_path ).modification then
old = lfs.attributes( file_path ).modification
pcall(dofile, file_path)
end
-- run is the callback function in the livecoding file
pcall(run, t)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment