Stephen Heumann

@sheumann
1 Followers
3 Following
7 Posts
@thephd 6. It would be nice to have better handling in the standard for situations where one structure type is an "extended" version of another, with extra members added. Maybe out of scope for this proposal, but it seems potentially related.
@thephd 5. Can named and unnamed bit-fields match each other when using _Record(types)? I think the answer is yes based on the proposed wording, but this gives rise to a slightly odd situation where two compatible structure types may have different numbers of initializable members. Whatever the answer winds up being, I'd suggest including an example.
@thephd 4. Please make sure the standard wording reflects what you intend with regard to the interaction between _Record and anonymous structures and unions. For example, can an anonymous structure or union in a structure type declared with _Record(types) match with a named member of another for type compatibility purposes? I'd suggest including examples of these cases. (Also, your document seems to use "anonymous structure" differently from the definition in the standard, which is confusing.)
@thephd 3. I'm not entirely convinced that having _Record, _Record(types), and potentially _Record(other::attributes) is valuable enough to justify the complexity of it. I'd be tempted to just specify one version and leave any implementation-specific variants up to the regular attribute syntax.
@thephd 2. I'm not sure _Record is a good name for it. To me, this calls to mind records in Pascal, which are essentially its version of structures and/or unions and do not have structural compatibility rules. The term "record" is also used in several other programming languages and in databases, often not with the meaning you're giving it. A possible alternative that comes to mind is "tuple", although that corresponds most naturally to what you call _Record(types).

@thephd Some thoughts from the maintainer of a small C implementation:

1. I think structural typing in C would be valuable.

I've released ORCA/C 2.2.1. This is the latest version of ORCA/C, the C compiler for the Apple IIGS. ORCA/C 2.2.1 is primarily a bug-fix update to ORCA/C 2.2.0, although it also improves the code generated for certain operations.

Note that this update must be applied on top of an existing copy of ORCA/C 2.1 or later. If you don't already have that, it's available as part of the Opus ][ collection sold by Juiced.GS.

https://github.com/byteworksinc/ORCA-C/releases/tag/orcac-221

Release ORCA/C 2.2.1 · byteworksinc/ORCA-C

ORCA/C 2.2.1 is a new release of the ORCA/C compiler for the Apple IIGS. Major changes since ORCA/C 2.1.0 include: Added support for almost all language and library features required by the C17 st...

GitHub