[Swift-devel] Re: folding/sequential-while/whatever and accessing data in files

Mihael Hategan hategan at mcs.anl.gov
Fri Sep 7 15:48:56 CDT 2007


On Fri, 2007-09-07 at 15:33 -0500, Michael Wilde wrote:
> Is the retval file being considered, or do people prefer to pull 
> variables out of files through Swift mapping directives?

The mappers were written exactly for that purpose. I'm not sure how wise
it is to add new mechanisms to achieve the same goals.

> 
> It seems to me that a general way to return multiple scalar/list values 
> of built-in data types is useful and will keep the Swift code clearer.

I fully agree. However, I don't think we should reinvent or own doings
without a good reason to do so.

> 
> - Mike
> 
> 
> Mihael Hategan wrote:
> > On Fri, 2007-09-07 at 19:08 +0000, Ben Clifford wrote:
> >> On Fri, 7 Sep 2007, Yong Zhao wrote:
> >>
> >>> Just want to make a short comment that Ian once mentioned the syntax
> >>>
> >>> int i<"myint.txt">;
> >>>
> >>> should be valid, so you don't need the weird @extractint function.
> > 
> > You do. The question is where it appears. Should we allow writing
> > mappers nicely in Swift?
> > 
> > intMapper(string fileName) {
> >   string fileName(): fileName;
> >   int get(): atoi(read(fileName));
> >   set(int value): write(fileName, itoa(value));
> > }
> > 
> > or stick to Java:
> > 
> > IntMapper extends SingleFileMapper {
> >  DSHandle getValue() {
> >    return RootNode.newInstance(Types.INT, new
> > Integer(readFile(fileName)));
> >  }
> > 
> >  void setValue(DSHandle val) {
> >    writeToFile(fileName, String.valueOf(val));
> >  }
> > }
> > 
> > or do it on the fly:
> > int i = @extractint(file)
> > 
> > Or all of them?
> > 
> > _______________________________________________
> > 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