Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
auto r = regex(r"([-]*\d*)\s*(\d+)/(\d+)");
string[] matches = [];
foreach(c; f.matchFirst(r)) mss ~= c;
double a1 = matches[1].empty ? 0 : matches[1].to!double;
double a = a1+(matches[2].to!double/matches[3].to!double)*(a1<0 ? -1 : 1);
let x = f.indexOf(' '),
y = f.indexOf('/'),
a = 0
if (y == -1) a = parseInt(f)
else {
let n = parseFloat(f.substr(x + 1, y)),
d = parseFloat(f.substr(y + 1))
a = n / d
if (x != -1) a += parseInt(f.substr(0, x))
}
a = sum(map(eval, f.split()))
a = f.split.map(&:to_r).sum.to_f
let a:f64 = f.split(" ").map(|n|
if n.contains("/") {
let m = n.split("/").collect::<Vec<&str>>();
m[0].parse::<f64>().unwrap()/m[1].parse::<f64>().unwrap() * if f.starts_with("-") {
-1 as f64
} else {
1 as f64
}
} else {
n.parse::<f64>().unwrap()
}
).sum();