Re: [swift-users] An OpenGL math library in pure Swift

2016-01-05 Thread Michael Ilseman via swift-users
> On Jan 4, 2016, at 7:11 PM, David Turnbull via swift-users > wrote: > > I've been working on a math library for SwiftGL. It's looking good. Vector2, > Vector3, Vector4, Matrix2x2, Matrix3x3, Matrix4x4 are implemented with all > arithmetic. You can even swizzle just

Re: [swift-users] An OpenGL math library in pure Swift

2016-01-05 Thread Stephen Canon via swift-users
Hey David — FYI essentially all of this stuff is already present in the simd module (stdlib/public/SDK/simd/simd.swift.gyb or ‘import simd'), albeit without nice generics, and with some different stylistic choices because simd is at present a straight Swift port of a subset of the simd

Re: [swift-users] Very strange automatic behavior between StringLiteralConvertible and pattern matching

2016-01-05 Thread David Hart via swift-users
Sorry about the double post. > On 05 Jan 2016, at 18:26, David Hart via swift-users > wrote: > > How is it that Swift allows code like this: > > struct Sneaky: StringLiteralConvertible { > init(stringLiteral value: String) {} >

Re: [swift-users] Newbie Question

2016-01-05 Thread Jens Alfke via swift-users
> On Jan 4, 2016, at 9:07 AM, Sherri McGurnaghan via swift-users > wrote: > > I am trying to do something super simple using Swift - we are changing our > infrastructure and the new environment requires me to work with Swift. > Needless to say, I am a complete newbie

[swift-users] Very unexpected automatic behaviour between StringLiteralConvertible and pattern matching!

2016-01-05 Thread David Hart via swift-users
How is it that Swift allows code like this: struct Sneaky: StringLiteralConvertible { init(stringLiteral value: String) {} init(extendedGraphemeClusterLiteral value: String) {} init(unicodeScalarLiteral value: String) {} } func ~=(sneaky: Sneaky, string: String) -> Bool {

[swift-users] Very strange automatic behavior between StringLiteralConvertible and pattern matching

2016-01-05 Thread David Hart via swift-users
How is it that Swift allows code like this: struct Sneaky: StringLiteralConvertible { init(stringLiteral value: String) {} init(extendedGraphemeClusterLiteral value: String) {} init(unicodeScalarLiteral value: String) {} } func ~=(sneaky: Sneaky, string: String) -> Bool {

[swift-users] ARC // Precise Lifetime Semantics

2016-01-05 Thread Daniel Eggert via swift-users
How do I extend the lifetime of a variable, i.e. make sure that ARC is less aggressive? clang has an attribute called objc_precise_lifetime — does Swift have something similar? I have this code: do { var base = UnsafePointer() var size = Int() let mapped =

Re: [swift-users] Package manager and swiftdoc

2016-01-05 Thread Rick Ballard via swift-users
Hi Luz, We currently have no standard established for generating documentation for packages in a uniform way, but it's in our plans (https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageManagerCommunityProposal.md#documentation-generation). Proposals are welcome for

[swift-users] Compiler switch?

2016-01-05 Thread Don Wills via swift-users
Hello Swift-Users, I am building an automated translator to translate from another programming language to Swift. It's mostly working, but there is one issue that would be hard for the translator to deal with - the issue of 'var' vs. 'let' declarations. Right now the translator always