Please sign in to comment.
Rewrite 'LET' syntactic form to DO blocks
The compiler for template 'expressions' supports 'let' expressions to declare a variable and construct more complex expression graphs than simple trees. To ensure that any declarations in the let block are available in its associated expression, the declarations should compiled before the expression is. Prior to this commit, this was hardcoded by 'rooting' the declarations in the tree. However, this ensures that the value declarations are ordered *globally* prior to the LET expression, and as a result, does not allow let expressions to be composed. For instance the following expression would compile the declaration of $x prior to the conditional jump in IF, which is not correct: (if (test ...) (let (($x ...)) (add $x ...)) (null)) This patch changes the template compiler to translate the LET forms into DO blocks, which also preserve order when compiled, but unlike 'rooting' they can be nested safely.
- Loading branch information...
Showing with 23 additions and 10 deletions.