4 ms·
Specifically structural record types, and many statically typed languages don't have them. (not Java, not C++, not Haskell, not Rust, yes Swift, yes OCaml)
by resf 9y ago
Specifically structural record types, and many statically typed languages don't have them. (not Java, not C++, not Haskell, not Rust, yes Swift, yes OCaml)
- jstimpfle 9y agoWhat I wanted to point out is that typically a C struct is what you need. The common case is static keys and static value types but dynamic values. What are interesting use cases for more dynamic (i.e. non-fixed set of keys / types)? I mean, if you need something super-abstract and flexible, you are unlikely to need a built-in convenient syntax to hardcode such values.
- mrkgnao 9y ago, yes Purescript :) For those new to this, good search terms are "row polymorphism", "extensible records", and "polymorphic variants".