#!/usr/bin/env mio

TGreetable = Object clone() do (
    name = "World"

    hello = method(
        print("Hello", self name)
    )
)

World = Object clone() do (
    uses(TGreetable)

    name = "World!"
)

adapt = block(obj, trait,
    return (obj clone() uses(trait))
)

Foo = Object clone() do (
    name = "Foo!"
)

world = World clone()
world hello()

foo = adapt(Foo, TGreetable)
foo hello()
