> On Aug 17, 2017, at 5:47 PM, William Jon Shipley <[email protected]> 
> wrote:
> 
> I think the comments on “prettify()” are from an earlier version of the 
> sample code? The way it’s called it doesn’t look like it’d access theList at 
> all.

The body of the function is omitted :-)

The idea of the goofy example is that it walks through theList to see if the 
existing entries are capitalized.  If so, it capitalizes the string, if not it 
returns the string unmodified.

-Chris



> 
>   actor TableModel {
>     let mainActor : TheMainActor
>     var theList : [String] = [] {
>       didSet {
>         mainActor.updateTableView(theList)
>       }
>     }
>     
>     init(mainActor: TheMainActor) { self.mainActor = mainActor }
> 
>     // this checks to see if all the entries in the list are capitalized:
>     // if so, it capitalize the string before returning it to encourage
>     // capitalization consistency in the list.
>     func prettify(_ x : String) -> String {
>       // ... details omitted, it just pokes theList directly ...
>     }
> 
>     actor func add(entry: String) {
>       theList.append(prettify(entry))
>     }
>   }
> 

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to