<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'>Thanks, Dan.<br><br>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?<br><br>Thanks,<br><br>Mike<br><br>----- "Daniel S. Katz" <dsk@ci.uchicago.edu> wrote:
<br>> Hi,<div><br>> </div><div>This is the first real error in the tutorial. Section 3.3 is incomplete, and doesn't make any sense.</div><div><br>> </div><div>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.</div><div><br>> </div><div><br>> </div><div>So, the text in section 3.3 should read:</div><div><br>> </div><div><br>> </div><div><span class="Apple-style-span" style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 10px;"><p style="margin: 0px 0px 8px; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px; line-height: 17px; color: rgb(51, 51, 51); padding: 5px 30px 0px;">In the previous section, the file <code class="filename">hello.txt</code> 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.</p><p style="margin: 0px 0px 8px; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px; line-height: 17px; color: rgb(51, 51, 51); padding: 5px 30px 0px;">To do that, omit the mapping entirely when declaring outfile:</p></span></div><div><br>> </div><div>And line in the box should read:</div><div><br>> </div><div><span class="Apple-style-span" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(51, 51, 51); font-size: 12px; line-height: 17px;">messagefile hellofile; </span></div><div><br>> </div><div><br>> </div><div>For completeness, the code from the previous example could be restated with this change:</div><div><br>> </div><div><br>> </div><div><span class="Apple-style-span" style="font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(51, 51, 51); font-size: 12px; line-height: 17px;"><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"><span class="keyword" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(32, 32, 128); font-weight: bold;">type</span><span style="font-family: Consolas,'Andale Mono',monospaced;"> messagefile {} <br style="font-family: Consolas,'Andale Mono',monospaced;"></span></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"> <br style="font-family: Consolas,'Andale Mono',monospaced;"></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;">(messagefile t) greeting (<span class="keyword" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(32, 32, 128); font-weight: bold;">string</span><span style="font-family: Consolas,'Andale Mono',monospaced;"> s) { <br style="font-family: Consolas,'Andale Mono',monospaced;"></span></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"> <span class="keyword" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(32, 32, 128); font-weight: bold;">app</span><span style="font-family: Consolas,'Andale Mono',monospaced;"> { <br style="font-family: Consolas,'Andale Mono',monospaced;"></span></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"> echo s stdout=<span class="function" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(128, 0, 64);">@filename</span><span style="font-family: Consolas,'Andale Mono',monospaced;">(t); <br style="font-family: Consolas,'Andale Mono',monospaced;"></span></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"> } <br style="font-family: Consolas,'Andale Mono',monospaced;"></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;">} <br style="font-family: Consolas,'Andale Mono',monospaced;"></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"> <br style="font-family: Consolas,'Andale Mono',monospaced;"></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;">(messagefile o) capitalise(messagefile i) { <br style="font-family: Consolas,'Andale Mono',monospaced;"></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"> <span class="keyword" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(32, 32, 128); font-weight: bold;">app</span><span style="font-family: Consolas,'Andale Mono',monospaced;"> { <br style="font-family: Consolas,'Andale Mono',monospaced;"></span></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"> tr <span class="string" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(32, 144, 32);">"[a-z]"</span><span style="font-family: Consolas,'Andale Mono',monospaced;"> </span><span class="string" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(32, 144, 32);">"[A-Z]"</span><span style="font-family: Consolas,'Andale Mono',monospaced;"> stdin=</span><span class="function" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(128, 0, 64);">@filename</span><span style="font-family: Consolas,'Andale Mono',monospaced;">(i) stdout=</span><span class="function" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(128, 0, 64);">@filename</span><span style="font-family: Consolas,'Andale Mono',monospaced;">(o); <br style="font-family: Consolas,'Andale Mono',monospaced;"></span></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"> } <br style="font-family: Consolas,'Andale Mono',monospaced;"></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;">} <br style="font-family: Consolas,'Andale Mono',monospaced;"></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"> <br style="font-family: Consolas,'Andale Mono',monospaced;"></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;">messagefile hellofile<span style="font-family: Consolas,'Andale Mono',monospaced;">; <br style="font-family: Consolas,'Andale Mono',monospaced;"></span></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;">messagefile final <<span class="string" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(32, 144, 32);">"capitals.txt"</span><span style="font-family: Consolas,'Andale Mono',monospaced;">>; <br style="font-family: Consolas,'Andale Mono',monospaced;"></span></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;"> <br style="font-family: Consolas,'Andale Mono',monospaced;"></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;">hellofile = greeting(<span class="string" style="font-family: Consolas,'Andale Mono',monospaced; color: rgb(32, 144, 32);">"hello from Swift"</span><span style="font-family: Consolas,'Andale Mono',monospaced;">); <br style="font-family: Consolas,'Andale Mono',monospaced;"></span></span><span class="codeline" style="font-family: Consolas,'Andale Mono',monospaced;">final = capitalise(hellofile); </span></span></div><div><br>> </div><div><br>> </div><div>Dan<br>> <div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 9px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 9px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><div style="word-wrap: break-word;">> <div><span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: 10px;"><div style="word-wrap: break-word;">> <div><div style="word-wrap: break-word;">> <span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><div style="word-wrap: break-word;">> <div><div style="margin: 0px; font: 12px Helvetica;">> <font class="Apple-style-span" face="Courier">-- </font></div><div style="margin: 0px; font: 12px Helvetica;">> <font class="Apple-style-span" face="Courier">Daniel S. Katz</font></div><div style="margin: 0px; font: 12px Helvetica;">> <font class="Apple-style-span" face="Courier">University of Chicago</font></div><div style="margin: 0px; font: 12px Helvetica;">> <font class="Apple-style-span" face="Courier">(773) 834-7186 (voice)</font></div><div style="margin: 0px; font: 12px Helvetica;">> <font class="Apple-style-span" face="Courier">(773) 834-3700 (fax)</font></div><div style="margin: 0px; font: 12px Helvetica;">> <font class="Apple-style-span" face="Courier"><a href="mailto:d.katz@ieee.org" target="_blank">d.katz@ieee.org</a> or <a href="mailto:dsk@ci.uchicago.edu" target="_blank">dsk@ci.uchicago.edu</a></font></div><div style="margin: 0px; font: 12px Helvetica; min-height: 14px;">> <span class="Apple-style-span" style="font-family: Courier;"><a href="http://www.ci.uchicago.edu/%7Edsk/" target="_blank">http://www.ci.uchicago.edu/~dsk/</a></span></div><div><font class="Apple-style-span" face="Courier"><br>> </font></div></div></div></span></div></div></div></span></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br>> </div><br>> _______________________________________________
Swift-user mailing list
Swift-user@ci.uchicago.edu
http://mail.ci.uchicago.edu/mailman/listinfo/swift-user<br><br>-- <br>Michael Wilde<br>Computation Institute, University of Chicago<br>Mathematics and Computer Science Division<br>Argonne National Laboratory<br><br></div></body></html>