[Swift-user] a tutorial problem

Michael Wilde wilde at mcs.anl.gov
Thu Oct 21 11:12:28 CDT 2010


Thanks, Dan. 

David, can you comment on the problems Dan has reported (today and a few days back) on the tutorial, as I recall that you worked on it this summer? 

Thanks, 

Mike 

----- "Daniel S. Katz" <dsk at ci.uchicago.edu> wrote: 
> Hi, 

> 
This is the first real error in the tutorial. Section 3.3 is incomplete, and doesn't make any sense. 

> 
It refers to greeting.txt from the previous section, but there is no greeting.txt in the previous section. There's a greeting procedure, but no greeting file. It seems that this might refer to hello.txt. Also, the line in the box refers to outfile, which wasn't defined. 

> 

> 
So, the text in section 3.3 should read: 

> 

> 


In the previous section, the file hello.txt is used only to store an intermediate result. We don't really care about which name is used for the file, and we can let Swift choose the name. 

To do that, omit the mapping entirely when declaring outfile: 

> 
And line in the box should read: 

> 
messagefile hellofile; 

> 

> 
For completeness, the code from the previous example could be restated with this change: 

> 

> 
type messagefile {} 

(messagefile t) greeting ( string s) { 
app { 
echo s stdout= @filename (t); 
} 
} 

(messagefile o) capitalise(messagefile i) { 
app { 
tr "[a-z]" "[A-Z]" stdin= @filename (i) stdout= @filename (o); 
} 
} 

messagefile hellofile ; 
messagefile final < "capitals.txt" >; 

hellofile = greeting( "hello from Swift" ); 
final = capitalise(hellofile); 

> 

> 
Dan 
> 

> 

> 

> 
> 

> -- 
> Daniel S. Katz 
> University of Chicago 
> (773) 834-7186 (voice) 
> (773) 834-3700 (fax) 
> d.katz at ieee.org or dsk at ci.uchicago.edu 
> http://www.ci.uchicago.edu/~dsk/ 

> 


> 
> _______________________________________________ Swift-user mailing list Swift-user at ci.uchicago.edu http://mail.ci.uchicago.edu/mailman/listinfo/swift-user 

-- 
Michael Wilde 
Computation Institute, University of Chicago 
Mathematics and Computer Science Division 
Argonne National Laboratory 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20101021/e64ce1c2/attachment.html>


More information about the Swift-user mailing list