[Swift-user] Writing to an output file

Mihael Hategan hategan at mcs.anl.gov
Thu Jun 4 16:34:56 CDT 2009


For most practical purposes, there are no side-effects in swift. "int x
= 0" means "For convenience, and for the current lexical scope, x will
be 0". It's the common (though reversed) "statement, where x = 0" from
math, except there is no "statement" in your case.

Outside of "initialCondition" it doesn't mean anything. I'm not sure
what exactly the compiler is complaining about, but what you wrote
doesn't mean much.

That plus what Mike said in his reply to this message.

May I suggest expressing in simple words what you are trying to achieve?
>From that, it's easier to both translate to swift and for us to help
with that.

Mihael

On Thu, 2009-06-04 at 12:36 -0500, Hodgess, Erin wrote:
> Here is what SHOULD be a simple process.  I'm writing to an array, and
> sending that to an output file.  Here are the files and the results:
> 
> [erin at tp-login2 swift1]$ cat iter2.swift
> type file; 
>  
> app initialCondition() { 
>         int x = 10;
> } 
> 
>      int step[0]=initialCondition();
> 
> file o <"output.txt">; 
> 
>         o=step[0];
> [erin at tp-login2 swift1]$ swift -tc.file tc.data iter2.swift
> Could not compile SwiftScript source: line 4:13: unexpected token: x
> [erin at tp-login2 swift1]$
> 
> The file is in /home/erin/swift1/iter2.swift.
> 
> Thanks,
> Erin
> 
> 
> 
> Erin M. Hodgess, PhD
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: hodgesse at uhd.edu
> 
> 
> 
> _______________________________________________
> Swift-user mailing list
> Swift-user at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-user




More information about the Swift-user mailing list