10 lines
169 B
ChaiScript
10 lines
169 B
ChaiScript
def Bob::Bob() { }
|
|
attr Bob::x
|
|
def `-`(a, b) : is_type(a, "Bob") && is_type(b, "Bob") { a.x - b.x }
|
|
auto b = Bob()
|
|
auto c = Bob()
|
|
b.x = 4
|
|
c.x = 5
|
|
|
|
assert_equal(-1, b-c)
|