Closed Sword-Smith closed 9 months ago
That means, we probably want to change the BlockStmt
to
BlockExpr {
pub stmts: Vec<Stmt<T>>,
pub return_expr: Option<<Expr<T>>
}
and then use this for while loops, blocks, if/else expressions, if/else statements etc.
Closed by 4877f00f6a8020af63fdde17387dc1a853138140
We want to be able to write
Supporting blocks that can return values would be a good way to prevent memory spilling, as the stack is cleared after the block. And we also need those expressions for a proper if/else expression implementation.