Ignore:
Timestamp:
Aug 8, 2024, 5:25:41 PM (20 hours ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
11cced6
Parents:
ab11ab1
Message:

Move partial scope to future work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/jiada_liang_MMath/conclusion.tex

    rab11ab1 rc4aca65  
    22\label{c:conclusion}
    33
    4 The 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 backwards compatibility with C.
     4The 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.
    55Within this goal, the new \CFA enumeration should align with the analogous enumeration features in other languages to match modern programming expectations.
    66Hence, 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.
    77
    8 Additional safety is provided by strong type-checking of enumeration initialization and assignment, ensuring an enumeration only contains its enumerators.
     8Strong type-checking of enumeration initialization and assignment provides additional safety, ensuring an enumeration only contains its enumerators.
    99Overloading 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.
    1010Typed enumerations solve the data-harmonization problem increasing safety through better software engineering.
    11 As well, 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.
     11Moreover, 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.
    1212Generalization and reuse are supported by incorporating the new enumeration type using the \CFA trait system.
    1313Enumeration 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.
    1414Using advanced duck typing, existing 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, I expanded the \CFA project's test-suite 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 These tests ensure future \CFA work does not accidently break the new enumeration system.
     15Finally, I expanded the \CFA project's test suite 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.
     16These tests ensure future \CFA work does not accidentally break the new enumeration system.
    1717
    18 The conclusion is that the new \CFA enumeration mechanisms achieves the initial goals, providing C programmers with an intuitive enumeration mechanism for handling modern programming requirements.
     18The conclusion is that the new \CFA enumeration mechanisms achieve the initial goals, providing C programmers with an intuitive enumeration mechanism for handling modern programming requirements.
    1919
    2020
     
    2222
    2323There are still corner cases being found in the current \CFA enumeration implementation.
    24 Fixing some of these corner cases, requires changes to the \CFA resolver or extensions to \CFA, like compile-time constant-expression evaluation.
     24Fixing some of these corner cases requires changes to the \CFA resolver or extensions to \CFA, like compile-time constant-expression evaluation.
    2525When these changes are made, it should be straightforward to update the \CFA enumeration implementation to work with them.
    2626
    27 Currently, some aspects of the enumeration trait system require explicitly including file @enum.hfa@, which easily leads to problems.
     27Currently, some aspects of the enumeration trait system require explicitly including the file @enum.hfa@, which can lead to problems.
    2828It should be possible to have this file included implicitly by updating the \CFA prelude.
    2929
     
    4242enum( wchar_t * ) { Jack = L"John" };
    4343\end{cfa}
    44 The enumerating feature was developed in parallel with the \CFA iterator. In the forseeable future when iterator come to matuity, \CFA enumeration can adapt iterator-related traits and
    45 be rewritten with iterator.
     44There are several new features have been proposed or are developing in parallel with enumerations.
     45Two closely related features are iterator and namespace.
     46
     47Enumerating features, and range loops in particular, are currently implemented as loops unique to \CFA enumeration and do not align with the
     48general iterator pattern. They can be adapted to the iterator interface when it comes to maturity.
     49
     50Currently, \CFA implements a namespace feature for enumerated types only. There is recently a proposal by Andrew to
     51generalize the concept of namespace to other types. The enumeration scope will be revisited to follow the semantics
     52with other types. Also to improve the granularity of scope control, we propose the following extension:
     53\begin{cfa}
     54enum E1 { @!@A, @^@B, C };
     55enum E2 @!@ { @!@A, @^@B, C };
     56\end{cfa}
     57which provides a combination of scoped and unscoped enumerators.
     58For @E1@, @A@ is scoped; @B@ and @C@ are unscoped.
     59For @E2@, @A@, and @C@ are scoped; @B@ is unscoped.
     60Finding a use case is important to justify completing this extension.
Note: See TracChangeset for help on using the changeset viewer.