Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on The Best Algorithms of the 20th Century [pdf].
The Fortran I compiler would expand each operator with a sequence of parentheses. In a simplified form of the algorithm, it would
• replace + and – with ))+(( and ))-((, respectively;
• replace * and / with )*( and )/(, respectively;
• add (( at the beginning of each expression and after each left parenthesis in the original expression; and
• add )) at the end of the expression and before each right parenthesis in the original expression.
This is the first time I hear about this, this technique will work with today compilers vs. most others like precedence climb?
There are no comments on this comment yet.
The Fortran I compiler would expand each operator with a sequence of parentheses. In a simplified form of the algorithm, it would
• replace + and – with ))+(( and ))-((, respectively;
• replace * and / with )*( and )/(, respectively;
• add (( at the beginning of each expression and after each left parenthesis in the original expression; and
• add )) at the end of the expression and before each right parenthesis in the original expression.
This is the first time I hear about this, this technique will work with today compilers vs. most others like precedence climb?