repo.or.cz
/
aqualang.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
first impl of builtin member methods (thus far, string.size implemented. more to...
[aqualang.git]
/
examples
/
class.jtc
blob
215410f466cbc6590577fdc316d4bd6866feadb9
1
2
local Person = func()
3
{
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
16
}
17
18
p = Person()
19
p.setName("john doe")
20
p.printName()
21