[Swift-devel] Wishlist: array elements assignment

Yong Zhao yongzh at cs.uchicago.edu
Fri Mar 16 13:55:10 CDT 2007


That is the way to do it right now.

On Fri, 16 Mar 2007, Mihael Hategan wrote:

> On Fri, 2007-03-16 at 13:17 -0500, Yong Zhao wrote:
> > Yeah, I actually thought about making the regexp_mapper to deal with an
> > array of items.
>
> What would be the result of the following:
> any a[];
> foreach... {
>   x <...>;
>   x = ...;
>   a[i] = x;
> }
>
> ?
>
> >
> > Yong.
> >
> > On Fri, 16 Mar 2007, Tiberiu Stef-Praun wrote:
> >
> > > -------- excerpts from the code ----
> > > (file out) solver (file in){
> > >     app{
> > >         solve @filename(in) stdout=filename(out)
> > >     }
> > > }
> > >
> > >
> > > (file solutions[]) problemset (file inputfiles[]){
> > >         // _input_ is the file item, _i_ is its index
> > >         foreach file input,i in inputfiles {
> > >                 //FIXME: this one is an alternative that it would be
> > > nice, because I could build the output filenames from input file names
> > > on the fly
> > >                 file
> > > solutions[i]<regexp_mapper;source=@input,match=(.*),transform="\1.out">;
> > >                 solutions[i]=solver(input);
> > >         }
> > > }
> > >
> > > file problems[]<filesys_mapper; prefix="X", suffix="*.gz">;
> > >
> > > //FIXME: alternative option for output file naming: declare them with
> > > a regexp-like mapper from the input files:
> > > file solutions[]<regexp_mapper;
> > > source=@filenames(problems),match=(.*), transform="\1,out">
> > >
> > > solutions=problemset(problems);
> > >
> > > -------------------------
> > >
> > > I'm open for alternatives
> > > I have N input files that I have to process, and generate N output files.
> > > I have complete control over the naming of the physical input and output files
> > > Currently, I was trying to do file  X.gz generates file X.gz.out
> > > (hence the regexp mapper, as a means of doing string concatenation).
> > >
> > > See the FIXME comments for my thoughts
> > >
> > > --
> > > Tiberiu (Tibi) Stef-Praun, PhD
> > > Research Staff, Computation Institute
> > > 5640 S. Ellis Ave, #405
> > > University of Chicago
> > > http://www-unix.mcs.anl.gov/~tiberius/
> > > _______________________________________________
> > > Swift-devel mailing list
> > > Swift-devel at ci.uchicago.edu
> > > http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> > >
> > _______________________________________________
> > Swift-devel mailing list
> > Swift-devel at ci.uchicago.edu
> > http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> >
>
>



More information about the Swift-devel mailing list