{"action":"created","comment":{"url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/comments/50210633","id":50210633,"diff_hunk":"@@ -21,84 +21,132 @@ public class VerbalExpressions {\n \n     // computed properties\n     var pattern: String { return prefixes + source + suffixes }\n-    \n+\n     var regularExpression: NSRegularExpression! {\n-        get {\n-            let regex = try! NSRegularExpression(pattern: pattern, options: options)\n-            \n-            return regex\n-        }\n+        return try! NSRegularExpression(pattern: pattern, options: options)\n     }\n \n     // instance methods\n-    public func startOfLine(enabled enabled: Bool = true) -> Self {\n-        prefixes = enabled ? \"^\" : \"\"\n-\n-        return self\n+    public func startOfLine(enabled enabled: Bool = true) -> VerbalExpressions {\n+        return VerbalExpressions(\n+            prefixes: enabled ? \"^\" : \"\",\n+            source: self.source,","path":"VerbalExpressions/VerbalExpressions.swift","position":32,"original_position":32,"commit_id":"0aed0ec71fbb635e53f9ac7eff6ddfdaecf9e173","original_commit_id":"0aed0ec71fbb635e53f9ac7eff6ddfdaecf9e173","user":{"login":"nmn","id":3582514,"avatar_url":"https://avatars.githubusercontent.com/u/3582514?v=3","gravatar_id":"","url":"https://api.github.com/users/nmn","html_url":"https://github.com/nmn","followers_url":"https://api.github.com/users/nmn/followers","following_url":"https://api.github.com/users/nmn/following{/other_user}","gists_url":"https://api.github.com/users/nmn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmn/subscriptions","organizations_url":"https://api.github.com/users/nmn/orgs","repos_url":"https://api.github.com/users/nmn/repos","events_url":"https://api.github.com/users/nmn/events{/privacy}","received_events_url":"https://api.github.com/users/nmn/received_events","type":"User","site_admin":false},"body":"Not seen it mentioned either way. `self.` just feels a little more explicit to me. I don't have any strong feeling about that however, I'll clean them up.","created_at":"2016-01-20T03:21:02Z","updated_at":"2016-01-20T03:21:02Z","html_url":"https://github.com/VerbalExpressions/SwiftVerbalExpressions/pull/5#discussion_r50210633","pull_request_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/comments/50210633"},"html":{"href":"https://github.com/VerbalExpressions/SwiftVerbalExpressions/pull/5#discussion_r50210633"},"pull_request":{"href":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/5","id":55256743,"html_url":"https://github.com/VerbalExpressions/SwiftVerbalExpressions/pull/5","diff_url":"https://github.com/VerbalExpressions/SwiftVerbalExpressions/pull/5.diff","patch_url":"https://github.com/VerbalExpressions/SwiftVerbalExpressions/pull/5.patch","issue_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/issues/5","number":5,"state":"open","locked":false,"title":"use struct instead of class, overloading operators","user":{"login":"nmn","id":3582514,"avatar_url":"https://avatars.githubusercontent.com/u/3582514?v=3","gravatar_id":"","url":"https://api.github.com/users/nmn","html_url":"https://github.com/nmn","followers_url":"https://api.github.com/users/nmn/followers","following_url":"https://api.github.com/users/nmn/following{/other_user}","gists_url":"https://api.github.com/users/nmn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmn/subscriptions","organizations_url":"https://api.github.com/users/nmn/orgs","repos_url":"https://api.github.com/users/nmn/repos","events_url":"https://api.github.com/users/nmn/events{/privacy}","received_events_url":"https://api.github.com/users/nmn/received_events","type":"User","site_admin":false},"body":"1. Updated Class to be a Struct instead. This makes the whole thing immutable, and get value semantics. A regular expression is clearly 'data' and should have value semantics.\r\n2. Added two more functions for the custom operators, which just allow you to reverse the arguments.\r\nif `a =~ b` is true, `b =~ a` should also be true. This can be done because string matching is commutative.","created_at":"2016-01-06T19:58:03Z","updated_at":"2016-01-20T03:21:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"92a23e5e82514905c606e50daf6266a231f2e936","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/5/commits","review_comments_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/5/comments","review_comment_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/issues/5/comments","statuses_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/statuses/0aed0ec71fbb635e53f9ac7eff6ddfdaecf9e173","head":{"label":"nmn:patch-1","ref":"patch-1","sha":"0aed0ec71fbb635e53f9ac7eff6ddfdaecf9e173","user":{"login":"nmn","id":3582514,"avatar_url":"https://avatars.githubusercontent.com/u/3582514?v=3","gravatar_id":"","url":"https://api.github.com/users/nmn","html_url":"https://github.com/nmn","followers_url":"https://api.github.com/users/nmn/followers","following_url":"https://api.github.com/users/nmn/following{/other_user}","gists_url":"https://api.github.com/users/nmn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmn/subscriptions","organizations_url":"https://api.github.com/users/nmn/orgs","repos_url":"https://api.github.com/users/nmn/repos","events_url":"https://api.github.com/users/nmn/events{/privacy}","received_events_url":"https://api.github.com/users/nmn/received_events","type":"User","site_admin":false},"repo":{"id":49157994,"name":"SwiftVerbalExpressions","full_name":"nmn/SwiftVerbalExpressions","owner":{"login":"nmn","id":3582514,"avatar_url":"https://avatars.githubusercontent.com/u/3582514?v=3","gravatar_id":"","url":"https://api.github.com/users/nmn","html_url":"https://github.com/nmn","followers_url":"https://api.github.com/users/nmn/followers","following_url":"https://api.github.com/users/nmn/following{/other_user}","gists_url":"https://api.github.com/users/nmn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmn/subscriptions","organizations_url":"https://api.github.com/users/nmn/orgs","repos_url":"https://api.github.com/users/nmn/repos","events_url":"https://api.github.com/users/nmn/events{/privacy}","received_events_url":"https://api.github.com/users/nmn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmn/SwiftVerbalExpressions","description":"Swift Port of VerbalExpressions","fork":true,"url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions","forks_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/forks","keys_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/teams","hooks_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/hooks","issue_events_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/issues/events{/number}","events_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/events","assignees_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/assignees{/user}","branches_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/branches{/branch}","tags_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/tags","blobs_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/statuses/{sha}","languages_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/languages","stargazers_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/stargazers","contributors_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/contributors","subscribers_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/subscribers","subscription_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/subscription","commits_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/contents/{+path}","compare_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/merges","archive_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/downloads","issues_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/issues{/number}","pulls_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/pulls{/number}","milestones_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/milestones{/number}","notifications_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/labels{/name}","releases_url":"https://api.github.com/repos/nmn/SwiftVerbalExpressions/releases{/id}","created_at":"2016-01-06T19:54:35Z","updated_at":"2016-01-06T19:54:35Z","pushed_at":"2016-01-19T19:36:57Z","git_url":"git://github.com/nmn/SwiftVerbalExpressions.git","ssh_url":"git@github.com:nmn/SwiftVerbalExpressions.git","clone_url":"https://github.com/nmn/SwiftVerbalExpressions.git","svn_url":"https://github.com/nmn/SwiftVerbalExpressions","homepage":null,"size":25,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"VerbalExpressions:master","ref":"master","sha":"6c6953ebb7e8cb1405ee290e5a63e533ba8c296e","user":{"login":"VerbalExpressions","id":5083777,"avatar_url":"https://avatars.githubusercontent.com/u/5083777?v=3","gravatar_id":"","url":"https://api.github.com/users/VerbalExpressions","html_url":"https://github.com/VerbalExpressions","followers_url":"https://api.github.com/users/VerbalExpressions/followers","following_url":"https://api.github.com/users/VerbalExpressions/following{/other_user}","gists_url":"https://api.github.com/users/VerbalExpressions/gists{/gist_id}","starred_url":"https://api.github.com/users/VerbalExpressions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VerbalExpressions/subscriptions","organizations_url":"https://api.github.com/users/VerbalExpressions/orgs","repos_url":"https://api.github.com/users/VerbalExpressions/repos","events_url":"https://api.github.com/users/VerbalExpressions/events{/privacy}","received_events_url":"https://api.github.com/users/VerbalExpressions/received_events","type":"Organization","site_admin":false},"repo":{"id":20684001,"name":"SwiftVerbalExpressions","full_name":"VerbalExpressions/SwiftVerbalExpressions","owner":{"login":"VerbalExpressions","id":5083777,"avatar_url":"https://avatars.githubusercontent.com/u/5083777?v=3","gravatar_id":"","url":"https://api.github.com/users/VerbalExpressions","html_url":"https://github.com/VerbalExpressions","followers_url":"https://api.github.com/users/VerbalExpressions/followers","following_url":"https://api.github.com/users/VerbalExpressions/following{/other_user}","gists_url":"https://api.github.com/users/VerbalExpressions/gists{/gist_id}","starred_url":"https://api.github.com/users/VerbalExpressions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VerbalExpressions/subscriptions","organizations_url":"https://api.github.com/users/VerbalExpressions/orgs","repos_url":"https://api.github.com/users/VerbalExpressions/repos","events_url":"https://api.github.com/users/VerbalExpressions/events{/privacy}","received_events_url":"https://api.github.com/users/VerbalExpressions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VerbalExpressions/SwiftVerbalExpressions","description":"Swift Port of VerbalExpressions","fork":false,"url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions","forks_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/forks","keys_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/teams","hooks_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/hooks","issue_events_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/issues/events{/number}","events_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/events","assignees_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/assignees{/user}","branches_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/branches{/branch}","tags_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/tags","blobs_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/git/refs{/sha}","trees_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/statuses/{sha}","languages_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/languages","stargazers_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/stargazers","contributors_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/contributors","subscribers_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/subscribers","subscription_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/subscription","commits_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/commits{/sha}","git_commits_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/git/commits{/sha}","comments_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/comments{/number}","issue_comment_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/issues/comments{/number}","contents_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/contents/{+path}","compare_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/merges","archive_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/downloads","issues_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/issues{/number}","pulls_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls{/number}","milestones_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/milestones{/number}","notifications_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/labels{/name}","releases_url":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/releases{/id}","created_at":"2014-06-10T12:17:16Z","updated_at":"2016-01-20T01:17:47Z","pushed_at":"2016-01-19T19:36:58Z","git_url":"git://github.com/VerbalExpressions/SwiftVerbalExpressions.git","ssh_url":"git@github.com:VerbalExpressions/SwiftVerbalExpressions.git","clone_url":"https://github.com/VerbalExpressions/SwiftVerbalExpressions.git","svn_url":"https://github.com/VerbalExpressions/SwiftVerbalExpressions","homepage":null,"size":26,"stargazers_count":367,"watchers_count":367,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":3,"forks":14,"open_issues":3,"watchers":367,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/5"},"html":{"href":"https://github.com/VerbalExpressions/SwiftVerbalExpressions/pull/5"},"issue":{"href":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/issues/5"},"comments":{"href":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/VerbalExpressions/SwiftVerbalExpressions/statuses/0aed0ec71fbb635e53f9ac7eff6ddfdaecf9e173"}}}}