mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 08:46:53 +08:00
10 lines
132 B
ChaiScript
10 lines
132 B
ChaiScript
def Bob::`+`(y) { this.x + y.x }
|
|
def Bob::Bob() { }
|
|
attr Bob::x
|
|
auto b = Bob()
|
|
auto c = Bob()
|
|
b.x = 4
|
|
c.x = 5
|
|
|
|
assert_equal(9, b+c)
|