2 ms·
> keyword "ℕ" cannot be used as an identifier It looks to me like the guy has an outbreak of reservedkeyworditis the language that he's trying to handwave arou
by kazinator 5y ago
> keyword "ℕ" cannot be used as an identifier
It looks to me like the guy has an outbreak of reservedkeyworditis the language that he's trying to handwave around with some talking point about sets versus type.
But a syntax error of a reserved keyword being used in some phrase structure that calls for a a non-reserved identifier doesn't have anything to do with type semantics.
The phrase structure of the A ⊆ B syntax could allow B to be certain keywords, such as ℕ, which is treated as a set in that context in the appropriate way (via an implicit conversion or whatever).
We know what A ⊆ N means; what the programmer is asking. The requirement is not unclear. Moreover, it is doable. The question is do you do that, or not.
- jdmichal 5y agoThat struck me too. My initial impression was to simply implement "Set s ⊆ Type t" as something like "∀i: sᵢ instanceof t"