diff --git a/content/blog/06_compiler_semantics.md b/content/blog/06_compiler_semantics.md index 87fa1a6..1cf6b72 100644 --- a/content/blog/06_compiler_semantics.md +++ b/content/blog/06_compiler_semantics.md @@ -87,5 +87,18 @@ $$ \\mathcal{C} ⟦f⟧ \; \\rho = [\\text{PushGlobal} \\; f] $$ -Next up, case expressions. These are a bit more complex: there are several -branches, each of which will have its own environment. +Now it's time for us to compile case expressions, but there's a bit of +an issue - our case expressions branches don't map one-to-one with +the \\(t \\rightarrow i\_t\\) format of the Jump instruction. +This is because we allow for name patterns in the form \\(x\\), +which can possibly match more than one tag. Consider this +rather useless example: + +``` +data Bool = { True, False } +defn weird b = { case b of { b -> { False } } } +``` + +We only have one branch, but we have two tags that should +lead to it! +