4 /* this would be a good place to place root information */
6 /* attributes are essentially tables with a fancy syntax, so
7 everything that is valid for tables is valid for attribs.
8 of course JSON syntax is supported as well, so you could write:
10 "Some Long Name": "Some Value"
12 as usual with Vox, semicolons are not needed as long as
13 the statement ends with an EOL.
16 Description = "Does absolutely nothing"
17 Author = "beelzebub himself"
18 Readme = "http://localhost/vox/interactive.vml#p:syntax.attributes,w:Start"
19 Categories = ["tests", "tests/syntax", "examples"]
23 </ Description = "Gives oldValue a newValue (hardy har)" />
24 function setSomeValue(newValue);
28 /* attributes can be iterated through by first
29 iterating through the members of a class
30 (as explained in classattr.vx, classes are 'special' tables),
31 and then, calling <classname>.getattributes(<membername>), which
32 will yield null if there are no attributes, or a table containing
34 foreach(member, val in Foo)
36 println("Member: %s (%s)".format(member.tostring(), val.tostring()))
37 Foo.getattributes(member).each(function(k, v)
38 println(" %s = %s".format(k.tostring(), v.tostring())))