1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
foreign class Vector { construct invalid() {} foreign x=(x) foreign y=(y) foreign static read(vecs) toString { "<%(this.x) %(this.y)>" } foreign x foreign y foreign copy() } class Math { foreign static new_vector(x, y) }