lua-users home
lua-l archive

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


I appreciate this idea to standartize interfaces for common tasks.

Just wrote dummy JSON codec although useless, may illustrates idea:

--[[
  Absolutely correct implementation for decoding and encoding
  JSON with contents "{}".

  Conforms community JSON codec standard.
]]
return
  {
    decode =
      function(s)
        return {}
      end,
    encode =
      function(t)
        return '{}'
      end,
    null = {}, -- used as GUID for JSON "null"
  }

-- Martin