gracelang / minigrace

Self-hosting compiler for the Grace programming language
39 stars 22 forks source link

None is not defined #308

Closed apblack closed 4 years ago

apblack commented 4 years ago

Contrary to what it says in the spec, the type None is not defined in minigrace.

No actual object has type None, so as a pattern None.matches will always return false. None can't be defined (as a type) in Grace, so it should be part of the language, like Unknown, rather than defined in standardGrace.

apblack commented 4 years ago

None is now (as of 90ab75e8ee9f) defined in intrinsics. The type Type also has an additional method isNone, so that type checks against None can be coded. This is necessary because the representation used for sets of methods, sequences, does not permit the representation of infinite sets of messages, as would otherwise be necessary for None