# Abstract interface: interface InterA { routine size()=>int routine serialize()=>string static routine statmeth()=>int } # Concrete interface for int: interface InterA for int { routine size(){ io.writeln( "InterA::size()", self ) self += 789; io.writeln( "InterA::size()", std.about(self) ) io.writeln( "InterA::size()", self.serialize() ); return self + 1; } routine serialize() => string { return "abc" + (string) (int) self; } static routine statmeth()=>int { return 456 } } var a: InterA = 123 # a: value type InterA; variable type InterA; var b = (InterA) 123; # b: value type InterA; variable type InterA; var c: InterA = 123 # c: value type InterA; variable type InterA; io.writeln( a.size() ) io.writeln( "value", (int) a, a.statmeth() ) var d: int = c # int is automatically converted to InterA, where InterA or InterA # is expected: var e: list> = { 123 } e.append(456) var f: list = { 678 } f.append(456) io.writeln( e, f ) interface InterB : InterA { routine []( index: int ) => int } interface InterB for int : InterA { routine []( index: int ) => int { return (self & (1<> index; } } var k = (InterB) 0x7ffeff; f.append( k ) io.writeln( f, k[1] ) var h = (InterA) k; io.writeln( std.about(h), h ) var m: InterA = k; io.writeln( std.about(m), m ) var s = (InterA) k; io.writeln( std.about(s), s )