long double math.h functions appear to not be exported in swift. I don’t know
why.
This horrible hack works:
// in f80.h
extern void sqrt_f80( void *result, const void *v );
extern void pow_f80( void *result, const void *v, const void *e );
...
// in f80.c
void sqrt_f80( void *result, const voi
Tuple is not designed to be used as commonly as classes and structs.
NOTE
> Tuples are useful for temporary groups of related values. They are not
> suited to the creation of complex data structures. If your data structure
> is likely to persist beyond a temporary scope, model it as a class or
> s
Yesterday, it was pointed out that a variable name referring to a tuple
cannot be used as a pattern. I have noticed another sort of inconsistency
in how tuples are treated when they are referenced by name:
func f() -> Int { return 5 }
let t = ("a", f)
let _: (String, () throws -> Int) = t // t
> On Jul 5, 2016, at 11:39 AM, Adriano Ferreira via swift-users
> wrote:
>
> Do you think this should be filed as a bug or just wait until the Swift team
> removes the old stride method?
The old method is probably a stub that tells the fix-its how to find the new
one, so it's there to stay. F
According to you description, you should use
weak var parent:A!
Zhaoxin
On Mon, Jul 4, 2016 at 2:29 PM, Karl via swift-users
wrote:
> Currently it’s not possible to have an unowned optional value. E.g:
>
> class A {
> unowned var parent : A? // ‘unowned’ may only be applied to
>
SR-1993.
> On Jul 5, 2016, at 4:15 PM, Jordan Rose wrote:
>
> I'd definitely consider that a bug. Can you file it at bugs.swift.org?
>
> Jordan
>
>> On Jul 4, 2016, at 14:56, Neil Faiman via swift-users
>> wrote:
>>
>> (Resending — this didn’t get any responses when I sent it a month ago.)
On Tue, Jul 5, 2016 at 3:40 PM, Vinicius Vendramini via swift-users
wrote:
> Hi all!
>
> Used to be in Swift 2.x I only had to compare an unsafe pointer (obtained
> from a C API) to nil to know whether or not it was NULL. After conversion to
> Swift 3, it seems that isn’t allowed anymore.
>
> I
Hi all!
Used to be in Swift 2.x I only had to compare an unsafe pointer (obtained from
a C API) to nil to know whether or not it was NULL. After conversion to Swift
3, it seems that isn’t allowed anymore.
I remember watching something about it in WWDC but I can’t remember (or find)
the solutio
I'd definitely consider that a bug. Can you file it at bugs.swift.org?
Jordan
> On Jul 4, 2016, at 14:56, Neil Faiman via swift-users
> wrote:
>
> (Resending — this didn’t get any responses when I sent it a month ago.)
>
> Swift 2.2 in Xcode 7.3.1.
>
> Apparently you cannot use a named tuple
This is a known bug. The definition of 'stride' inside 'Int' for migration from
Swift 2 causes the compiler to fail to find the global function.
https://bugs.swift.org/browse/SR-1798
-Joe
> On Jul 4, 2016, at 8:41 PM, Adriano Ferreira via swift-users
> wrote:
>
> Hi everyone!
>
> I’m conver
So, restating the question:
You want to have a method on a class such that it will return an object which
is genericised with that class. Like:
class A {
func createB() -> B {
}
}
So that if you have C which is a subclass of A, calling createB() would return
B, and not B
Is that corre
Thanks Martin, now it works!
Do you think this should be filed as a bug or just wait until the Swift team
removes the old stride method?
Best,
— A
> On Jul 5, 2016, at 1:25 PM, Martin R via swift-users
> wrote:
>
> It seems that the extension method
>
>extension Strideable {
>p
Hello all,
I’m using Xcode 8.0 and Swift 3 on OS X 10.11, and I’m trying to use
powl in an OS X Playground. I see the definition of the pow-related functions
in math.h here:
extern float powf(float, float);
extern double pow(double, double);
extern long double powl(long double, long dou
It seems that the extension method
extension Strideable {
public func stride(to end: Self, by stride: Self.Stride) ->
StrideTo
}
from Swift 2.2 is still known to the compiler and only marked as unavailable in
Swift 3, as this code example demonstrates:
extension Int {
Any suggestions on how to work around it or to fix it?
Thanks in advance!
— A
> On Jul 5, 2016, at 12:00 PM, Zhao Xin wrote:
>
> You are right. Int conforms to Strideable.
>
> Now it seams like a bug. As in a playground. below are code works and doesn't
> work
>
> extension Int {
> fu
Longstanding bug, rdar://problem/17277899 .
Surprisingly few people have asked for it.
Jordan
> On Jul 3, 2016, at 23:29, Karl via swift-users wrote:
>
> Currently it’s not possible to have an unowned optional value. E.g:
>
> class A {
> unowned var parent : A? // ‘unowned’ may onl
You are right. Int conforms to Strideable.
Now it seams like a bug. As in a playground. below are code works and
doesn't work
extension Int {
func test() {
let temp = stride(from:1, to:10, by:2) // error
}
}
extension Float {
func test() {
let temp = stride(fro
I have a generic class that I would like to use. I¹ll include the whole
source.
public final class EventRegistration {
private(set) var event: E?
private var token: AnyObject?
public init() {}
public init(event: AppEvent, token: AnyObject) {
self.e
Int conforms to Strideable byway of Integer <- SignedInteger <- Int (not
exactly sure how it will be once the integer proposal is implemented but it
will still be strideable).
-Shawn
On Mon, Jul 4, 2016 at 10:38 PM Zhao Xin via swift-users <
swift-users@swift.org> wrote:
> In Swift 3,
>
> func st
I downloaded and installed Swift 3.0 Preview 1 on Ubuntu 14.04, following the
instructions in https://swift.org/download/#releases.
For some reason, all files in the
swift-3.0-PREVIEW-1-ubuntu14.04/usr/lib/swift/CoreFoundation
directory of the archive have mode "-rw-r-", i.e. they are not
20 matches
Mail list logo