Changeset c40a982


Ignore:
Timestamp:
Jul 2, 2024, 2:33:25 PM (2 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
bc48c0d
Parents:
7f8c232
Message:

change enumeration posE to posn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/jiada_liang_MMath/test1.cfa

    r7f8c232 rc40a982  
    3434enum() Mode { O_RDONLY, O_WRONLY, O_CREAT, O_TRUNC, O_APPEND };
    3535Mode iomode = O_RDONLY;
    36 bool b = iomode == O_RDONLY || iomode < O_APPEND;
    37 int www = iomode;
     36//bool b = iomode == O_RDONLY || iomode < O_APPEND;     // disallowed
     37//int www = iomode;     // disallowed
    3838
    3939enum( char * ) Colour { Red = "red", Green = "green", Blue = "blue"  };
     
    4545//greek = A;                                                            // disallowed
    4646
    47         for ( Greek l = Alph; posE(l) <= posE(Gamma); l = succ( l ) ) {
    48                 printf( "%s %c %d\n", labelE( l ), valueE( l ), posE( l ) );
     47        for ( Greek l = Alph; posn(l) <= posn(Gamma); l = succ( l ) ) {
     48                printf( "%s %c %d\n", label( l ), value( l ), posn( l ) );
    4949        }
    50         for ( Currency c = Dollar; posE(c) <= posE(Currency.Euro); c = succ( c ) ) {
    51                 printf( "%s %c %d\n", labelE( c ), valueE( c ), posE( c ) );
     50        for ( Currency c = Dollar; posn(c) <= posn(Currency.Euro); c = succ( c ) ) {
     51                printf( "%s %c %d\n", label( c ), value( c ), posn( c ) );
    5252        }
    5353}
     
    5858enum( char * ) Names3 { inline Names2, Sue = "SUE", Tom = "TOM" };
    5959
    60 void f( Names n ) { sout | "Name" | posE( n ); }
     60void f( Names n ) { sout | "Name" | posn( n ); }
    6161void g( Names2 );
    6262void h( Names3 );
     
    8484//      f( name );
    8585
    86         int jane_pos = posE( Names.Jane );
    87         char * jane_value = valueE( Names.Jane );
    88         char * jane_label = labelE( Names.Jane );
    89         sout | Names.Jane | posE( Names.Jane) | labelE( Names.Jane ) | valueE( Names.Jane );
     86        int jane_pos = posn( Names.Jane );
     87        char * jane_value = value( Names.Jane );
     88        char * jane_label = label( Names.Jane );
     89        sout | Names.Jane | posn( Names.Jane) | label( Names.Jane ) | value( Names.Jane );
    9090}
Note: See TracChangeset for help on using the changeset viewer.