View Problem
OOP

Define a class

Declare a class named Greeter that takes a string on creation and greets using this string if you call the "greet" method.
DiskEdit
fantom
class Greeter
{
private Str whom
new make(Str whom) { this.whom = whom }
Void greet() { echo("Hello, $whom") }
}

Greeter("world").greet

Submit a new solution for fantom
There are 21 other solutions in additional languages (clojure, cpp, csharp, erlang ...)