[swift-users] Swift for Nuttx RTOS

2017-10-05 Thread Igor Mironenko via swift-users
Hello,

I am new to swift, but do believe it has a bright future. My background is
Java developer. I recently get engaged with the drone autopilot software
PX4 which is written in C++ and runs on Nuttx RTOS.

Currently the PX4 can be programmed on Mac with C++. Nuttx does support
C/C++ libraries as built in.

This may be a strange question, but I would like to understand, since both
Mac OS and Nuttx RTOS are POSIX certified would it be possible in any way
to create a program using Swift language but compile to run it on Nuttx?

Is it something that would require a special compiler to be build
specifically for Nuttx, just like there is one for Swift for Linux? In my
understanding Swift compiles to a binary code and does work with C/C++.
What am I missing here? I googled and looks like I'm the only one
interested in such work.

Please explain. Thank you.

Igor
___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Is URLSession actually working on Linux

2017-10-05 Thread Georgios Moschovitis via swift-users
I am wondering, is there an ETA for 4.0.1 ?

-g.

> On 5 Oct 2017, at 8:58 PM, Georgios Moschovitis 
>  wrote:
> 
>> There has been a reasonable amount of work put in recently, particularly 
>> with Data and URLSession. 
>> 
>> You can have a look at the list of open issues for Foundation on Linux:
>> 
>> https://bugs.swift.org/issues/?jql=status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20component%20%3D%20Foundation
>>  
>> 
>> 
>> Note that some of the issues may have been recently closed but not made it 
>> into a release.
>> 
> 
> Good to know that someone is working on those issues!
> 
> thanks,
> -g.
> 

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Is URLSession actually working on Linux

2017-10-05 Thread Georgios Moschovitis via swift-users
> There has been a reasonable amount of work put in recently, particularly with 
> Data and URLSession. 
> 
> You can have a look at the list of open issues for Foundation on Linux:
> 
> https://bugs.swift.org/issues/?jql=status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20component%20%3D%20Foundation
>  
> 
> 
> Note that some of the issues may have been recently closed but not made it 
> into a release.
> 

Good to know that someone is working on those issues!

thanks,
-g.

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Detect if a generic type is numeric

2017-10-05 Thread David Sweeris via swift-users

> On Oct 4, 2017, at 18:30, Kevin Lundberg via swift-users 
>  wrote:
> 
> Can you do something like this?
> 
> func isNumber(_ value: T) -> Bool { return true }
> 
> func isNumber(_ value: T) -> Bool { return false }
> 
> I don't recall whether or not swift will pick the right version of the 
> function here, or whether this can even compile (mac isnt open at the 
> moment), but if you can overload functions in this way then it might be much 
> nicer than checking for lots of concrete types.
> 

It’ll compile, but you’ll get the wrong answer if it’s called from another 
generic function that isn’t similarly overloaded for `T` vs `T: Numeric`. I’m 
not at my computer right now, but IIRC, this is correct:

func foo (_ value:T) -> Bool {
return isNumber(value)
}
func bar (_ value:T) -> Bool {
return isNumber(value)
}
func bar (_ value:T) -> Bool {
return isNumber(value)
}
isNumber(0) //true
isNumber(“”) //false
foo(0) //false
foo(“”) //false
bar(0) //true
bar(“”) //false

- Dave Sweeris___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users