[Swift-devel] [Bug 307] array slicing

bugzilla-daemon at mcs.anl.gov bugzilla-daemon at mcs.anl.gov
Sat Apr 2 17:15:33 CDT 2011


https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=307


Allan Espinosa <aespinosa at cs.uchicago.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |swift-devel at ci.uchicago.edu
         Resolution|                            |WORKSFORME




--- Comment #1 from Allan Espinosa <aespinosa at cs.uchicago.edu>  2011-04-02 17:15:33 ---
Proposed workaround: Use sparse arrays:

Example usecase: we want to send 2 elements to each agg_job();

type file;

app agg_job(file in[]) {
  echo @filenames(in);
}

file foo[] <fixed_array_mapper; files="1, 2, 3, 4">;

file sub1[] ; // elements [0:1]
file sub2[] ; // elements [2:3]

foreach i in [0:1]{
   sub1[i] = foo[i];
}

foreach i in [2:3]{
   sub2[i] = foo[i];
}

agg_job(sub1);
agg_job(sub2)

-- 
Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are watching the assignee of the bug.



More information about the Swift-devel mailing list