Changeset 5b4c8df for doc


Ignore:
Timestamp:
Aug 8, 2024, 3:21:04 PM (26 hours ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
ab11ab1
Parents:
a8f44c8
Message:

update comparison table

File:
1 edited

Legend:

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

    ra8f44c8 r5b4c8df  
    3333The type of each constant name (enumerator) is inferred from the constant-expression type.
    3434
    35 Pascal introduced the enumeration type characterized by a set of ordered, unscoped identifiers (enumerators), which are not overloadable.\footnote{%
     35Some dialects of Pascal introduced the enumeration type characterized by a set of ordered, unscoped identifiers (enumerators), which are not overloadable.\footnote{%
    3636Pascal is \emph{case-insensitive} so identifiers may appear in multiple forms and still be the same, \eg \lstinline{Mon}, \lstinline{moN}, and \lstinline{MON} (a questionable design decision).}
    3737\begin{pascal}
     
    12461246&
    12471247\begin{ocaml}
     1248
     1249
     1250
     1251
     1252
    124812533
    124912543.5
    125012553 5
    1251 
    1252 
    1253 
    1254 
    1255 
    12561256\end{ocaml}
    12571257\end{tabular}
     
    15321532\section{Comparison}
    15331533
    1534 \VRef[Table]{t:FeatureLanguageComparison} shows a comparison of enumeration features and programming languages.
    1535 The features are high level and may not capture nuances within a particular language
    1536 The @const@ feature is simple macros substitution and not a typed enumeration.
     1534\VRef[Table]{t:FeatureLanguageComparison} shows a comparison of enumeration features and programming languages with the explaination of categories below.
     1535The features are high level and may not capture nuances within a particular language.
    15371536
    15381537\begin{table}
     
    15431542\newcommand{\CM}{\checkmark}
    15441543\begin{tabular}{r|c|c|c|c|c|c|c|c|c|c|c|c|c}
    1545                                 &Pascal & Ada                   &\Csharp   & OCaml & Java       &Golang& Rust           & Swift                 & Python& C             & \CC   & \CFA  \\
     1544                                &Pascal & Ada                   &\Csharp   & OCaml  & Java      &Golang   & Rust                & Swift                 & Python& C             & \CC   & \CFA  \\
    15461545\hline
    1547 enum                    &Dialect& \CM                   & \CM      & ADT  & \CM   & @const@&ADT/\CM     &ADT/\CM                & \CM   &\CM    &\CM   &\CM\\
     1546enum                    &Dialect& \CM                   & \CM      & ADT    & \CM   & @const@ &ADT/\CM      &ADT/\CM            & \CM   &\CM    &\CM   &\CM\\
    15481547\hline
    15491548\hline
    1550 opaque                  &               &                               &                  & \CM   & \CM   &            &                       & \CM                   &               &               &               & \CM   \\
     1549opaque                  & \CM    &                              &                  & \CM    & \CM   &             & \CM         & \CM                   &               &               &               & \CM   \\
    15511550\hline
    1552 typed                   &Int    & Int                   & Integral  & H     & U    & H     & U/H        & U/H           & H         & Int       & Integral& U   \\
     1551typed                   & Int    & Int                  & Integral  & H     & U     & H       & U/H         & U/H           & H     & Int       & Integral& U   \\
    15531552\hline
    1554 safety          & \CM   & \CM                   &          & \CM        & \CM   &               & \CM           & \CM                   &               &               & \CM   & \CM   \\
     1553safety          & \CM   & \CM                   &          & \CM        & \CM   &                 & \CM                 & \CM                   &               &               & \CM   & \CM   \\
    15551554\hline
    1556 posn ordered    & \CM   & \CM                   & \CM      & \CM   & \CM   &            &                       & \CM                   &       &           &       & \CM       \\
     1555posn ordered    & Implied & Implied     &          & \CM    &       &             &                         &                   &       &           &       & \CM       \\
    15571556\hline
    1558 unique values   & \CM   &                               & \CM      &            & \CM   & \CM   &                       & \CM                   & alias & \CM   & \CM   & \CM   \\
     1557unique values   & \CM   & \CM           &           &           &       &      &                            & \CM               &       &           &       &     \\
    15591558\hline
    1560 % setable       repr.   & \CM   & \CM                   & \CM      &            & \CM   & \CM   & \CM           & \CM                   & \CM   & \CM   & \CM   & \CM   \\
    1561 % \hline
    1562 auto-init               & \CM   & @all or none@   & \CM      &       &       & \CM   & \CM      & \CM                      & \CM   & \CM        & \CM   & \CM   \\
    1563 % This one is tricky: C/C++/CC has auto-init value. Some have auto-init underlying representation
     1559auto-init               & \CM   & @all or none@   & \CM      &      &       & \CM     & \CM         & \CM               & \CM   & \CM   & \CM   & \CM   \\
    15641560\hline
    1565 (Un)Scoped              & U     & U                     & S        & S      & S         & U     & S             & S                     & S     & U             & U/S   & U/S   \\
     1561(un)Scoped              & U     & U                     & S        & S      & S         & U       & S               & S                         & S     & U             & U/S   & U/S   \\
    15661562\hline
    1567 overload                &               & \CM                   & n/a       & n/a       &n/a    &               & n/a           & n/a                   &n/a    &               &       & \CM   \\
     1563overload                &               & \CM                   &              &            &      &              &                 &                       &      &            &       & \CM   \\
    15681564\hline
    1569 loop                    & \CM   & \CM                   &                  &            &               &               &                       &                       & \CM   &               &               & \CM   \\
     1565loop                    & \CM   & \CM                   &                  &            &               &                 &                         &                   & \CM   &               &               & \CM   \\
    15701566\hline
    1571 % array/subscript       &               &               &               &                               &               &               &               &               &               & \CM   &               & \CM   \\
    1572 % \hline
    1573 subset                  & \CM   & \CM                   &         & \CM     &           &               &                       &                       &               &               &               & \CM   \\
     1567arr. dim.               & \CM   & \CM           &                  &              &                 &           &                 &                         &            &      &               & \CM \\
    15741568\hline
    1575 superset                &               &                               &                 &                 &           &               &                       &               &               &               &               & \CM   \\
     1569subset                  & \CM   & \CM                   &         & \CM     &           &                 &                         &                   &               &               &               & \CM   \\
     1570\hline
     1571superset                &               &                               &                 &                 &           &                 &                         &               &           &               &               & \CM   \\
    15761572\end{tabular}
    15771573\end{table}
    15781574
    15791575\begin{enumerate}
    1580 \item Opaque: Language has opaque enum if its enumerator cannot be used as its underlying representation or its enum is implemented as ADT.
    1581 \item Typed: The type of value. H: heterogeneous type; enumerators from the same enum need not be has the same type.
    1582 U: uni-type; enumerators must have the same type.
     1576\item Opaque: Opaque enums' enumerator cannot be used as its underlying representation or being implemented in terms of ADT.
     1577\item Typed: The type of value. H: heterogeneous type; values from the same enum need not be the same type.
     1578U: uni-type; value must have the same type.
    15831579\item Safe: A enumeration variable can only hold a value from its defined enumerators.
    15841580\item Posn ordered: enumerators have defined ordering based on enuemrator declaration order.
     1581It is implied position ordered if its enumerator value must be strictly increasingly ordered.
    15851582\item Unique value: enumerators must have unique value.
    1586 \item Auto-init: Value are auto initializable.
    1587 \item (Un)Scoped: U: unscoped enuemrators and does not need qualification; S: Scoped enumerators and requires qualification
    1588 \item Overload: An enumerator label can be used without type qualification in a context where the label has defined by multiple enumerations
    1589 \item Loop: Enumerate enum members without explicitly convert it to other data structures
    1590 \item Subset: Name a subset of enumerator as a new type.
    1591 \item Superset: Create a new enumeration that contain all enumerators from pre-defined enuemration.
     1583\item Auto-init: Value are auto initializable by language specification, often being the "+1" of the predecessor.
     1584\item (Un)Scoped: U: unscoped enuemrators and does not need qualification; S: Scoped enumerators and requires qualification.
     1585\item Overload: An enumerator label can be used without type qualification in a context where the label has defined by multiple enumerations.
     1586\item Loop: Enumerate enum members without the need to convert an enumeration to another data structure
     1587\item Arr. dim: An enumeration can be used directly as array dimension and enumerators can be mapped to an array element (not a conversion to integer type).
     1588\item Subset: Name a subset of enumerators as a new type.
     1589\item Superset: Create a new enumeration that contains all enumerators from pre-defined enuemrations.
    15921590\end{enumerate}
Note: See TracChangeset for help on using the changeset viewer.