xxxxxxxxxx
nothrow string foo(int x, string def) {
import std.format: format;
import std.exception: ifThrown;
return format("%d", x).ifThrown(def);
}
void main() {
import std.stdio: writeln;
writeln(foo(42, "error"));