- Timestamp:
- Feb 16, 2024, 1:26:46 PM (4 months ago)
- Branches:
- master
- Children:
- 38f5006
- Parents:
- 38f4953
- Location:
- doc/theses/jiada_liang_MMath
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/jiada_liang_MMath/CFAenum.tex
r38f4953 rf9da761 201 201 \section{Enumeration Pseudo-functions} 202 202 203 Pseudo-functions are function-like operators that do not result in any run-time computations, i.e.,like @sizeof@, @offsetof@, @typeof@.203 Pseudo-functions are function-like operators that do not result in any run-time computations, \ie like @sizeof@, @offsetof@, @typeof@. 204 204 Often a call to a pseudo-function is substituted with information extracted from the symbol table at compilation time, like storage size or alignment associated with the underlying architecture.. 205 205 … … 250 250 \end{cquote} 251 251 Here, the intuitive code on the left is implicitly transformed into the statndard implementation on the right, using the value of the enumeration variable and enumerators. 252 However, this implementation is fragile, e.g.,if the enumeration is changed to:252 However, this implementation is fragile, \eg if the enumeration is changed to: 253 253 \begin{cfa} 254 254 enum Count { First, Second, Third @= First@, Fourth }; -
doc/theses/jiada_liang_MMath/background.tex
r38f4953 rf9da761 22 22 \end{cfa} 23 23 This feature allow enumerator lines to be interchanged without moving a comma.\footnote{ 24 A terminating comma appears in other C syntax, e.g.,the initializer list.}25 Finally, C enumerators are \Newterm{unscoped}, i.e.,enumerators declared inside of an @enum@ are visible (projected) into the enclosing scope of the @enum@ type.24 A terminating comma appears in other C syntax, \eg the initializer list.} 25 Finally, C enumerators are \Newterm{unscoped}, \ie enumerators declared inside of an @enum@ are visible (projected) into the enclosing scope of the @enum@ type. 26 26 27 27 In theory, a C enumeration \emph{variable} is an implementation-defined integral type large enough to hold all enumerated values. -
doc/theses/jiada_liang_MMath/implementation.tex
r38f4953 rf9da761 307 307 \section{Iteration and Range} 308 308 309 It is convenient to iterate over a \CFA enumeration value, e.g.:309 It is convenient to iterate over a \CFA enumeration value, \eg: 310 310 \begin{cfa}[label=lst:range_functions] 311 311 for ( Alphabet alph; Alphabet ) { sout | alph; } -
doc/theses/jiada_liang_MMath/intro.tex
r38f4953 rf9da761 1 1 \chapter{Introduction} 2 2 3 Naming values is a common practice in mathematics and engineering, e.g.,$\pi$, $\tau$ (2$\pi$), $\phi$ (golden ratio), MHz (1E6), etc.3 Naming values is a common practice in mathematics and engineering, \eg $\pi$, $\tau$ (2$\pi$), $\phi$ (golden ratio), MHz (1E6), etc. 4 4 Naming is also commonly used to represent many other numerical phenomenon, such as days of the week, months of a year, floors of a building (basement), specific times (noon, New Years). 5 5 Many programming languages capture this important software-engineering capability through a mechanism called an \Newterm{enumeration}. … … 8 8 9 9 Specifically, an enumerated type restricts its values to a fixed set of named constants. 10 While all types are restricted to a fixed set of values because of the underlying von Neumann architecture, and hence, to a corresponding set of constants, e.g.,@3@, @3.5@, @3.5+2.1i@, @'c'@, @"abc"@, etc., these values are not named, other than the programming-language supplied constant names.10 While all types are restricted to a fixed set of values because of the underlying von Neumann architecture, and hence, to a corresponding set of constants, \eg @3@, @3.5@, @3.5+2.1i@, @'c'@, @"abc"@, etc., these values are not named, other than the programming-language supplied constant names. 11 11 12 12 Fundamentally, all enumeration systems have an \Newterm{enumeration} type with an associated set of \Newterm{enumerator} names. … … 25 25 Here, the \Newterm{enumeration} @Weekday@ defines the ordered \Newterm{enumerator}s @Monday@, @Tuesday@, @Wednesday@, @Thursday@, @Friday@, @Saturday@ and @Sunday@. 26 26 By convention, the successor of @Tuesday@ is @Monday@ and the predecessor of @Tuesday@ is @Wednesday@, independent of the associated enumerator constant values. 27 Because an enumerator is a constant, it cannot appear in a mutable context, e.g.@Mon = Sun@ is meaningless, and an enumerator has no address, it is an \Newterm{rvalue}\footnote{27 Because an enumerator is a constant, it cannot appear in a mutable context, \eg @Mon = Sun@ is meaningless, and an enumerator has no address, it is an \Newterm{rvalue}\footnote{ 28 28 The term rvalue defines an expression that can only appear on the right-hand side of an assignment.}. 29 30 \section{Contributions} -
doc/theses/jiada_liang_MMath/uw-ethesis-frontpgs.tex
r38f4953 rf9da761 131 131 \begin{center}\textbf{Abstract}\end{center} 132 132 133 An enumeration is a type defining an ordered set of named constant values, where a name abstracts a value, e.g.,@PI@ versus @3.145159@.133 An enumeration is a type defining an ordered set of named constant values, where a name abstracts a value, \eg @PI@ versus @3.145159@. 134 134 C restrict an enumeration type to the integral type @signed int@, which \CC support , meaning enumeration names bind to integer constants. 135 135 \CFA extends C enumerations to allow all basic and custom types for the enumeration type, like other modern programming languages.
Note: See TracChangeset
for help on using the changeset viewer.