or Connect
New Posts  All Forums:

Posts by Dick Applebaum

Code:class ViewController: UIViewController{ @IBOutlet weak var display: UILabel! var userIsInTheMiddlefTypingANumber = false var brain = CalculatorBrain() @IBAction func appendDigit(sender: UIButton) { let digit = sender.currentTitle! if userIsInTheMiddlefTypingANumber { display.text = display.text! + digit } else { display.text = digit userIsInTheMiddlefTypingANumber = true } }From...
I guess you could call me a grandpa -- I'm 75 and have 3 grandkids ... But I resent the stereotype! Actually, I prefer concise code and abstraction as opposed to specific step-by-step instructions. I like leveraging, trusting, building upon supplied standard solutions (frameworks, Storyboards, etc.) as opposed to re-inventing the wheel -- then proliferating my nonstandard solution across many projects.It is amazing (to me) now many respected, excellent programmers...
Please check to see if the new features you mention are addressed in 1.2 and list any that don't work.
In my testing, so far, there have been very few updates to the Swift Language. Most of the updates by the migration tool address the compiler targets and runtime.
If I use swift I don't have the C++ option anymore and I'm stuck with whatever dispatch mechanism I compiled it with.But you do ... My fault, in order to save space. I intermingled the code. They are not separate programs -- rather they are all included within 1 App. The Swift portion is the main file that calls the others:I got the app from the web. If you have Xcode 6 you can try it ...lost the link, bit will post it when I find it!Edit: Here's the...
FWIW, here's a speed test comparison program I foundCode:// the main programimport Foundationlet num_elements : NSInteger = 1000000Performance_ObjCtoCPlusPlus.sortArrayCPlusPlus(num_elements)Performance_ObjectiveC.sortArrayObjC(num_elements)//---------------------------------------//The Swift Program// Put the code you want to measure the time of here.let start : NSDate = NSDate()var int_array = [Int](count: num_elements, repeatedValue: 0)for i in 0..<(num_elements) { ...
Smoke 'em if you got 'em ... This displays "Hello, world": 'Hello, world' This following immediate-mode expression generates a typical set of Pick 6 lottery numbers: six pseudo-random integers ranging from 1 to 40, guaranteed non-repeating, and displays them sorted in ascending order: x[⍋x←6?40] The following expression finds all prime numbers from 1 to R. In both time and space, the calculation complexity is O(R^2)\,\! (in Big O notation). (~R∊R∘.×R)/R←1↓ιR The...
In response to everyone in general -- and no one in particular:
I think there's more to it than just the quality of the compiler.If the language has knowledge of the compiler, debugger, runtime, tools (the underlying stack) -- it can include directives to them to generate faster, safer, more efficient code ...Apple controls the underlying stack, and with Swift, controls the Language -- so it better optimize the whole process and the resulting product.
Ahh ... That explains a lot. He understands the strengths and weaknesses, and what's important and what's not.
New Posts  All Forums: