3 ms·
It seems like there's just a global namespace of labels. This reminds me of the situation in Javascript before symbols were introduced. I'm curious why this cho
by acjohnson55 8y ago
It seems like there's just a global namespace of labels. This reminds me of the situation in Javascript before symbols were introduced. I'm curious why this choice was made?
- willtim 8y agoLabels in Expresso are just type-level symbols. Label names can be re-used over and over again in different records and variants. This works fine because a name is not tired to any particular nominal type (like a constructor in Haskell or Java).
- acjohnson55 8y agoBut it seems like it would be an error to concatenate two records with a name clash, though, right?
- willtim 8y agoYes because duplicate labels are not allowed within the scope of a single record (you can specify which one overrides the other, but perhaps we also need a convenient rename syntax). This point was that different records can happily contain the same field names. The situation is the same as SQL.