Re: [swift-users] Localization in Swift.

2016-11-02 Thread Zhao Xin via swift-users
Hello everyone. Thanks to you all for replies in this thread. I am currently working on a Xcode Extension for this purpose. I would like to bring it to github in this week. This will be my first Xcode extension, also my first github open sourced project. Zhaoxin On Thu, Nov 3, 2016 at 6:14 AM,

Re: [swift-users] What is "binding" memory?

2016-11-02 Thread Jordan Rose via swift-users
> On Nov 2, 2016, at 15:50, Dave Abrahams via swift-users > wrote: > > > on Wed Nov 02 2016, Andrew Trick > wrote: > >>> On Nov 2, 2016, at 12:58 PM, Dave Abrahams via swift-users >>> wrote: >>> At the top of

Re: [swift-users] What is "binding" memory?

2016-11-02 Thread Andrew Trick via swift-users
> On Nov 2, 2016, at 3:50 PM, Dave Abrahams wrote: > >> The original poster seemed to have the impression that the operation >> of binding memory itself might affect program state, > > Formally speaking, it does! Oh boy. I keep failing at this. How does one formally

Re: [swift-users] What is "binding" memory?

2016-11-02 Thread Dave Abrahams via swift-users
on Wed Nov 02 2016, Andrew Trick wrote: >> On Nov 2, 2016, at 12:58 PM, Dave Abrahams via swift-users >> wrote: >> >>> At the top of the migration guide is a link to the memory model explanation: >>> >

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-11-02 Thread Chris Lattner via swift-users
On Nov 1, 2016, at 9:50 PM, Shyamal Chandra wrote: > Hi Chris, > > First of all, there is tremendous instability with Xcode Playgrounds. Hi Shyamal, The vast majority of the instability of playgrounds is a result of the compiler code which is already open source. I look

Re: [swift-users] Localization in Swift.

2016-11-02 Thread Dave Abrahams via swift-users
on Wed Nov 02 2016, Jens Alfke wrote: >> On Nov 2, 2016, at 12:50 PM, Dave Abrahams via swift-users >> wrote: >> >> In my opinion, we can and must do much better for Swift. If there's >> something about “%” formatting that you particularly value, I'd like to >> know

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Greg Parker via swift-users
> On Nov 2, 2016, at 1:08 PM, Joe Groff via swift-users > wrote: > >> On Nov 2, 2016, at 1:00 PM, Philippe Hausler > > wrote: >> >> See: >> >>

Re: [swift-users] Element vs. Iterator.Element

2016-11-02 Thread Slava Pestov via swift-users
I don’t remember the details, but IIRC ‘Iterator’ is an inferred associated type on Array, so it cannot appear in the ‘where’ clause of an extension. This is a known limitation of the name lookup code — presently it cannot recur into associated type inference due to circularity. We plan on

Re: [swift-users] wishing I could cast (sort of) to protocol with associated type

2016-11-02 Thread Jordan Rose via swift-users
The only real way to do this today is to have two layers of protocol: protocol SpecialControllerBase { var currentValueBase: SpecialValue? { get } } protocol SpecialController: SpecialControllerBase { associatedtype SpecialValueType : SpecialValue var currentValue: SpecialValueType? { get }

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Bernardo Breder via swift-users
2016-11-02 18:36 GMT-02:00 Joe Groff : > > On Nov 2, 2016, at 1:16 PM, Bernardo Breder via swift-users < > swift-users@swift.org> wrote: > > In my http server i want to manager the memory all the time that we close > a socket, like the example of manager in this link: >

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jens Alfke via swift-users
> On Nov 2, 2016, at 1:42 PM, Bernardo Breder via swift-users > wrote: > > The algorithm that i send is a example of server code and this code will > execute in a ubuntu environment. When i install in the ubuntu, the swiftc > show me that the autoreleasepool is "use of

Re: [swift-users] Localization in Swift.

2016-11-02 Thread Jens Alfke via swift-users
> On Nov 2, 2016, at 12:50 PM, Dave Abrahams via swift-users > wrote: > > In my opinion, we can and must do much better for Swift. If there's > something about “%” formatting that you particularly value, I'd like to > know about it, so I can make sure it's accomodated.

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jordan Rose via swift-users
> On Nov 2, 2016, at 13:36, Joe Groff via swift-users > wrote: > >> >> On Nov 2, 2016, at 1:16 PM, Bernardo Breder via swift-users >> > wrote: >> >> In my http server i want to manager the memory all the time that

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Joe Groff via swift-users
> On Nov 2, 2016, at 1:16 PM, Bernardo Breder via swift-users > wrote: > > In my http server i want to manager the memory all the time that we close a > socket, like the example of manager in this link: >

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Bernardo Breder via swift-users
In my http server i want to manager the memory all the time that we close a socket, like the example of manager in this link: http://stackoverflow.com/questions/25860942/is-it-necessary-to-use-autoreleasepool-in-a-swift-program Algorithm that show the ideia: *func request(content) { ... }* *let

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Joe Groff via swift-users
> On Nov 2, 2016, at 1:00 PM, Philippe Hausler wrote: > > See: > > https://github.com/apple/swift-corelibs-foundation/blob/d015466450b2675037c6f1ace8e17e73050ccfb9/Foundation/NSURL.swift#L561 > >

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jordan Rose via swift-users
I don’t know, this isn’t really a good Swift API either. Some of the other bare pointer cases we changed to return arrays instead for this reason, like String’s version of cString(using:). https://github.com/apple/swift/blob/master/stdlib/public/SDK/Foundation/NSStringAPI.swift#L413 I am

Re: [swift-users] What is "binding" memory?

2016-11-02 Thread Dave Abrahams via swift-users
on Tue Nov 01 2016, Andrew Trick wrote: >> On Nov 1, 2016, at 11:55 AM, Manfred Schubert via swift-users >> wrote: >> >> The "UnsafeRawPointer Migration" guide talks about "binding memory >> to a type“ as if that was a well known term. I have never heard of >> it yet

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Philippe Hausler via swift-users
See: https://github.com/apple/swift-corelibs-foundation/blob/d015466450b2675037c6f1ace8e17e73050ccfb9/Foundation/NSURL.swift#L561 This is far and few between of cases

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jordan Rose via swift-users
I’m confused about this. Shouldn’t you be able to get away with using +1 convention everywhere? What needs to have arbitrary lifetime-extension in an ARC-ified language? Jordan > On Nov 2, 2016, at 12:23, Philippe Hausler wrote: > > So there are issues we have in

Re: [swift-users] Localization in Swift.

2016-11-02 Thread Dave Abrahams via swift-users
on Tue Nov 01 2016, Jens Alfke wrote: >> On Nov 1, 2016, at 10:40 PM, Zhao Xin wrote: >> >> For example, if I want show the user that I have to ask him to give me >> permission of a folder, the > `url.path` has no need to translate. > > We’re getting off-topic, but paths do

[swift-users] wishing I could cast (sort of) to protocol with associated type

2016-11-02 Thread Robert Nikander via swift-users
Hi, In the following code, I want to test if x is a `SpecialController`. If it is, I want to get the `currentValue` as a `SpecialValue`. How do you do this? If not with a cast, then some other technique. I understand the error, and that SpecialController by itself is not a simple type to cast

Re: [swift-users] Localization in Swift.

2016-11-02 Thread Jens Alfke via swift-users
> On Nov 2, 2016, at 11:23 AM, Marco S Hyman via swift-users > wrote: > > On Nov 1, 2016, at 11:42 PM, Zhao Xin via swift-users > wrote: >> >> I have already give a workable implementation above. > > Your implementation assume \(x) is always

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Bernardo Breder via swift-users
I want to manager the memory, using the autoreleasepool block, with ubuntu environment, as we can do with Xcode. 2016-11-02 15:34 GMT-02:00 Joe Groff : > > On Nov 2, 2016, at 10:17 AM, Jordan Rose wrote: > > > On Nov 2, 2016, at 09:42, Joe Groff via

Re: [swift-users] What is "binding" memory?

2016-11-02 Thread Rien via swift-users
> On 02 Nov 2016, at 18:07, Manfred Schubert via swift-users > wrote: > > Am 01.11.2016 um 21:40 schrieb Andrew Trick : >> >> I’m not sure I like the “prepares the memory” language myself. Binding >> memory communicates to the compiler that the memory

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Joe Groff via swift-users
> On Nov 2, 2016, at 10:17 AM, Jordan Rose wrote: > >> >> On Nov 2, 2016, at 09:42, Joe Groff via swift-users > > wrote: >> >>> >>> On Nov 1, 2016, at 6:40 PM, Bernardo Breder via swift-users >>>

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jordan Rose via swift-users
> On Nov 2, 2016, at 09:42, Joe Groff via swift-users > wrote: > >> >> On Nov 1, 2016, at 6:40 PM, Bernardo Breder via swift-users >> wrote: >> >> Hello, >> >> I want to create a mini http server project and execute at Ubuntu 15. The >> Xcode

Re: [swift-users] What is "binding" memory?

2016-11-02 Thread Manfred Schubert via swift-users
Am 01.11.2016 um 21:40 schrieb Andrew Trick : > > I’m not sure I like the “prepares the memory” language myself. Binding memory > communicates to the compiler that the memory locations are safe for typed > access. Nothing happens at runtime--until someone writes a type safety

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Joe Groff via swift-users
> On Nov 1, 2016, at 6:40 PM, Bernardo Breder via swift-users > wrote: > > Hello, > > I want to create a mini http server project and execute at Ubuntu 15. The > Xcode compile and access the function "autoreleasepool", but when i compile > the same code at Ubuntu,

Re: [swift-users] Localization in Swift.

2016-11-02 Thread Jens Alfke via swift-users
> On Nov 1, 2016, at 10:56 PM, Zhao Xin wrote: > > I am not talking to eliminate "%" style function. I am talking to add more > compatibility to `NSLocalizedString` with `\(foo)` style. I don’t think the ExpressibleByStringInterpolation protocol provides enough information

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-11-02 Thread Jens Alfke via swift-users
> On Nov 1, 2016, at 9:50 PM, Shyamal Chandra via swift-users > wrote: > > Why don't you make the Playgrounds open source so I can investigate? I’ve been hearing people tell Apple “why don’t you make ___ open source” for as long as the term ‘open source’ has existed.