Logo

Programming-Idioms

New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
T e = T.Horse;
string s = e.ToString();
Console.WriteLine(s);
toString(Atom) when Atom == bike orelse Atom == car orelse Atom == horse ->
        erlang:atom_to_list(Atom).

%% E = horse, S = toString(E).
var e = T.HORSE;
var s = e.name();
System.out.println(s);
val e = t.values().random() // or t.bike, but that's boring
val s = e.name
println(s)
  e := horse;
  writestr(s, e);
  writeln(e);
e = T.horse
s = e.name
print(s)
let e = t::bike;
let s = format!("{:?}", e);

println!("{}", s);