Re:Expresso: A simple expressions language with polymorphic ...
by acjohnson55 on Saturday November 17, 2018 @11:42PM
(#18478911)
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?
[ Parent
| on HN ]
Re:Expresso: A simple expressions language with polymorphic ...
by willtim on Sunday November 18, 2018 @04:12AM
(#18479496)
Labels 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).
Re:Expresso: A simple expressions language with polymorphic ...
by acjohnson55 on Tuesday November 20, 2018 @09:36PM
(#18499784)
But it seems like it would be an error to concatenate two records with a name clash, though, right?
Re:Expresso: A simple expressions language with polymorphic ...
by willtim on Friday November 30, 2018 @02:40AM
(#18567436)
Yes 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.