[swift-users] Why do collections use the debugDescription on their elements?

2017-01-05 Thread Martin R via swift-users
I wonder why the description method of collections use the debugDescription method to print their elements, and not the description method. Example: let s = "a\"b" print(s) // a"b print(s.debugDescription) // "a\"b" let x = 1.1 print(x) // 1.1 print(x.debugDescription)

Re: [swift-users] Debugging XCTests on Linux

2017-01-05 Thread Ankit Agarwal via swift-users
Using swift module in REPL: Toolchain: January 4, 2017 Platform: Ubuntu 16.04 Add this at end of Package.swift: ``` products += [Product(name: "Result", type: .Library(.Dynamic), modules: "Result")] ``` $ swift build $ swift -I .build/debug -L .build/debug -lResult -I

Re: [swift-users] make a static/class method return type be the subclass it is called with

2017-01-05 Thread Pierre Monod-Broca via swift-users
Hello, It looks that you have what you wanted because Event.Entity is an alias of Event. Pierre > Le 5 janv. 2017 à 16:47, Dave Reed via swift-users a > écrit : > > Is there a way to make a static or class method specify the return type be > the actual class it is

Re: [swift-users] Difficulties extending BinaryFloatingPoint

2017-01-05 Thread Jens Persson via swift-users
Great, thank you Steve! On Thu, Jan 5, 2017 at 5:04 PM, Steve (Numerics) Canon wrote: > Hi Jens — > > BinaryFloatingPoint is very deliberately limited to the arithmetic > operations required by IEEE 754. This is the minimal set of operations that > a binary floating point

Re: [swift-users] question about swift and c callbacks

2017-01-05 Thread Ankit Agarwal via swift-users
I simplified your example package and posted a bug report here: https://bugs.swift.org/browse/SR-3556 On Thu, Jan 5, 2017 at 9:59 PM, Yang Yang via swift-users < swift-users@swift.org> wrote: > sorry, i made mistake on compiling. It still report the same link error. > > Yang > > On Wed, Jan 4,

Re: [swift-users] Compiler should issue a warning when a subclass implementation with default values matches a parent implementation without them

2017-01-05 Thread Kenny Leung via swift-users
Hi All. I think this is a case of ambiguity that the compiler is not catching at the call site. Consider this example: private class DefaultValues { // If this method exists, it compiles and it called. // If this method does not exist, the code in the test says, "Ambiguous use of

[swift-users] Debugging XCTests on Linux

2017-01-05 Thread Robert Atkins via swift-users
Hi all, I'm trying to solve a simple (?) problem where a test suite runs fine on macOS but fails on Linux (https://github.com/antitypical/Result/pull/210#pullrequestreview-14963305). I've downloaded and installed the Swift Linux Docker image (https://ashfurrow.com/blog/swift-on-linux/) and got

Re: [swift-users] Compiler should issue a warning when a subclass implementation with default values matches a parent implementation without them

2017-01-05 Thread Wagner Truppel via swift-users
Exactly. I would only add that renaming might not be the correct solution in some cases as, then, instances of the subclass would still be able to invoke the superclass method and that might not always be acceptable. Wagner > On 5 Jan 2017, at 11:09, Frank O'Dwyer

Re: [swift-users] Compiler should issue a warning when a subclass implementation with default values matches a parent implementation without them

2017-01-05 Thread Frank O'Dwyer via swift-users
I think there is a clear case for a warning here, in that the introduction of a default parameter value in such cases is in effect an empty promise and just introduces unreachable code. Indeed 'unreachable code' should perhaps be the warning. This is because as soon as there is a foo() method,

[swift-users] Difficulties extending BinaryFloatingPoint

2017-01-05 Thread Jens Persson via swift-users
The code below doesn't compile since there is no exponential function (exp) that works on all FloatingPoint or BinaryFloatingPoint types, also no protocol seems to define the power function or the constant e, although they do define for example: basic arithmetic operators, squareRoot() and pi.

Re: [swift-users] question about swift and c callbacks

2017-01-05 Thread Yang Yang via swift-users
sorry, i made mistake on compiling. It still report the same link error. Yang On Wed, Jan 4, 2017 at 11:20 PM Yang Yang wrote: > Thanks. > It compiled successfully now under linux. > > > 2017-01-04 12:29 GMT-06:00 Joe Groff : > > > > > > On Dec 30, 2016,

[swift-users] GCD and Process

2017-01-05 Thread Mr Bee via swift-users
Hi all, I'm currently still learning Swift 3. Now I'm playing around with GCD (grand central dispatch). I'd like to start an external process using Process from an asynced thread, and create another thread to stop that external process after some times. Here's what I do… import Foundationimport

[swift-users] Bls: GCD and Process

2017-01-05 Thread Mr Bee via swift-users
How to make my app alive to make the second queue finish its job? What I want is: - start program- start an external process from a thread (asynchronously)- start another thread after 5 seconds to terminate the process from the other thread- end program That's all.  –Mr Bee Pada Jumat, 6

Re: [swift-users] getResourceValue

2017-01-05 Thread Rien via swift-users
What is your real question? Obviously the doc says that this is fine, so what are you asking? what is your problem? Regards, Rien Site: http://balancingrock.nl Blog: http://swiftrien.blogspot.com Github: http://github.com/Swiftrien Project: http://swiftfire.nl > On 05 Jan 2017, at 20:36,

Re: [swift-users] Why do collections use the debugDescription on their elements?

2017-01-05 Thread Ole Begemann via swift-users
I wonder why the description method of collections use the debugDescription method to print their elements, and not the description method. Dmitri Gribenko gave this reason in December 2015 [1]: Array's description shouldn't be presented to the user in raw form, ever, so the use case here is