Methods & Self Calls
TuffSeal supports method-style calls using !.
fn setB(self)
{
setattr(self, "b", 10);
}
let obj = {
a: 1,
b: 5
setA: ins (self) {
setattr(self, "a", 5);
},
setB: setB
};
print(obj.a); // 1
print(obj.b); // 5
obj.setA()!;
obj.setB()!;
print(obj.a); // 5
print(obj.b); // 10
The ! operator explictly passes self.