[Swift-user] Re: a third tutorial question

Daniel S. Katz dsk at ci.uchicago.edu
Thu Oct 14 12:18:18 CDT 2010


But both seem to work...

Which is the favored choice, and why? The example in first.swift seems shorter and cleaner...

Dan


On Oct 14, 2010, at 12:15 PM, Allan Espinosa wrote:

> This was a change in the API around a year or two ago.   Clearly the
> documentation needs an update.
> 
> -Allan
> 
> 2010/10/14 Daniel S. Katz <dsk at ci.uchicago.edu>:
>> One more Swift thing I don't understand...
>> Dan
>> 
>> 
>> Begin forwarded message:
>> 
>> From: "Daniel S. Katz" <dsk at ci.uchicago.edu>
>> Date: October 14, 2010 10:45:24 AM CDT
>> To: swift-user at ci.uchicago.edu
>> Subject: a third tutorial question
>> 
>> In http://www.ci.uchicago.edu/swift/guides/tutorial.php in first.swift, the
>> procedure is defined as:
>> 
>> app (messagefile t) greeting () {
>>         echo "Hello, world!" stdout=@filename(t);
>> }
>> 
>> 
>> in parameter.swift, the new procedure is defined as:
>> 
>> (messagefile t) greeting (string s) {
>>     app {
>>         echo s stdout=@filename(t);
>>     }
>> }
>> 
>> I don't understand why the style of defining the procedure has changed, or
>> what this change implies.
>> I would have just started with the first.swift procedure, and changed it to:
>> 
>> app (messagefile t) greeting (string s) {
>>         echo s stdout=@filename(t);
>> }
>> 
>> 
>> In fact, I did try this, and the code works fine, so I fail to understand
>> the reason for the larger change that is in the tutorial.
>> 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/
>> 
>> 
>> 
>> 
>> --
>> 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/
>> 
>> 
>> 
>> 
> 
> 
> 
> -- 
> Allan M. Espinosa <http://amespinosa.wordpress.com>
> PhD student, Computer Science
> University of Chicago <http://people.cs.uchicago.edu/~aespinosa>

-- 
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/







More information about the Swift-user mailing list