Parameterized Types
Needed e.g. for container classes:
class Stack<T>:decl st: Tdef __init__(self): self.st = []def push(self, x: T): self.st.append(x)def pop(self) -> T: x = self.st[-1]; del self.st[-1]; return x
decl IntStack = Stack<int> # template instantiation
decl s: IntStack
s = IntStack() # or s = Stack() ???
s.push(1)
decl x: int
x = s.pop()
s.push("spam") # ERROR