Ignore:
Timestamp:
Aug 10, 2024, 10:27:26 AM (6 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
774c97e
Parents:
2ca7fc2 (diff), 5ca5263 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/jiada_liang_MMath/test.go

    r2ca7fc2 r6abb6dc  
    2020
    2121
    22 const ( R = 0; G = 3; B ) // implicit: 0 0 0
     22const ( R = 0; G = 3; B = 3; TT = 3 ) // implicit: 0 3 3
    2323const ( Fred = "Fred"; Mary = "Mary"; Jane = "Jane" ) // Fred Mary Jane
    2424const ( H = 0; Jack = "Jack"; J; K = 0; I ) // type change, implicit: 0 Jack Jack
    2525const ( C = iota + G; M = iota; Y )
    2626const ( Mon = iota; Tue; Wed; // 0, 1, 2
    27         Thu = 10; Fri = iota - Wed + Thu - 1; Sat; Sun = iota ) // 10, 11, 12, 13
     27        Thu = 10; Fri = iota - Wed + Thu - 1; Sat; Sun = 0 ) // 10, 11, 12, 13
    2828const ( O1 = iota + 1; _; O3; _; O5 ) // 1, 3, 5
    2929const ( V1 = iota; V2; V3 = 7; V4 = iota + 1; V5 )
     
    3434
    3535func main() {
     36        fmt.Println( "Go:")
    3637        if 3 == R {};
    3738        fmt.Println( R, G, B )
     
    4546
    4647        day := Mon;
     48        day = Sun;
     49
    4750        switch day {
    4851          case Mon, Tue, Wed, Thu, Fri:
    4952                fmt.Println( "weekday" );
    50           case Sat, Sun:
     53          case Sat:
    5154                fmt.Println( "weekend" );
    5255        }
     
    5457            fmt.Println( i )
    5558        }
     59        fmt.Println(B < TT);
     60} // main
    5661
    57         var ar[Sun] int
    58         ar[Mon] = 3
    59 } // main
     62// go build test.go
Note: See TracChangeset for help on using the changeset viewer.