loading...

Discussion on: Daily Challenge #10 - Calculator

Collapse
yzhernand profile image
Yozen Hernandez

Similarly unfair, the solution in R:

calc <- function (expr) {
    eval(parse(text=expr))
}
> calc("2 / 2 + 3 * 4 - 6")
[1] 7

Warning: don't do this.