#include "enum.hfa" #include "fstream.hfa" forall(E, T| TypedEnum(E, T)) { // constructors // comparison int ?==?(E l, E r) { return posE(l) == posE(r); } int ?!=?(E l, E r) { return !(l == r); } int ?!=?(E l, zero_t) { return !( posE(l) == 0 ); } int ??(E l, E r) { return posE(l) > posE(r); } int ?>=?(E l, E r) { return posE(l) >= posE(r); } // for testing; To be removed // #include char * typeEnumString(E e) { // char* out = malloc(sizeof(char) * (5 + strlen(labelE(e) + 1))); // return strcat(strcat(out, "Enum "), labelE(e)); return labelE(e); } }