Re: [swift-users] Swift migration bug

2016-10-03 Thread Nate Birkholz via swift-users
No worries, since it was related to changing Swift syntax I thought it might end up being in some schema file maintained by the Swift team, thus the original question. :) Easy enough to add it to my list of radars. Sent from my iPhone, please excuse brevity and errors > On Oct 3, 2016, at 3:59

Re: [swift-users] Swift migration bug

2016-10-03 Thread Jordan Rose via swift-users
Ha, sorry to get to these in the wrong order. The real rule is "is the feature part of the Swift Open Source project", but certainly a normal Xcode user isn't thinking about whether the command they just used "came from Xcode" or "came from Swift". Radars will always get to Apple Swift people

[swift-users] Class Variable delayed stored

2016-10-03 Thread jason bronson via swift-users
I have this class I wrote which stores the error messages from the firebaseauth if a error occurs. The problem is that the variable on first return is not set and on second return is. variable _errorMsg is empty on first return of method registerUser Why is it not storing the variable when it's

Re: [swift-users] Performance critical code in Swift

2016-10-03 Thread Игорь Никитин via swift-users
Thanks for advices! I’m switches to C and will write data to file instead of sqlite It will give me 5x-10x performance growth for writing But it will also increase the time for reading, I think (I've not measured it) I’m also looked for some sqlite alternative, but didn’t found Realm is fast for

Re: [swift-users] UnsafeMutablePointer on the stack?

2016-10-03 Thread Joe Groff via swift-users
> On Oct 3, 2016, at 10:20 AM, Jens Alfke via swift-users > wrote: > > >> On Oct 2, 2016, at 5:14 PM, Mike Ferenduros via swift-users >> > wrote: >> >> Personally I would be surprised if the malloc caused an actual

Re: [swift-users] UnsafeMutablePointer on the stack?

2016-10-03 Thread Jens Alfke via swift-users
> On Oct 2, 2016, at 5:14 PM, Mike Ferenduros via swift-users > wrote: > > Personally I would be surprised if the malloc caused an actual measurable > performance hit tbh. It won’t be noticeable against a call to SecRandom, as noted, but there are other circumstances

Re: [swift-users] clang builtins from Swift?

2016-10-03 Thread Chris Lattner via swift-users
> On Oct 2, 2016, at 6:24 PM, Jean-Denis Muys via swift-users > wrote: > > Hi, > > Xcode seems to think that [some] builtins can be used from Swift. It > autocompletes popcount for example, and command-clicking the function opens a > bona fide interface file, with the

Re: [swift-users] Performance critical code in Swift

2016-10-03 Thread Tino Heth via swift-users
My general advice for performance critical code (especially when it's about stuff like serialization and parsing): If you just want a working solution without spending much time, stick with C. Swift can be fast, but it's harder to write slow code in C. If, on the other hand, coding time is no

Re: [swift-users] CharacterSet vs Set

2016-10-03 Thread Gerriet M. Denkmann via swift-users
> On 3 Oct 2016, at 19:17, Jean-Denis Muys via swift-users > wrote: > > You are right: I don’t know much about asian languages. > > How would you go about counting consonants, vowels (and tone-marks?) in the > most general way? Iterate over unicodeScalars (in the most

Re: [swift-users] Swift migration bug

2016-10-03 Thread Nate Birkholz via swift-users
https://bugs.swift.org/browse/SR-2837 On Mon, Oct 3, 2016 at 2:03 AM, Alex Blewitt wrote: > On 30 Sep 2016, at 19:30, Nate Birkholz via swift-users < > swift-users@swift.org> wrote: > > I found a bug in Swift 2.3 migration in the XCUITests, not sure if the bug > goes to

[swift-users] How to change the Swift REPL default prompt?

2016-10-03 Thread Rafał Kowalski via swift-users
Hi, I've been using the `swift-mode` and the Swift REPL under Emacs to program in Swift. Unfortunately, the Swift REPL doesn't expect a "dumb terminal" and issues a lot of `ESC` terminal control sequences to format its prompt nicely, e.g. `ESC [J` `ESC [1G ESC[J 1> ESC [1G 1> ESC [1G 1> ESC

Re: [swift-users] CharacterSet vs Set

2016-10-03 Thread Jean-Denis Muys via swift-users
You are right: I don’t know much about asian languages. How would you go about counting consonants, vowels (and tone-marks?) in the most general way? I think I would need to educate myself about those things. Any pointer welcome. JD > On 3 Oct 2016, at 12:52, Gerriet M. Denkmann

Re: [swift-users] CharacterSet vs Set

2016-10-03 Thread Gerriet M. Denkmann via swift-users
> On 3 Oct 2016, at 16:28, Jean-Denis Muys via swift-users > wrote: > > ASCII? Probably not. Latin? perhaps, though not obvious. For example French > accented letters would probably have to be handled somehow. Greek or > Cyrillic? Perhaps. Other scripts? Unlikely, but

Re: [swift-users] UnsafeMutablePointer on the stack?

2016-10-03 Thread Jean-Denis Muys via swift-users
Indeed, But that function was just an example. I wanted to learn about how to use the stack to call C functions that will fill some memory area passed as a pointer. Jean-Denis > On 3 Oct 2016, at 09:46, Quinn The Eskimo! via swift-users > wrote: > > > On 3 Oct

Re: [swift-users] Swift migration bug

2016-10-03 Thread Alex Blewitt via swift-users
> On 30 Sep 2016, at 19:30, Nate Birkholz via swift-users > wrote: > > I found a bug in Swift 2.3 migration in the XCUITests, not sure if the bug > goes to swift.org or to Apple. > > UI test generator uses the syntax (XCUIElement).children(matching:

Re: [swift-users] UnsafeMutablePointer on the stack?

2016-10-03 Thread Quinn "The Eskimo!" via swift-users
On 3 Oct 2016, at 01:14, Mike Ferenduros via swift-users wrote: > Personally I would be surprised if the malloc caused an actual measurable > performance hit tbh. Quite. SecRandom generates cryptographically sound random numbers and thus is not optimised for speed.

Re: [swift-users] CharacterSet vs Set

2016-10-03 Thread Quinn "The Eskimo!" via swift-users
On 2 Oct 2016, at 19:02, Jean-Denis Muys via swift-users wrote: > The problem is, I could not find a simple way to convert from a character to > a unicodeScalar. As is often the case with string examples, it would help if you posted more about your context. With the

Re: [swift-users] A sample Rational number type

2016-10-03 Thread Hooman Mehr via swift-users
> On Oct 2, 2016, at 5:23 PM, Dave Abrahams via swift-users > wrote: > Presumably you mean: > > let r2 = r±0.0005 // turn a Rational into a Double with no more than >// .0005 rounding error > > ? That is supercute! > It is actually the other way