[Swift-user] two questions about Swift

Yi Zhu yizhu at cs.uchicago.edu
Wed Feb 3 01:05:09 CST 2010


Hi Zhao

Thanks for your reply!

The "Iterate" seems works like a conventional "while",  but it would be 
great if there  also exists a conventional "for" to be nested in foreach 
loop.

-Yi




On 2/3/2010 12:36 AM, Zhao Zhang wrote:
> Hi, Yi
>
> There is a "Iter" in swift, which could work as a while statement. I 
> am attaching an example.
> And it is also in swift documentation. 
> http://www.ci.uchicago.edu/swift/guides/tutorial.php#tutorial.iterate
>
> Best
> zhao
>
> scipiter (scipin infile, scipopts settings)
> {
> scipout ofile[] <ext; exec="mapout.sh", t=@infile>;
> scipin infilearray[] <ext; exec="mapin.sh", t=@infile>;
> scipopts f <single_file_mapper;file="template">;
> //infilearray[0]=infile;
> iterate i {
>     ofile[i]=scip(infilearray[i], settings);
>     infilearray[i+1]=parser(ofile[i], f);
> }until(i==9);
> }
>
>
> Yi Zhu wrote:
>> Hi all
>>
>> I have two questions about swift:
>>
>> 1. conventional loop:  In swift, we can use foreach to parallel apps, 
>> but what If I just need a conventional loop, like a regular "for" or 
>> "while" in java?
>>
>> 2.  In Matlab, there are some library which support some Math 
>> functions like "sin" "cos" "reshape" etc. Is there any similar 
>> library available for swift. If not, is there anyway to import 
>> external library? (e.g. from Java)
>>
>> Many Thanks.
>>
>>
>> -Yi
>>
>>
>> _______________________________________________
>> 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