Paste: clay interfaces

Author: kssreeram
Mode: factor
Date: Tue, 11 May 2010 07:12:01
Plain Text |
display(x) {
    println(x);
}

interface Displayable;
method display(x:Displayable) Void;

main() {
    var v = Vector[Displayable]();
    pushBack(v, Displayable(1));
    pushBack(v, Displayable(3.2));
    pushBack(v, Displayable("Hi!"));
    for (x in v)
        display(x);
}

New Annotation

Summary:
Author:
Mode:
Body: