Of course the real problem is these languages do not have symbols as a data type.
In Smalltalk...
#north
#south
#east
#west
In Lisp...
'north
'south
'east
'west
You don't even need a separate class to be instantiated. Just use Strings.
public final static Direction NORTH = "NORTH".intern();
public final static Direction SOUTH = "SOUTH".intern();
public final static Direction EAST = "EAST".intern();
public final static Direction WEST = "WEST".intern();
Of course the real problem is these languages do not have symbols as a data type. In Smalltalk... #north #south #east #west In Lisp... 'north 'south 'east 'west
You don't even need a separate class to be instantiated. Just use Strings.
public final static Direction NORTH = "NORTH".intern();
public final static Direction SOUTH = "SOUTH".intern();
public final static Direction EAST = "EAST".intern();
public final static Direction WEST = "WEST".intern();