{"action":"created","comment":{"url":"https://api.github.com/repos/jspkm/Calc/pulls/comments/40053662","id":40053662,"diff_hunk":"@@ -38,53 +38,106 @@ class ViewController: UIViewController {\n \n         if let operation = sender.currentTitle {\n             if let result = calcBrain.performOperation(operation) {\n-                displayHistory = operation\n                 displayValue = result\n             } else {\n-                displayValue = 0\n+                displayValue = nil\n             }\n         }\n+        updateHistory()\n     }\n     \n-    var displayValue : Double {\n-        get {\n-            return NSNumberFormatter().numberFromString(display.text!)!.doubleValue\n+    @IBAction func enter() {\n+        userInMiddleOfInputtingValue = false\n+\n+        if let value = displayValue {\n+            if let result = calcBrain.pushOperand(value) {\n+                displayValue = result\n+            } else {\n+                displayValue = nil\n+            }\n+        } else {\n+            displayValue = nil","path":"Calc/ViewController.swift","position":43,"original_position":43,"commit_id":"9bc545ae1335480ae01733177f889f5db109d7b7","original_commit_id":"9bc545ae1335480ae01733177f889f5db109d7b7","user":{"login":"suriyanto","id":1008875,"avatar_url":"https://avatars.githubusercontent.com/u/1008875?v=3","gravatar_id":"","url":"https://api.github.com/users/suriyanto","html_url":"https://github.com/suriyanto","followers_url":"https://api.github.com/users/suriyanto/followers","following_url":"https://api.github.com/users/suriyanto/following{/other_user}","gists_url":"https://api.github.com/users/suriyanto/gists{/gist_id}","starred_url":"https://api.github.com/users/suriyanto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suriyanto/subscriptions","organizations_url":"https://api.github.com/users/suriyanto/orgs","repos_url":"https://api.github.com/users/suriyanto/repos","events_url":"https://api.github.com/users/suriyanto/events{/privacy}","received_events_url":"https://api.github.com/users/suriyanto/received_events","type":"User","site_admin":false},"body":"This 6 lines of if let can probably be simplified using 1 line combination optional chaining and .description from Printable protocol.","created_at":"2015-09-22T05:17:46Z","updated_at":"2015-09-22T05:17:46Z","html_url":"https://github.com/jspkm/Calc/pull/5#discussion_r40053662","pull_request_url":"https://api.github.com/repos/jspkm/Calc/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/jspkm/Calc/pulls/comments/40053662"},"html":{"href":"https://github.com/jspkm/Calc/pull/5#discussion_r40053662"},"pull_request":{"href":"https://api.github.com/repos/jspkm/Calc/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/jspkm/Calc/pulls/5","id":45617891,"html_url":"https://github.com/jspkm/Calc/pull/5","diff_url":"https://github.com/jspkm/Calc/pull/5.diff","patch_url":"https://github.com/jspkm/Calc/pull/5.patch","issue_url":"https://api.github.com/repos/jspkm/Calc/issues/5","number":5,"state":"open","locked":false,"title":"Project 2 base","user":{"login":"jspkm","id":824101,"avatar_url":"https://avatars.githubusercontent.com/u/824101?v=3","gravatar_id":"","url":"https://api.github.com/users/jspkm","html_url":"https://github.com/jspkm","followers_url":"https://api.github.com/users/jspkm/followers","following_url":"https://api.github.com/users/jspkm/following{/other_user}","gists_url":"https://api.github.com/users/jspkm/gists{/gist_id}","starred_url":"https://api.github.com/users/jspkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jspkm/subscriptions","organizations_url":"https://api.github.com/users/jspkm/orgs","repos_url":"https://api.github.com/users/jspkm/repos","events_url":"https://api.github.com/users/jspkm/events{/privacy}","received_events_url":"https://api.github.com/users/jspkm/received_events","type":"User","site_admin":false},"body":"@suriyanto pls review - all working, except for M ops\r\n\r\n@yamamoto @crayon34 @ykim4jje ","created_at":"2015-09-22T00:54:22Z","updated_at":"2015-09-22T05:17:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96abf5389b4bc54a337031081236553493b1205f","assignee":{"login":"suriyanto","id":1008875,"avatar_url":"https://avatars.githubusercontent.com/u/1008875?v=3","gravatar_id":"","url":"https://api.github.com/users/suriyanto","html_url":"https://github.com/suriyanto","followers_url":"https://api.github.com/users/suriyanto/followers","following_url":"https://api.github.com/users/suriyanto/following{/other_user}","gists_url":"https://api.github.com/users/suriyanto/gists{/gist_id}","starred_url":"https://api.github.com/users/suriyanto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suriyanto/subscriptions","organizations_url":"https://api.github.com/users/suriyanto/orgs","repos_url":"https://api.github.com/users/suriyanto/repos","events_url":"https://api.github.com/users/suriyanto/events{/privacy}","received_events_url":"https://api.github.com/users/suriyanto/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/jspkm/Calc/pulls/5/commits","review_comments_url":"https://api.github.com/repos/jspkm/Calc/pulls/5/comments","review_comment_url":"https://api.github.com/repos/jspkm/Calc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jspkm/Calc/issues/5/comments","statuses_url":"https://api.github.com/repos/jspkm/Calc/statuses/9bc545ae1335480ae01733177f889f5db109d7b7","head":{"label":"jspkm:project-2-base","ref":"project-2-base","sha":"9bc545ae1335480ae01733177f889f5db109d7b7","user":{"login":"jspkm","id":824101,"avatar_url":"https://avatars.githubusercontent.com/u/824101?v=3","gravatar_id":"","url":"https://api.github.com/users/jspkm","html_url":"https://github.com/jspkm","followers_url":"https://api.github.com/users/jspkm/followers","following_url":"https://api.github.com/users/jspkm/following{/other_user}","gists_url":"https://api.github.com/users/jspkm/gists{/gist_id}","starred_url":"https://api.github.com/users/jspkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jspkm/subscriptions","organizations_url":"https://api.github.com/users/jspkm/orgs","repos_url":"https://api.github.com/users/jspkm/repos","events_url":"https://api.github.com/users/jspkm/events{/privacy}","received_events_url":"https://api.github.com/users/jspkm/received_events","type":"User","site_admin":false},"repo":{"id":42067387,"name":"Calc","full_name":"jspkm/Calc","owner":{"login":"jspkm","id":824101,"avatar_url":"https://avatars.githubusercontent.com/u/824101?v=3","gravatar_id":"","url":"https://api.github.com/users/jspkm","html_url":"https://github.com/jspkm","followers_url":"https://api.github.com/users/jspkm/followers","following_url":"https://api.github.com/users/jspkm/following{/other_user}","gists_url":"https://api.github.com/users/jspkm/gists{/gist_id}","starred_url":"https://api.github.com/users/jspkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jspkm/subscriptions","organizations_url":"https://api.github.com/users/jspkm/orgs","repos_url":"https://api.github.com/users/jspkm/repos","events_url":"https://api.github.com/users/jspkm/events{/privacy}","received_events_url":"https://api.github.com/users/jspkm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jspkm/Calc","description":"","fork":false,"url":"https://api.github.com/repos/jspkm/Calc","forks_url":"https://api.github.com/repos/jspkm/Calc/forks","keys_url":"https://api.github.com/repos/jspkm/Calc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jspkm/Calc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jspkm/Calc/teams","hooks_url":"https://api.github.com/repos/jspkm/Calc/hooks","issue_events_url":"https://api.github.com/repos/jspkm/Calc/issues/events{/number}","events_url":"https://api.github.com/repos/jspkm/Calc/events","assignees_url":"https://api.github.com/repos/jspkm/Calc/assignees{/user}","branches_url":"https://api.github.com/repos/jspkm/Calc/branches{/branch}","tags_url":"https://api.github.com/repos/jspkm/Calc/tags","blobs_url":"https://api.github.com/repos/jspkm/Calc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jspkm/Calc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jspkm/Calc/git/refs{/sha}","trees_url":"https://api.github.com/repos/jspkm/Calc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jspkm/Calc/statuses/{sha}","languages_url":"https://api.github.com/repos/jspkm/Calc/languages","stargazers_url":"https://api.github.com/repos/jspkm/Calc/stargazers","contributors_url":"https://api.github.com/repos/jspkm/Calc/contributors","subscribers_url":"https://api.github.com/repos/jspkm/Calc/subscribers","subscription_url":"https://api.github.com/repos/jspkm/Calc/subscription","commits_url":"https://api.github.com/repos/jspkm/Calc/commits{/sha}","git_commits_url":"https://api.github.com/repos/jspkm/Calc/git/commits{/sha}","comments_url":"https://api.github.com/repos/jspkm/Calc/comments{/number}","issue_comment_url":"https://api.github.com/repos/jspkm/Calc/issues/comments{/number}","contents_url":"https://api.github.com/repos/jspkm/Calc/contents/{+path}","compare_url":"https://api.github.com/repos/jspkm/Calc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jspkm/Calc/merges","archive_url":"https://api.github.com/repos/jspkm/Calc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jspkm/Calc/downloads","issues_url":"https://api.github.com/repos/jspkm/Calc/issues{/number}","pulls_url":"https://api.github.com/repos/jspkm/Calc/pulls{/number}","milestones_url":"https://api.github.com/repos/jspkm/Calc/milestones{/number}","notifications_url":"https://api.github.com/repos/jspkm/Calc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jspkm/Calc/labels{/name}","releases_url":"https://api.github.com/repos/jspkm/Calc/releases{/id}","created_at":"2015-09-07T18:00:16Z","updated_at":"2015-09-07T18:47:39Z","pushed_at":"2015-09-22T00:54:23Z","git_url":"git://github.com/jspkm/Calc.git","ssh_url":"git@github.com:jspkm/Calc.git","clone_url":"https://github.com/jspkm/Calc.git","svn_url":"https://github.com/jspkm/Calc","homepage":null,"size":220,"stargazers_count":1,"watchers_count":1,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"jspkm:master","ref":"master","sha":"3e8f2146f68fc7e23f32e21279d435d7ea87b0f7","user":{"login":"jspkm","id":824101,"avatar_url":"https://avatars.githubusercontent.com/u/824101?v=3","gravatar_id":"","url":"https://api.github.com/users/jspkm","html_url":"https://github.com/jspkm","followers_url":"https://api.github.com/users/jspkm/followers","following_url":"https://api.github.com/users/jspkm/following{/other_user}","gists_url":"https://api.github.com/users/jspkm/gists{/gist_id}","starred_url":"https://api.github.com/users/jspkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jspkm/subscriptions","organizations_url":"https://api.github.com/users/jspkm/orgs","repos_url":"https://api.github.com/users/jspkm/repos","events_url":"https://api.github.com/users/jspkm/events{/privacy}","received_events_url":"https://api.github.com/users/jspkm/received_events","type":"User","site_admin":false},"repo":{"id":42067387,"name":"Calc","full_name":"jspkm/Calc","owner":{"login":"jspkm","id":824101,"avatar_url":"https://avatars.githubusercontent.com/u/824101?v=3","gravatar_id":"","url":"https://api.github.com/users/jspkm","html_url":"https://github.com/jspkm","followers_url":"https://api.github.com/users/jspkm/followers","following_url":"https://api.github.com/users/jspkm/following{/other_user}","gists_url":"https://api.github.com/users/jspkm/gists{/gist_id}","starred_url":"https://api.github.com/users/jspkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jspkm/subscriptions","organizations_url":"https://api.github.com/users/jspkm/orgs","repos_url":"https://api.github.com/users/jspkm/repos","events_url":"https://api.github.com/users/jspkm/events{/privacy}","received_events_url":"https://api.github.com/users/jspkm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jspkm/Calc","description":"","fork":false,"url":"https://api.github.com/repos/jspkm/Calc","forks_url":"https://api.github.com/repos/jspkm/Calc/forks","keys_url":"https://api.github.com/repos/jspkm/Calc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jspkm/Calc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jspkm/Calc/teams","hooks_url":"https://api.github.com/repos/jspkm/Calc/hooks","issue_events_url":"https://api.github.com/repos/jspkm/Calc/issues/events{/number}","events_url":"https://api.github.com/repos/jspkm/Calc/events","assignees_url":"https://api.github.com/repos/jspkm/Calc/assignees{/user}","branches_url":"https://api.github.com/repos/jspkm/Calc/branches{/branch}","tags_url":"https://api.github.com/repos/jspkm/Calc/tags","blobs_url":"https://api.github.com/repos/jspkm/Calc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jspkm/Calc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jspkm/Calc/git/refs{/sha}","trees_url":"https://api.github.com/repos/jspkm/Calc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jspkm/Calc/statuses/{sha}","languages_url":"https://api.github.com/repos/jspkm/Calc/languages","stargazers_url":"https://api.github.com/repos/jspkm/Calc/stargazers","contributors_url":"https://api.github.com/repos/jspkm/Calc/contributors","subscribers_url":"https://api.github.com/repos/jspkm/Calc/subscribers","subscription_url":"https://api.github.com/repos/jspkm/Calc/subscription","commits_url":"https://api.github.com/repos/jspkm/Calc/commits{/sha}","git_commits_url":"https://api.github.com/repos/jspkm/Calc/git/commits{/sha}","comments_url":"https://api.github.com/repos/jspkm/Calc/comments{/number}","issue_comment_url":"https://api.github.com/repos/jspkm/Calc/issues/comments{/number}","contents_url":"https://api.github.com/repos/jspkm/Calc/contents/{+path}","compare_url":"https://api.github.com/repos/jspkm/Calc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jspkm/Calc/merges","archive_url":"https://api.github.com/repos/jspkm/Calc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jspkm/Calc/downloads","issues_url":"https://api.github.com/repos/jspkm/Calc/issues{/number}","pulls_url":"https://api.github.com/repos/jspkm/Calc/pulls{/number}","milestones_url":"https://api.github.com/repos/jspkm/Calc/milestones{/number}","notifications_url":"https://api.github.com/repos/jspkm/Calc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jspkm/Calc/labels{/name}","releases_url":"https://api.github.com/repos/jspkm/Calc/releases{/id}","created_at":"2015-09-07T18:00:16Z","updated_at":"2015-09-07T18:47:39Z","pushed_at":"2015-09-22T00:54:23Z","git_url":"git://github.com/jspkm/Calc.git","ssh_url":"git@github.com:jspkm/Calc.git","clone_url":"https://github.com/jspkm/Calc.git","svn_url":"https://github.com/jspkm/Calc","homepage":null,"size":220,"stargazers_count":1,"watchers_count":1,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jspkm/Calc/pulls/5"},"html":{"href":"https://github.com/jspkm/Calc/pull/5"},"issue":{"href":"https://api.github.com/repos/jspkm/Calc/issues/5"},"comments":{"href":"https://api.github.com/repos/jspkm/Calc/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/jspkm/Calc/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/jspkm/Calc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jspkm/Calc/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/jspkm/Calc/statuses/9bc545ae1335480ae01733177f889f5db109d7b7"}}}}