▲ | Drakim 4 hours ago | |
By random chance I'm working on making my own programming language and I very recently used RPN for my expressions. It's a very neat and clean way to implement order precedence and then afterwards you can translate the entire flat expression into a tree-like structure to fit into your AST and be sure that transformation doesn't mess anything up. I'm surprised you think the condition in the while statement would be any different though, an expression is an expression, it doesn't matter if you are assigning a variable, evaluating an if condition, or doing a while loop, you still need an expression for each of them, and the expressions should behave the same way in each of them. As for the case "while" and case "end", I think the case "end", he actually does explain them pretty well as he is writing them. It can be a little confusing because he puts ... as a placeholder and implements the code a little later in the video. |