> Ahh, so Ruby doesn't - and can't[1] - support constant folding.
it is because most "OOP" languages are not really "object" languages. Ruby is a "proper" everthing is an object language, which is why everyone loves it so much even if they do not think about it.
because it a) reverses the order of dividend and divisor for no good reason; b) the result goes up instead of to the right or down. Why not write it like this
instead? In fact, I think we could replace the corner with just normal slash, "/", write = to the right of the divisor and spell out the digits of the result to the right of it; the substraction chain will still go down the page.
> In fact, I think we could replace the corner with just normal slash, "/", write = to the right of the divisor and spell out the digits of the result to the right of it; the substraction chain will still go down the page.
That's exactly the way I was taught long division (in Germany).
In CPython, because monkey-patching like this isn't supported, the byte compiler turns a "0/2" into a "0.0", as you can see with:
[1] EDIT: except through something like whole-program analysis.