previous up next
Go backward to Bounded Quantification 'n Subtyping
Go up to Top
Go forward to Bounded Existential Quantification and Partial Abstraction
RISC-Linz logo

Object Oriented Programming

type Point = {x: Int, y: Int}

value moveX0 =
   fun(p: Point, dx: Int) p.x := p.x + dx; p
value moveX =
   all[P <= Point] fun(p:P, dx: Int) p.x := p.x + dx; p

type Tile = {x: Int, y: Int, hor: Int, ver: Int}
moveX[Tile]({x = 0, y = 0, hor - 1, ver = 1}, 1).hor


Author: Wolfgang Schreiner
Last Modification: May 27, 1998

previous up next