4 ms·
It's similar to the Rust example from my post: there are no anonymous records, so in order to be able to construct something with named fields, you need to firs
by sestep 1y ago
It's similar to the Rust example from my post: there are no anonymous records, so in order to be able to construct something with named fields, you need to first define those record types outside. In contrast, my proposed syntax depends on already having anonymous record types like OCaml and TypeScript do, but avoids the extra boilerplate required by separating types from binding forms as shown in my TypeScript example.
- instig007 1y agoBut structural typing that allows you defining anonymous record types is orthogonal to colocation of types and bindings. You're effectively saying that you're proposing a type system that supports structural types, syntax and colocation don't have much to do with it.
- sestep 1y agoCould you clarify what you mean? TypeScript already has structural types, but I already examined it in my post; if that were the only thing I was saying then my post would have just used TypeScript at the top.