... | ... | @@ -68,7 +68,7 @@ So we have decided to avoid the extensible record debate, but how can we have mu |
|
|
1. **[Frege-derived Records](records/name-spacing) (FDR)**. Uses (Plan A) + (Plan B).
|
|
|
1. **[Declared Overloaded Record Fields](records/declared-overloaded-record-fields) (DORF)**. Tweak to SORF. (Plan B)
|
|
|
1. **[Syntax Directed Name Resolution](records/syntax-directed-name-resolution)**. Alternative that relies on syntactic rewriting and lenses.
|
|
|
1. **[Records/TypeIndexedRecords](records/type-indexed-records)**. (Plan B)
|
|
|
1. **[Type Indexed Records](records/type-indexed-records)**. (Plan B)
|
|
|
1. **Are there any other approaches?**
|
|
|
|
|
|
### Similarities
|
... | ... | @@ -88,7 +88,7 @@ Syntax directed name resolution doesn't use dots at all, the dot remains functio |
|
|
### Comparisons
|
|
|
|
|
|
|
|
|
The DORF proposal is a variant of SORF with similar goals. ~~\~However, it only solves the narrow name-spacing issue within a module. If a record is imported into another module, it will still clash.~~\~ It is perfectly possible to import Declared Overloaded Record Fields into other modules, and 'share' them in records declared in the importing module (and use the selector function for both the declared records and records imported). Alternatively, if the names are an 'accidental' clash, use qualified naming. (The type system prevents using the 'wrong' selector for a record type.). This is no worse than existing H98 modules/qualified naming. -- corrected by AntC, author of DORF.
|
|
|
The DORF proposal is a variant of SORF with similar goals. However, it only solves the narrow name-spacing issue within a module. If a record is imported into another module, it must either share labels with it (automatic abstraction over fields) or use qualified module names.
|
|
|
|
|
|
|
|
|
DORF and SORF abstract over fields. The benefit of abstracting over field names is being able to write code that works against any Record with a given field. So I can have a function:
|
... | ... | |