webmcp

changeset 284:851452af0c36

Fixed documentation for JSON library: __len and __index metamethods are used instead of __ipairs
author jbe
date Sun Mar 22 01:45:51 2015 +0100 (2015-03-22)
parents 81711c529eb2
children aacddd07e471
files libraries/json/json.autodoc.lua
line diff
     1.1 --- a/libraries/json/json.autodoc.lua	Sun Mar 22 00:58:14 2015 +0100
     1.2 +++ b/libraries/json/json.autodoc.lua	Sun Mar 22 01:45:51 2015 +0100
     1.3 @@ -35,7 +35,7 @@
     1.4    ...
     1.5  }
     1.6  
     1.7 -Converts a Lua table (or any other value with an __ipairs metamethod) to a JSON array. The argument is never modified. May also be called without arguments to create an empty JSON array. All JSON arrays support iteration using ipairs(...). When accessing or iterating over JSON arrays, null values will read as nil. To set a value to null, it needs to be set to the special value of json.null though. Setting a value to nil will delete the entry. The length operator (#) returns meaningful results if and only if the set of positive integer keys which have a value assigned (including the special value of null) is equal to the set of all numbers from 1 to some integer n (i.e. the array contains no gaps, but intermediate null values are allowed).
     1.8 +Converts a Lua table (or any other value with __len and __index metamethods) to a JSON array. The argument is never modified. May also be called without arguments to create an empty JSON array. All JSON arrays support iteration using ipairs(...). When accessing or iterating over JSON arrays, null values will read as nil. To set a value to null, it needs to be set to the special value of json.null though. Setting a value to nil will delete the entry. The length operator (#) returns meaningful results if and only if the set of positive integer keys which have a value assigned (including the special value of null) is equal to the set of all numbers from 1 to some integer n (i.e. the array contains no gaps, but intermediate null values are allowed).
     1.9  
    1.10  --]]--
    1.11  -- implemented in json.c as

Impressum / About Us