The Swift Programming Language
431–440 of 970 posts
Re: The Swift Programming Language
#432As someone who always disliked Objective C, I think Swift looks very promising. I'll check it out right away :) Software-wise, I feel these current WWDC announcements are the most exciting in years. Looking at the Swift docs right now, I can see many interesting inspirations at work: there's some Lua/Go in there (multiple return values), some Ruby (closure passed as the last argument to a function can appear immediat…
I really don't see the Golang influence at all. The multiple- return- value semantic is closer to Ruby's than to Golang's; you're returning a tuple, which happens to have natural syntax in the language. Defining Golang features that don't exist in Swift: - Interface types with implicit adoption (Swift takes explicit protocols from ObjC) - Error types - Relatedly, the "damnable use requirement" and its interaction wit…
Objective-C has informal protocols, and so does Swift.
Re: The Swift Programming Language
#433Earlier quoted context omitted.
Now that Microsoft has been open sourcing so much stuff I was expecting Apple to follow the wave and release Swift as open source too. It's a shame though.
I'm old enough to remember Apple suing Microsoft for "copying their look and feel". Open source is something Apple only does strategically - when they have to or it suits them - it is not part of the company's ethos. http://en.wikipedia.org/wiki/Apple_Computer,_Inc._v._Microso... .
What Fortune 500 (or even 5000) systematically open sources every piece of technology? Every company I can think of -- Yahoo, Microsoft, Google, Facebook, LinkedIn, Twitter, Amazon, LinkedIn, AOL, Craigslist, Oracle, -- selectively decides what to open source.
I'm not saying that's right or wrong, but Apple is far from alone in doing so.
Re: The Swift Programming Language
#434Any ideas on how easy it will be to slurp JSON with Swift?
`NSJSONSerialization` worked pretty well with iOS 5.x and above.
Not sure if you're looking direct JSON -> Object serialization.
Re: The Swift Programming Language
#435Now, if Go was implemented on Android, I'd probably develop a lot more for mobile.
Re: The Swift Programming Language
#436Earlier quoted context omitted.
It's probably a wise decision to have an "Algol patterned" language. No non Algol patterned language has ever become a mainstream programming language to my knowledge.
I am not a programming language wonk; so I imagine most languages I am familiar-with/know-of are necessarily Algol patterned. What are some non-Algol patterned languages?
Re: The Swift Programming Language
#437For those without iBook, here's an excerpt from "The Swift Programming Language": http://pastebin.com/xsr401gt
It works in Calibre, provided you can get your hands on the epub file in some way...
Re: The Swift Programming Language
#438Re: The Swift Programming Language
#439Swift has a built in option type “if let actualNumber = possibleNumber.toInt() { println("\(possibleNumber) value: \ (actualNumber)") } else { println("\(possibleNumber) could not be converted to an integer") }” Nice to see the Apple's language developers embracing functional programming by providing a clean implementation of the Maybe Monad as well as support for closures.
if (x = proc()) {printf("%i", x);}Re: The Swift Programming Language
#440Earlier quoted context omitted.
It's fun once. It's impractical for someone editing the code later though, I don't want to have to look up the unicode character each time I want to remember it, and I don't want to have to copy and paste it either, it's better to stick with the characters available on a keyboard.
I have to agree. I had a love affair with unicode put directly in LaTeX markup (delta, integral signs, element-of, etc...) and it was very fun at first. Then I had to send the paper to a collaborator while writing a follow-up article together. I ended up removing all the unicode, and in subsequent work I didn't do it any more.