Are there only 3 (4?) kinds? ---------------------------- * struct * abstract struct <-- is this necessary * concrete class with identity * abstract class Separate keywords or multiple "flag keywords"? ---------------------------------------------- Examples of keywords: * value - value type * identity - type with identity (always passed by reference) * abstract - abstract/interface/trait * concrete - concrete/leaf class * mutable - has modifiable fields Examples with flags on same line: type value abstract Property of T type identity abstract InputStream type identity concrete createonly FileInputStream implements InputStream Examples with flags on separate lines: type Property of T value abstract type InputStream identity abstract type FileInputStream implements InputStream identity concrete createonly Examples with flags on separate lines with prefix keyword: type Property of T typemode value typemode abstract type InputStream typemode identity typemode abstract type FileInputStream implements InputStream typemode identity typemode concrete typemode createonly Separate keywords examples: | Abstract Concrete | ----------+---------------------------------+ Value | form record | Identity | trait class | ----------+---------------------------------+ | Abstract Concrete | ----------+---------------------------------+ Value | form struct | Identity | interface class | ----------+---------------------------------+ Or, have "identity" as a (built-in) interface: class Point class File implements Identity Also, ref vs aliased vs embedded: * maybe ref-ness could be decided by the compiler? * aliased/non-aliased and linked/embedded, however, affect behavior. Problems -------- With this system, only leaf classes can be assumed to have / not have an identity. So only leaf classes can be copied. Maybe there's another way? record = immutable unless concrete and "owned" and not aliased? class = possibly mutable, can be aliased? How to prevent mistakes ----------------------- Incorrectly specifying a type as a value type can cause problems if there's at least one mutable field