[swift-users] Start another program from Swift script

2018-01-04 Thread Седых Александр via swift-users
Well, for example in Python we can run another program from interpreter by   import subprocess result = subprocess.run('ruby script.rb').stdout   My question is next: Can we do something from Swift file at runtime or maybe from terminal via REPL   And can you send me resource when I can read

[swift-users] performance question

2017-12-12 Thread Седых Александр via swift-users
Hello. For example we have Class A {} Struct B {} And code 'let b = B()' will do much faster than code 'let a = A()' And therefore code 'let d = Date()' is fast, because Date is struct? And I can use it in huge cycles fearlessly? -- Alexandr

Re: [swift-users] experimental conditional conformances flag

2017-12-05 Thread Седых Александр via swift-users
Please explain, what is conditional conformances with another words? > Среда, 6 декабря 2017, 6:32 +03:00 от Matt Whiteside via swift-users > : > > Hello Swift Users, > > [This is a resend with smaller attachment]  Has anyone had luck passing the > new

[swift-users] Swift Package Manager and iOS

2017-11-15 Thread Седых Александр via swift-users
Hello. I start learn Swift Package Manager.  Is exist a simple way to generate Xcode project with file Package.swift (which download all code) for iOS template in Xcode? Something about  $ swift package init --ios template =)) -- Alex Sedikh___

[swift-users] about capture list in nested function

2017-06-14 Thread Седых Александр via swift-users
Hello For me more good use nested function instead of closure. How in this case right way to define capture list? //With Closure   class Sender {          var color = "Orange"          var writer = Receiver ()          func something() {         writer . callback = { [weak self ]

Re: [swift-users] Why inout protocol parameter in function work with strange

2017-05-27 Thread Седых Александр via swift-users
n. Car is a >type of Position, but they are not interchangeable. See below: > >> On May 26, 2017, at 00:33, Седых Александр via swift-users < >> swift-users@swift.org > wrote: >> >> protocol Position { >> var x: Double { getset } >> } >> >>

[swift-users] typealias for Generic in Generic

2017-04-04 Thread Седых Александр via swift-users
Hello. I stumbled on ambiguous behaviour of compiler. Is not allowed explicitly indicate type in Generic typealias. struct Сarriage {     let g = [ T ]() }   struct Coma {     typealias R = Сarriage < T >     let m = R ()     let d = R < String >() \\  error: cannot specialize

[swift-users] Generic and Nested Types

2017-03-23 Thread Седых Александр via swift-users
Hello. Please explain me, why we can't make Nested Types in Generic Types? -- Седых Александр___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

[swift-users] Self - requirement

2017-03-14 Thread Седых Александр via swift-users
Hello everyone! Please, tell, where I can read about "Self" requirement in protocols? Because in Book no words about it. Thanks -- Седых Александр ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

[swift-users] Why this string not work. Any and Optionals in dictionary

2017-01-23 Thread Седых Александр via swift-users
Hello. I have a simple expression with Any and is not work. Why? var dictarray: [[ String : Any ]] = [[ "kek" : nil ]]  \\ Nil is not compatible with expected dictionary value type 'Any' -- And in other hand this is work var dictarray: [[ String : Any ]] = [[:]]  \\ [[:]], dictarray

[swift-users] Capture values by Closures in different background threads.

2016-11-30 Thread Седых Александр via swift-users
Assume we have this code:   Immediately two Timer's closures captured two copy of initial values of instance Test, with internal num values is 0.   //: Playground - noun: a place where people can play   import UIKit   var str = "Hello, playground"   struct Test {     var num = 0     mutating

[swift-users] comparison Non-Optional and Optional without unwrap

2016-10-18 Thread Седых Александр via swift-users
This code work:  let one: Int ? = 5 let two = 5 let result = one == two   print ( result ) //print true Why we can access to Optional value without unwrap within comparison operations? -- Седых Александр___ swift-users mailing list