Ignore:
Timestamp:
Apr 13, 2017, 8:29:38 PM (5 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
1a16e9d
Parents:
c87eb50
Message:

penultimate thesis draft

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/rob_thesis/tuples.tex

    rc87eb50 r0111dc7  
    209209In the call to @f@, @x@ is implicitly flattened so that the components of @x@ are passed as the two arguments to @f@.
    210210For the call to @g@, the values @y@ and @10@ are structured into a single argument of type @[int, int]@ to match the type of the parameter of @g@.
    211 Finally, in the call to @h@, @y@ is flattened to yield an argument list of length 3, of which the first component of @x@ is passed as the first parameter of @h@, and the second component of @x@ and @y@ are structured into the second argument of type @[int, int]@.
     211Finally, in the call to @h@, @x@ is flattened to yield an argument list of length 3, of which the first component of @x@ is passed as the first parameter of @h@, and the second component of @x@ and @y@ are structured into the second argument of type @[int, int]@.
    212212The flexible structure of tuples permits a simple and expressive function-call syntax to work seamlessly with both single- and multiple-return-value functions, and with any number of arguments of arbitrarily complex structure.
    213213
     
    675675// [x, y, z] = 1.5;
    676676_tuple3_(int, double, int) _tmp_stmtexpr_ret0;
    677 ({
     677({ // GNU C statement expression
    678678  // assign LHS address temporaries
    679679  int *__massassign_L0 = &x;    // ?{}
     
    690690    int *__multassign_L2 = (int *)&_tmp_stmtexpr_ret0.2;       // ?{}
    691691
    692     // assign RHS value temporaries and perform mass assignment to L0, L1, L2
    693     int __multassign_R0 = (*__massassign_L0=(int)__massassign_R0);   // ?{}
    694     double __multassign_R1 = (*__massassign_L1=__massassign_R0);     // ?{}
    695     int __multassign_R2 = (*__massassign_L2=(int)__massassign_R0);   // ?{}
     692    // assign RHS value temporaries and mass-assign to L0, L1, L2
     693    int __multassign_R0 = (*__massassign_L0=(int)__massassign_R0); // ?{}
     694    double __multassign_R1 = (*__massassign_L1=__massassign_R0);   // ?{}
     695    int __multassign_R2 = (*__massassign_L2=(int)__massassign_R0); // ?{}
    696696
    697697    // perform construction of statement expr return variable using
     
    742742      _tmp_cp_ret0 :
    743743      (_tmp_cp_ret0=f(), _unq0_finished_=1, _tmp_cp_ret0)).1; // ?{}
    744   ({ // tuple destruction - destruct f() return temporary - tuple destruction
     744  ({ // tuple destruction - destruct f() return temporary
    745745    // assign LHS address temporaries
    746746    double *__massassign_L3 = (double *)&_tmp_cp_ret0.0;  // ?{}
     
    758758    int *__multassign_L5 = (int *)&_tmp_stmtexpr_ret0.2;       // ?{}
    759759
    760     // assign RHS value temporaries and perform multiple assignment to L0, L1, L2
     760    // assign RHS value temporaries and multiple-assign to L0, L1, L2
    761761    int __multassign_R3 = (*__multassign_L0=(int)__multassign_R0);  // ?{}
    762762    double __multassign_R4 = (*__multassign_L1=__multassign_R1);    // ?{}
Note: See TracChangeset for help on using the changeset viewer.