Note: the type of a member function must not depend on a name or type defined in the object (this constraint is because the desugaring precedes name binding).
Note: object constructors are not members, because their types would be local to the constructor (see above).
Note: The name of the type of an object with constructor 'x' is '_ot_x': the constructor name prefixed by '_ot_' (Ugly).
Note: you can change the methods of an object by assigning a new functional value to the structure component.
Note: the type of the object is not part of a method signature: their type is as written.
Note: only explicitly declared non-private functions (and procedures) are taken as methods. Implicit functions such as blocks are not taken.
1: #line 841 "./lpsrc/flx_tutorial.pak" 2: #import <flx.flxh> 3: obj a(x:int) { 4: var v = x; 5: fun fetch ():int = { return v; } 6: proc store (y:int) { v = y; } 7: } 8: 9: val z = a(1); 10: print (z.fetch()); endl; 11: z.store(2); 12: print (z.fetch()); endl; 13: