Update records.md

This commit is contained in:
Arseny Kapoulkine 2021-11-15 17:25:45 -08:00 committed by GitHub
parent e0d72eda0d
commit dba42768cd
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,7 @@ introduce support for packed records where the table definition must use types a
> TODO: It's going to be difficult to migrate to packed records. Is there anything we can do right now to keep this possibility open without enforcing types at runtime? > TODO: It's going to be difficult to migrate to packed records. Is there anything we can do right now to keep this possibility open without enforcing types at runtime?
The rest of this proposal goes into syntax and semantics. The rest of this proposal goes into syntax and semantics. The goal of this proposal is to solve the problem of object storage both for simple objects and for classes -- that is, if we add records we won't need to add classes.
### Record type ### Record type
@ -167,6 +167,10 @@ Of course, the type checker also knows that the record type has the metatable wi
> TODO: Does the type checker need to understand the internal structure of the shape so that type checking works across modules, or is simply modeling this > TODO: Does the type checker need to understand the internal structure of the shape so that type checking works across modules, or is simply modeling this
> as a metatable sufficient? > as a metatable sufficient?
### Object modeling
> TODO: records don't support implementation inheritance and why it's a good thing
## Drawbacks ## Drawbacks
Adding a new data type that is cross-cutting (across syntax, semantics/compiler, semantics/type checking, and runtime) results in added complexity. Adding a new data type that is cross-cutting (across syntax, semantics/compiler, semantics/type checking, and runtime) results in added complexity.