Re: [swift-users] Exclamation mark's in swift parameter listings?

2017-01-09 Thread Rien via swift-users
It means that a call to that function with an optional will unwrap the optional before it is used. That is quite neat when dealing with C-API’s because often you will receive a pointer from a C-function which is optional to account for the fact that it can be NULL (= nil). By using a forced unw

Re: [swift-users] Is it possible to compile swift code to dynamic library?

2017-01-09 Thread Slava Pestov via swift-users
Right now, we don’t have an ‘official’ way to expose Swift APIs to C. However there is the completely unsupported and subject to change or removal at any time @_cdecl attribute. Eg, @_cdecl(“bar_foo") public func foo(x: Int) -> Int { return x } This defines a function callable from C as: exter

Re: [swift-users] [swift-evolution] Best way to handle escaping function that might throw

2017-01-09 Thread Jacob Bandes-Storch via swift-users
Moving to swift-users list. No, there's no way to do this today. The point of rethrows is that within one call site, "f(block)" can be treated as throwing if the block throws, or not throwing if the block doesn't throw. In your example, once the FStore object is constructed, the information about

[swift-users] Is it possible to compile swift code to dynamic library?

2017-01-09 Thread Zheng Ping via swift-users
I want to compile swift code to dynamic library, and I can link this dynamic library to my C project. I don't know whether is it possible? Or whether I can do this in the future? -- with kind regards ___ swift-users mailing list swift-users@swift.org ht

Re: [swift-users] Exclamation mark's in swift parameter listings?

2017-01-09 Thread Daniel Dunbar via swift-users
It is an "implicitly unwrapped optional", or IOU. See: https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html - Daniel > On Jan 9, 2017, at 4:23 PM, Ethin Probst via swift-users > wrote: > > Hello all, > I was wondering what an

[swift-users] Exclamation mark's in swift parameter listings?

2017-01-09 Thread Ethin Probst via swift-users
Hello all, I was wondering what an exclamation mark in a swift parameter listing means. For instance, I used Elements Oxidizer Live to translate some C# code into Swift. Reviewing it, I found the following (among others): @DllImport("ScriptHookV.dll") private static __extern func scriptRegister(_ m

Re: [swift-users] CNLabeledValue var

2017-01-09 Thread Hooman Mehr via swift-users
Ouch! This is a side effect of ObjC lightweight generics being imported as Swift generics in Swift 3.0. Since there is no common superclass that satisfies NSCopying & NSSecureCoding and the fact that NSSecureCoding has static requirements means you can’t do it (at least without hacks such as e

Re: [swift-users] Importing struct from C API (FUSE) with member init

2017-01-09 Thread Jordan Rose via swift-users
Hey, Dennis. You should be able to use backticks to escape Swift keywords, including this one. However, that doesn't actually work yet, due to SR-1660 . There's been some progress towards fixing this, but it's not ready to go into a release yet. If you can

[swift-users] CNLabeledValue var

2017-01-09 Thread German Laullon via swift-users
Hi All I just upgrade to Swift 3. After open and convert my codes I found lots of errors. One of them is about CNLabeledValue. With Swift 2.3, it works well with: var toExcludeOrCopy : CNLabeledValue? With Swift 3, it gives me the error message: Reference to generic type 'CNLabeledValue' requir

[swift-users] TWISt-shout Newsletter 2017-01-09

2017-01-09 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-01-02 to 2017-01-08 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-01-09.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org https://lists.sw

[swift-users] Bls: Using Task on Linux

2017-01-09 Thread Mr Bee via swift-users
Thank you. Yes, giving the full path to the executable name indeed solve the problem. I found it a few moments after I send this question. Sorry if the question sounds a bit silly. :) Another problem from the same code above is it fails to supply data to stdin. It seems the input data doesn't ge

[swift-users] Swift Linux for Ubuntu 16.10

2017-01-09 Thread TUNG CK via swift-users
Can I use swift Linux 3.02 release ubuntu 16.04 for my ubuntu 16.10 ? The release versions only have 16.04 and 15.04 and the development snapshot for ubuntu 16.10 has some problems for me. Thanks for any info. ___ swift-users mailing list swift-users@s

Re: [swift-users] Using Task on Linux

2017-01-09 Thread Alex Blewitt via swift-users
When you run it with absolute paths for the 'swift' and 'python' executables, does it work then? Alex > On 9 Jan 2017, at 06:20, Mr Bee via swift-users wrote: > > Hi, > > I'm writing a simple editor on Linux for Swift language. I use Task (was > NSTask) to run the Swift REPL. Unfortunately,

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

2017-01-09 Thread David Hart via swift-users
I think we need a warning because it is definitely ambiguous and a common pitfall for users of an API. The only solution would be for the APIs be written so to avoid those ambiguities I think. > On 5 Jan 2017, at 08:58, Rien via swift-users wrote: > > As you know. there is no ambiguity, no war

Re: [swift-users] Bls: Bls: GCD and Process

2017-01-09 Thread Quinn "The Eskimo!" via swift-users
On 9 Jan 2017, at 05:56, Mr Bee wrote: > How to do such a trick? By calling `dispatchMain()` or one of the various functions that calls `dispatchMain()`. There’s no lower-level interface to this. Share and Enjoy -- Quinn "The Eskimo!" Appl