|
They're a great exploration into what's possible, but there's a few steps in between that and a library you should actually use in real applications.
|
# ¿ Mar 22, 2015 02:38 |
|
|
# ¿ May 14, 2024 02:55 |
|
It seems to be more of the size of the target than the size of the current file, since I've had no syntax highlighting/autocomplete on five-line files plenty of times.
|
# ¿ Apr 5, 2015 05:20 |
|
Are there non-obj-c reasons for the first argument being different? It makes sense for calling obj-c defined things since you'd need some crazy heuristics to split the method name from the first argument label, but not so much for pure Swift.
|
# ¿ Apr 9, 2015 03:18 |
|
You still need final even with virtual, so it's not really an "instead" thing.
|
# ¿ Apr 11, 2015 21:50 |
|
code:
|
# ¿ May 24, 2015 15:44 |
|
Typealiasing a tuple is probably not ever a sensible thing to do. Outside of generic programming scenarios where you can't use a struct with meaningful names, the main reason to use a tuple is where a struct would be pointless boilerplate. If you're using a specific type of tuple enough places to justify a type name, then defining a struct instead is not massively boilerplate-inducing. There's definitely nothing wrong with a struct with zero methods.
|
# ¿ May 27, 2015 03:29 |
|
I don't see the benefit. You haven't actually reduced the amount of code at the call site or factored anything out.
|
# ¿ May 28, 2015 21:36 |
|
Defer puts the cleanup code next to the code creating the thing which needs to be cleaned up rather than as far away as possible (and is pretty useful even in the absence of exceptions).
|
# ¿ Jun 8, 2015 22:04 |
|
It works, but using try-finally just for cleanup from multiple returns would be weird and misleading.
|
# ¿ Jun 8, 2015 22:58 |
|
Does "not a priority" mean that it's something you think may get added at some point in the distant future, or is it something you don't expect to ever happen?
|
# ¿ Jun 15, 2015 03:18 |
|
Ender.uNF posted:Is it the preprocessor? Maybe there's also some better reason, but the preprocessor is the usual reason for lovely names. Doing #define nullable const before including the Foundation headers was previously legal (if insane) so adding nullable would be a breaking change, while #define _Nullable const is not legal.
|
# ¿ Jul 21, 2015 23:38 |
|
Installing Xcode 6 and 7 side-by-side works fine. I've been switching between them many times per day ever since the first beta came out, and literally the only problem I've encountered is that you have to explicitly exit the simulator when switching or dumb things happen.
|
# ¿ Aug 19, 2015 01:14 |
|
Ender.uNF posted:That stops being so much fun when you have to keep an iOS 9 branch going while working on other feature branches. You basically can't interact with the iOS 9 branch. Maintaining Swift 1.2 and Swift 2.0 versions of code has certainly been an utter nightmare, but having to keep track of which copy of Xcode I'm looking at is one of the smallest of the annoyances. I guess not being able to use the iOS 9 SDK with Swift 1.2 is an unnecessary headache.
|
# ¿ Aug 19, 2015 02:49 |
|
Implementing NSFastEnumeration only lets you iterate it from objc. To make it enumerable in swift you have to implement SequenceType.
|
# ¿ Oct 30, 2015 01:11 |
|
Official announcement is up, although the linked repos are still private. In addition to the obvious things it includes Foundation, XCTest, and a package manager.
|
# ¿ Dec 3, 2015 16:39 |
|
It's apparently a reimplementation of Foundation's API without any obj-c involved, which seems like an odd choice to me.
|
# ¿ Dec 3, 2015 17:21 |
|
Removing function currying's the bigger one (and also one that I agree with, as I've never actually seen it used).
|
# ¿ Dec 3, 2015 19:18 |
|
Ender.uNF posted:Does anyone know if us plebs can get Xcode to use a custom build of swift or sourcekitd? I haven't looked into it yet.
|
# ¿ Dec 3, 2015 20:40 |
|
ultramiraculous posted:Gotta make that impact. Get your name out there! The endless PRs that fix a single typo in a comment are a slightly less obnoxious form of that.
|
# ¿ Dec 3, 2015 23:52 |
|
Er, is there something beyond https://github.com/apple/swift/tree/master/tools/SourceKit to open-source? There isn't really user documentation but it appeared to have all of the actual functionality.
|
# ¿ Jan 5, 2016 06:43 |
|
I think the C API currently just exposes the IDE support functionality, which is basically just "tokenize this string" and "tell me about whatever's at this offset". For an AST you'd have to access the guts of the implementation (for Swift Jazzy just tokenizes the file then does the equivalent of alt-clicking each token and then reconstructing the structure).
|
# ¿ Jan 5, 2016 07:01 |
|
Well there's a few other projects built on sourcekitten, but obviously they'll all just use the same bit of SourceKit functionality so they aren't very interesting.
|
# ¿ Jan 5, 2016 16:56 |
|
Flobbster posted:It kind of makes sense that public things wouldn't get stripped since they might be needed elsewhere in the general case, but this case is surprising since it's linking into an executable so it's not going to be linked into something else that would try to use that function.
|
# ¿ Jan 12, 2016 04:44 |
|
If gyb was built into the compiler/build system we totally wouldn't need any new language features ever again.
|
# ¿ Feb 26, 2016 05:36 |
|
Swizzling methods is far worse than anything in swift.
|
# ¿ May 4, 2016 22:56 |
|
squidgee posted:
rjmccall can you confirm or deny that the wwdc surprise will be compiling swift to js so that we never have to use any other language?
|
# ¿ May 12, 2016 03:41 |
|
Yeah, it's been a while since I last looked at ComponentKit, but I'm pretty sure a Swift enum with defaults for the associated values is exactly what it wants.
|
# ¿ May 13, 2016 02:14 |
|
That went through the standard swift-evolution process and has been in the preview toolchain builds.
|
# ¿ Jun 13, 2016 22:59 |
|
Flobbster posted:I don't see why everyone is so up in arms about sealed-by-default classes anyway. You already can't subclass value types, and I've found myself writing way more of those than class types nowadays. And the class types I *do* write tend to be just because I need reference semantics and I make them final anyway. People complaining that they need to be able to subclass to "fix bugs" are poo poo out of luck if they have a struct, and that's a terrible justification/use for inheritance anyway. I'm glad the core team feels really strongly about this one so it doesn't get derailed.
|
# ¿ Jul 20, 2016 22:44 |
|
I don't think it has auto-expiring filters, but the other parts can be done easily with gmail.
|
# ¿ Mar 7, 2017 01:10 |
|
Swift 4 trip report: updating 10k lines of Swift to compile without warnings as Swift 3.0, 3.1, 3.2 and 4.0 took about 4 hours and involves 12 #if swift(...) checks, most of which are for XCTest changes rather than Swift itself. Definitely the least painful migration by a huge margin (and the first time we've been able to reasonably support two major versions on a single code base).
|
# ¿ Jun 7, 2017 00:53 |
|
SPM 4 still only supports macOS. The last time I poked it at it, it appeared that being able to set the C++ version was the only hard blocker for us being able to support a spm package so I would expect most obj-c libraries to work in theory.
|
# ¿ Jun 14, 2017 22:44 |
|
I always assumed that iOS support was on the roadmap once they had all the core functionality working because no one actually writes macOS applications anymore so why would you waste time building a macOS-only package manager? I guess if the actual goal is to use it to build macOS itself (and the bundled applications) it'd make sense.
|
# ¿ Jun 15, 2017 16:49 |
|
Every time I try to do something with generics I end up wishing I was writing C++. Protocol constraints are nice in theory but I seem to inevitably waste hours trying to work around limitations of the type system. Today's annoyance is that optionals of equatable types have operator == but are not equatable because there's no conditional protocol conformance.
|
# ¿ Jun 29, 2017 00:46 |
|
|
# ¿ May 14, 2024 02:55 |
|
I think it's in the generics manifesto, so it's a "the design we picked is really hard and will take years to implement" thing.
|
# ¿ Jun 29, 2017 01:13 |