first impl of builtin member methods (thus far, string.size implemented. more to...
[aqualang.git] / examples / class.jtc
blob215410f466cbc6590577fdc316d4bd6866feadb9
2 local Person = func()
4     // code in the mainbody is the 'constructor', so to say
5     print("Person.Person() called!\n")
6     this = {name = "foo"}
7     this.setName = func(newname)
8     {
9         this.name = newname
10     }
11     this.printName = func()
12     {
13         print("this.name = ", this.name, "\n")
14     }
15     return this
18 p = Person()
19 p.setName("john doe")
20 p.printName()