template padd*[T](x: ptr T, num: int): ptr T = cast[ptr T](cast[int](x) + num) template psub*[T](x: ptr T, num: int): ptr T = cast[ptr T](cast[int](x) - num) template pdiff*[T](x: ptr T, y: ptr): int = cast[int](x) - cast[int](y)