1.14. Records: anonymous structs

A record is an anonymous struct: its a tuple with named fields. Two records are the same type if their field names are the same, and have the same types. The order of fields is irrelevant.

A record can be coerced to a record with less fields.

Start felix section to tut/examples/tut_beg115a.flx[1 /1 ]
     1: #line 597 "./lpsrc/flx_tutorial.pak"
     2: #import <flx.flxh>
     3: open Float;
     4: 
     5: typedef big = struct { a:int; b: long; c: float; };
     6: typedef small = struct { a: int; c:float; };
     7: 
     8: proc f(x:small) {
     9:   print$ x.a; endl;
    10:   print$ x.c; endl;
    11: }
    12: 
    13: val b = struct { b=2L; c=3.1f; a=6; };
    14: 
    15: f (b:small);
    16: 
End felix section to tut/examples/tut_beg115a.flx[1]