- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/jiada_liang_MMath/conclusion.tex
racab1bd r29c8675 2 2 \label{c:conclusion} 3 3 4 Th e goal of this work is to extend the simple and unsafe enumeration type in the C programming language into a complex and safe enumeration type in the \CFA programming language while maintaining backward compatibility with C.4 This work aims to extend the simple and unsafe enumeration type in the C programming language into a complex and safe enumeration type in the \CFA programming language while maintaining backward compatibility with C. 5 5 Within this goal, the new \CFA enumeration should align with the analogous enumeration features in other languages to match modern programming expectations. 6 6 Hence, the \CFA enumeration features are borrowed from a number of programming languages, but engineered to work and play with \CFA's type system and feature set. … … 8 8 Strong type-checking of enumeration initialization and assignment provides additional safety, ensuring an enumeration only contains its enumerators. 9 9 Overloading and scoping of enumerators significantly reduces the naming problem, providing a better software-engineering environment, with fewer name clashes and the ability to disambiguate those that cannot be implicitly resolved. 10 Typed enumerations solve the data-harmonization problem increasing safety through better software engineering.10 Typed enumerations solve the data-harmonization problem, increasing safety through better software engineering. 11 11 Moreover, integrating enumerations with existing control structures provides a consistent upgrade for programmers and a succinct and secure mechanism to enumerate with the new loop-range feature. 12 12 Generalization and reuse are supported by incorporating the new enumeration type using the \CFA trait system. 13 Enumeration traits define the meaning of an enumeration, allowing functions to be written that work on any enumeration, such as the reading and printing an enumeration.14 Using advanced duck typing, existingC enumerations can be extended so they work with all of the enumeration features, providing for legacy C code to be moved forward into the modern \CFA programming domain.15 Finally, I expanded the \CFA project's test-suitewith multiple enumeration features tests with respect to implicit conversions, control structures, inheritance, interaction with the polymorphic types, and the features built on top of enumeration traits.13 Enumeration traits define the meaning of an enumeration, allowing functions to be written that work on any enumeration, such as the reading and printing of an enumeration. 14 With advanced structural typing, C enumerations can be extended so they work with all of the enumeration features, providing for legacy C code to be moved forward into the modern \CFA programming domain. 15 Finally, the \CFA project's test suite has been expanded with multiple enumeration features tests with respect to implicit conversions, control structures, inheritance, interaction with the polymorphic types, and the features built on top of enumeration traits. 16 16 These tests ensure future \CFA work does not accidentally break the new enumeration system. 17 17 18 The conclusion is thatthe new \CFA enumeration mechanisms achieve the initial goals, providing C programmers with an intuitive enumeration mechanism for handling modern programming requirements.18 In summary, the new \CFA enumeration mechanisms achieve the initial goals, providing C programmers with an intuitive enumeration mechanism for handling modern programming requirements. 19 19 20 20 … … 51 51 \end{cfa} 52 52 \item 53 Currently enumeration scoping is all or nothing. In some cases, it might be useful to53 Currently, enumeration scoping is all or nothing. In some cases, it might be useful to 54 54 increase the scoping granularity to individual enumerators. 55 55 \begin{cfa} … … 68 68 typedef RGB.Red OtherRed; // alias 69 69 \end{cfa} 70 \item 71 Label arrays are auxiliary data structures that are always generated for \CFA enumeration, which is a considerable program overhead. 72 It is helpful to provide a new syntax or annotation for a \CFA enumeration definition that tells the compiler the labels will not be used 73 throughout the execution. Therefore, \CFA optimizes the label array away. The @value()@ function can still be used on an enumeration constant, 74 and the function called is reduced to a @char *@ constant expression that holds the name of the enumerator. But if @value()@ is called on 75 a variable with an enumerated type, it returns an empty string since the label information is lost for the runtime. 70 76 \end{enumerate}
Note: See TracChangeset
for help on using the changeset viewer.