Changeset e00b10d

Mar 23, 2024, 7:01:05 PM (4 months ago)
Peter A. Buhr <pabuhr@…>

added Gregor and Andrew emails

1 edited


  • doc/theses/jiada_liang_MMath/relatedwork.tex

    r4094d05a re00b10d  
    25872587With valediction,
    25882588  - Gregor Richards
     2590Date: Wed, 20 Mar 2024 18:16:44 -0400
     2591Subject: Re:
     2592To: "Peter A. Buhr" <>
     2593From: Gregor Richards <>
     2596On 3/20/24 17:26, Peter A. Buhr wrote:
     2597> Gregor, everyone at this end would like a definition of "enumerability". Can
     2598> you formulate one?
     2600According to the OED (emphasis added to the meaning I'm after):
     2602enumerate (verb, transitive). To count, ascertain the number of; **more
     2603usually, to mention (a number of things or persons) separately, as if for the
     2604purpose of counting**; to specify as in a list or catalogue.
     2606With C enums, if you know the lowest and highest value, you can simply loop
     2607over them in a for loop (this is, of course, why so many enums come with an
     2608ENUM_WHATEVER_LAST value). But, I would be hesitant to use the word "loop" to
     2609describe enumerability, since in functional languages, you would recurse for
     2610such a purpose.
     2612In Haskell, in order to do something with every member of an "enumeration", you
     2613would have to explicitly list them all. The type system will help a bit since
     2614it knows if you haven't listed them all, but you would have to statically have
     2615every element in the enumeration.  If somebody added new elements to the
     2616enumeration later, your code to enumerate over them would no longer work
     2617correctly, because you can't simply say "for each member of this enumeration do
     2618X". In Haskell that's because there aren't actually enumerations; what they use
     2619as enumerations are a degenerate form of algebraic datatypes, and ADTs are
     2620certainly not enumerable. In OCaml, you've demonstrated that they impose
     2621comparability, but I would still assume that you can't make a loop over every
     2622member of an enumeration. (But, who knows!)
     2624Since that's literally what "enumerate" means, it seems like a rather important
     2625property for enumerations to have ;)
     2627With valediction,
     2628  - Gregor Richards
     2631From: Andrew James Beach <>
     2632To: Gregor Richards <>, Peter Buhr <>
     2633CC: Michael Leslie Brooks <>, Fangren Yu <>,
     2634    Jiada Liang <>
     2635Subject: Re: Re:
     2636Date: Thu, 21 Mar 2024 14:26:36 +0000
     2638Does this mean that not all enum declarations in C create enumerations? If you
     2639declare an enumeration like:
     2641enum Example {
     2642    Label,
     2643    Name = 10,
     2644    Tag = 3,
     2647I don't think there is any way to enumerate (iterate, loop, recurse) over these
     2648values without listing all of them.
     2651Date: Thu, 21 Mar 2024 10:31:49 -0400
     2652Subject: Re:
     2653To: Andrew James Beach <>, Peter Buhr <>
     2654CC: Michael Leslie Brooks <>, Fangren Yu <>,
     2655    Jiada Liang <>
     2656From: Gregor Richards <>
     2658I consider this conclusion reasonable. C enums can be nothing more than const
     2659ints, and if used in that way, I personally wouldn't consider them as
     2660enumerations in any meaningful sense, particularly since the type checker
     2661essentially does nothing for you there. Then they're a way of writing consts
     2662repeatedly with some textual indicator that these definitions are related; more
     2663namespace, less enum.
     2665When somebody writes bitfield members as an enum, is that *really* an
     2666enumeration, or just a use of the syntax for enums to keep related definitions
     2669With valediction,
     2670  - Gregor Richards
Note: See TracChangeset for help on using the changeset viewer.