lua-users home
lua-l archive

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


It was thus said that the Great 孙世龙 sunshilong once stated:
> >From Sean Conner:
> 
> >Or try CBOR [1].  My implementation [2][3] can handle keys other than
> >strings or integers, and can even handle cycles in tables.  Encoding this
> >table:
> >
> >        local x
> >        x =
> >        {
> >          [1] = true,
> >          [false] = "nah",
> >          [true] = "one",
> >          [42] = "meaning of life",
> >          [math.pi] = 3.000000,
> >          [math.huge] = 'too large',
> >          [math.maxinteger] = 'this is fine',
> >          ['NaN'] = 0/0,
> >          [0] = false,
> >        }
> >
> >is no issue.  [5]
> What about such tables:
> Tab = {}
> Tab.self = Tab;

  Yes, it can handle that.  It can even handle:

	Tab = {}
	Tab[Tab] = Tab

  -spc