# (c) 2021 Ashok P. Nadkarni
# See LICENSE for license terms.

namespace eval ${NS}::enum {
    proc clear {} {
        # Deletes all enumerations from the interpreter
    }
    proc define {enumname enumdefs} {
        # Defines a new enumeration.
        #  enumname - name of the enumeration
        #  enumdefs - dictionary of enumeration member names to their values.
        # Parameter declarations can reference the enumeration to indicate
        # that the corresponding symbol names are acceptible as arguments
        # and will be replaced by the corresponding value in the function call.
        # Enumeration member values must be integers.
    }
    proc delete {pattern} {
        # Deletes enumerations.
        #  pattern - pattern to match.
        # The command deletes all enumerations whose name matches the specified
        # pattern. The conditions for matching the pattern are:
        #  - the tail of the pattern must match the tail of the enumeration name
        #    using Tcl's glob pattern matching rules.
        #  - the scope component of the enumeration name must match exactly.

    }
    proc flags {enumname membernames} {
        # Defines an enumeration as bit flags
        #  enumname - name of the enumeration
        #  membernames - list of names of the enumeration members
        # For example,
        #     enum flags E {A B C}
        # would define an enumeration with `A`, `B`, `C` values being 1, 2 and 4.
    }
    proc list {pattern} {
        # Lists enumerations.
        #  pattern - pattern to match.
        # The command returns the names of all enumerations whose name matches
        # the specified pattern. The conditions for matching the pattern are:
        #  - the tail of the pattern must match the tail of the enumeration name
        #    using Tcl's glob pattern matching rules.
        #  - the scope component of the enumeration name must match exactly.
    }
    proc mask {enumname membernames} {
        # Returns an integer mask formed by bitwise OR-ing the passed
        # enumeration members
        #  enumname - name of the enumeration in the current [scope][Scopes]
        #  membernames - list of member names and integer values.
        # See also: "enum unmask"
    }
    proc members {enumname} {
        # Returns a dictionary containing the members in an enumeration.
        #  enumname - name of the enumeration whose elements are to be returned.
    }
    proc name {enumname membervalue default} {
        # Returns the symbolic name of a value in an enumeration.
        #  enumname - name of the enumeration
        #  membervalue - value of an enumeration member
        #  default - value to be returned if the member value is not found
        #
        # Synopsis: enumname membervalue ?default?
        #
        # The command will raise an error if $membervalue is not present in
        # the enumeration and no default is provided, or if $enumname is
        # itself undefined.
    }
    proc sequence {enumname membernames {start 0}} {
        # Defines an enumeration with consecutive member values
        #  enumname - name of the enumeration
        #  membernames - list of names of the enumeration members
        #  start - value of first enumeration member
        # Each element of $membernames should have one or two elements,
        # the first being the name of the member and the second, if
        # present, being its value.If the second element is not present,
        # the member is assigned a value one greater than the previous
        # value assigned. The first member is assigned value 0 if it
        # has no explicit assigned value.
        #
        # The $start parameter is present for backward compatibility
        # and indicates the first value to be assigned to the sequence.
        # For future compatibility, the two-element form for the first
        # enum member should be used instead if a starting value
        # other than the default zero is desired.
    }
    proc unmask {enumname mask} {
        # Returns a list of enumeration member names corresponding to the
        # bits set in $mask.
        # enumeration members
        #  enumname - name of the enumeration
        #  mask - Integer bit mask value
        # The last element of the returned list is $mask itself.
        # Generally, the enumeration should consist of values that do not
        # have overlapping bits set (commonly a single bit is set in each
        # member value). This is not enforced but results might not be
        # as expected if this condition is not met.
        # See also: "enum mask"
    }
    proc value {enumname membername default} {
        # Returns the value of an enumeration member
        #  enumname - name of the enumeration
        #  membername - name of the enumeration member to retrieve
        #  default - default value to be returned if the membername is not found
        #
        # Synopsis: enumname membername ?default?
        #
        # The command will raise an error if $membername is not present in
        # the enumeration and no default is provided, or if $enumname is
        # itself undefined.

    }
    namespace export *
    namespace ensemble create
}
