Changeset 0111dc7 for doc/rob_thesis/tuples.tex
- Timestamp:
- Apr 13, 2017, 8:29:38 PM (6 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 1a16e9d
- Parents:
- c87eb50
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/rob_thesis/tuples.tex
rc87eb50 r0111dc7 209 209 In the call to @f@, @x@ is implicitly flattened so that the components of @x@ are passed as the two arguments to @f@. 210 210 For 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]@.211 Finally, 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]@. 212 212 The 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. 213 213 … … 675 675 // [x, y, z] = 1.5; 676 676 _tuple3_(int, double, int) _tmp_stmtexpr_ret0; 677 ({ 677 ({ // GNU C statement expression 678 678 // assign LHS address temporaries 679 679 int *__massassign_L0 = &x; // ?{} … … 690 690 int *__multassign_L2 = (int *)&_tmp_stmtexpr_ret0.2; // ?{} 691 691 692 // assign RHS value temporaries and perform mass assignmentto L0, L1, L2693 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); // ?{} 696 696 697 697 // perform construction of statement expr return variable using … … 742 742 _tmp_cp_ret0 : 743 743 (_tmp_cp_ret0=f(), _unq0_finished_=1, _tmp_cp_ret0)).1; // ?{} 744 ({ // tuple destruction - destruct f() return temporary - tuple destruction744 ({ // tuple destruction - destruct f() return temporary 745 745 // assign LHS address temporaries 746 746 double *__massassign_L3 = (double *)&_tmp_cp_ret0.0; // ?{} … … 758 758 int *__multassign_L5 = (int *)&_tmp_stmtexpr_ret0.2; // ?{} 759 759 760 // assign RHS value temporaries and perform multiple assignmentto L0, L1, L2760 // assign RHS value temporaries and multiple-assign to L0, L1, L2 761 761 int __multassign_R3 = (*__multassign_L0=(int)__multassign_R0); // ?{} 762 762 double __multassign_R4 = (*__multassign_L1=__multassign_R1); // ?{}
Note: See TracChangeset
for help on using the changeset viewer.