lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Very interesting! 

On Wed, May 18, 2011 at 9:15 AM, Jonathan Castello <> wrote:
I noticed that numbers in Lua can have a trailing decimal point, even
if there's no fractional part (such as "1."). This gave me an idea for
a horrible little DSL that emulates a to-do list:

 local list = {}
 local mt = debug.setmetatable(0, {
   __call = function (self, content)
     list[self] = content

 ; (1.) "Hello, world!"
 ; (2.) "Get groceries"

 for k, v in ipairs(list) do
   print(k .. ": " .. v)

It's pretty horrific, but interesting nonetheless.


Nothing is impossible.