Video
12 min read
Operator precedence without eval, in 20 lines of Ruby
A Ruby interview question: evaluate 2+3*4 as 14 without eval. Precedence as an array of operator levels, leftmost-first reduction, and where it breaks.
Read more