[Swift-devel] Re: fixed_array_mapper versus array_mapper on output

Allan Espinosa aespinosa at cs.uchicago.edu
Mon Feb 14 02:11:43 CST 2011


Making my question more concrete, how you suggest going about my workflow:

 string seis_str[];
  string peak_str[];

  foreach var,i in vars {
    seis_str[i] = @strcat(loc_sub, "/Seismogram_", site.name, "_", rup.source,
                          "_", rup.index, "_", i, ".grm");
    peak_str[i] = @strcat(loc_sub, "/PeakVals_", site.name, "_", rup.source,
                          "_", rup.index, "_", i, ".bsa");
  }

  Seismogram seis[] <array_mapper; files=seis_str>;
  PeakValue  peak[] <array_mapper; files=peak_str>;

  (seis, peak) = seispeak_agg(sub, vars, site, rup.size);


Should I hack around to force this into a fixed_array_mapper?

-Allan

2011/2/12 Allan Espinosa <aespinosa at cs.uchicago.edu>:
> Moving thread to devel for brainstorming possible solutions:
>
> 1.  implement a join() function: @join(array, ", ");
> 2.  fix array_mapper
>
> 2011/2/12 Allan Espinosa <aespinosa at cs.uchicago.edu>:
>> For an array output data structure, the two mappers behave differently
>>
>> type file;
>>
>> app(file o[])
>>    split(file i){
>>  split "-l" 1 @filename(i) "seqout.";
>> }
>>
>> /*file out[] <array_mapper; files=["seqout.aa", "seqout.ab",
>> "seqout.ac",  // Does not work
>>                                 "seqout.ad"]>;*/
>> file out[] <fixed_array_mapper; files="seqout.aa, seqout.ab,
>> seqout.ac, seqout.ad">; // Works
>>
>> file input <"seq.in">;
>> out = split(input);


-- 
Allan M. Espinosa <http://amespinosa.wordpress.com>
PhD student, Computer Science
University of Chicago <http://people.cs.uchicago.edu/~aespinosa>



More information about the Swift-devel mailing list