diprism / perpl

The PERPL Compiler
MIT License
10 stars 5 forks source link

Split Var into TmVar, TmName, TpVar, TpName, Tag #118

Closed ccshan closed 1 year ago

ccshan commented 1 year ago

https://github.com/diprism/perpl/issues/103#issuecomment-1207199654

davidweichiang commented 1 year ago

Oops, I left a bunch of comments on the branch instead of on the PR. That's surprising that they are two different things. Sorry about that!

davidweichiang commented 1 year ago

This does not give an error:

data x = Bla;
let x = () in (fail : x)

But this does:

data Bla = Bla;
()
davidweichiang commented 1 year ago

Since both Ctxt and Subst have three mappings for types, terms, and tags, I think the easiest way to make things consistent is to let types, terms, and tags have three different namespaces. The above commit makes this change. The rest of my comments are minor.