[Swift-devel] how to increment int?

Mihael Hategan hategan at mcs.anl.gov
Tue Dec 18 00:22:48 CST 2007


You cannot increment things in Swift. It's a data-flow like language.
Variables are "virtual" nodes in a dependency graph. A variable
depending on itself (i.e. x = f(x)) has no well-defined meaning, at
least as far as the current model goes.

But you can probably construct an array and iterate over it:

int job_numbers[] = [10000001:10000998];

foreach job_number in job_numbers {
  ...
}

Mihael

On Mon, 2007-12-17 at 21:15 -0800, Mike Kubal wrote:
> In the swift code loop below I need to increment the
> start_job variable by 1, however I get the error that
> start_job is already assigned, how should I do it? 
> 
> thanks Mike Kubal 
> 
> 
> int start_job = 10000001;
> 
> while( start_job < 10000998){
>         string job_number = start_job;
>         file score_file
> <single_file_mapper;file=@strcat 
> (job_number,"_chemgauss3_scores.txt")>;
>         file docked_file
> <single_file_mapper;file=@strcat(job_number,"_chemgauss3_docked.mol2")>;
>         (score_file,docked_file) =
> run_fred(job_number);
>         start_job = start_job + 1;
> }
> 
> 
> 
>       ____________________________________________________________________________________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
> 
> _______________________________________________
> 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