清单 1. 体验 Lua 表
$ lua > -- create an empty table and add some elements > t1 = {} > t1. = "moustache" > t1. = 3 > t1["brothers"] = true
> -- more commonly, create the table and define elements > all at once > t2 = {. = "groucho", . = "chico", . = "harpo"} > t3 = {[t1.] = t2., accent = t2., horn = t2.} > t4 = {} > t4[t3] = "the marx brothers" > t5 = {characters = t2, marks = t3} > t6 = {["a night at the opera"] = "classic"}
> -- make a reference and a st页码:[1] [2] [3] [4] [5] [6] [7] 第1页、共7页 |