{"action":"created","comment":{"url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/comments/82491602","pull_request_review_id":3398565,"id":82491602,"diff_hunk":"@@ -1,18 +1,55 @@\n # Reflection on implementing regular expressions of a DSL\n \n ## Which operators were easiest to implement and why?\n+The easiest operators were the `||` and `~` ones. This is partly because\n+we did a very similar example in class but also because Scala makes it\n+very easy to create operators that equate to a created method/constructor.\n+I also thought it was easy since Scala lets us create infix operators very\n+easily (and with no syntactic sugar) so I do anything super special to maintain\n+fluency. \n \n ## Which operators were most difficult to implement and why?\n+The `{n}` operator was by far the most difficult - I still don't think I did\n+it properly :). This was the most difficult because we wanted to use braces\n+in order to envoke the repetitions. In Scala (and many languages) braces are\n+a special keyword for program control flow and cant easily be overridden. I\n+tried many methods to overide it like using closures/curried functions or creating\n+an implicit conversion when we see a number and a character. I really was very\n+troubled by this operator. Eventually a stack overflow question (linked in the\n+code) helped me figure it out but I dont know if it is the proper way of doing\n+it.\n+\n \n ## Comment on the design of this internal DSL\n+I thought what worked and was easy was to simply pick between a few strings or\n+characters. It is also really easy to create a string with a variable or set\n+number of repetitions. Lastly, one can easily combine/chain these to make larger\n+commands.\n+\n+The difficulties with the language is that putting together a few might be doable\n+with little effort; however, reading the code after or sharing it with someone\n+else is very difficult: seeing a bunch of characters in a single pattern\n+is definitely not readable. Also, since we only use symbols, a non-CS/Math user\n+would not naturally understand the symbols compared to using words like `or`.\n+To extrapolate that, math or cs student who has learned set theory (discrete)\n+understands what the `*, +, ||` operators do and could easily read the pattern\n+wheras a more basic user would be confused. Lastly, it is very difficult to\n+include another operation within a string. For example, if we want to say the\n+word \"boring\" but want to match with strings that have a variable amount of 'o's\n+(since they might be reallllllllllllly bored), we would have to say:\n+\n+    `val pattern = \"st\" ~ ('r' <*>) ~ \"ing\"`\n+which is not that simple and something like ","path":"reflection.md","position":42,"original_position":42,"commit_id":"592d9ebbbb34cd2641374a0421ed0b46fb1d5e6b","original_commit_id":"592d9ebbbb34cd2641374a0421ed0b46fb1d5e6b","user":{"login":"farhanatt","id":21352602,"avatar_url":"https://avatars.githubusercontent.com/u/21352602?v=3","gravatar_id":"","url":"https://api.github.com/users/farhanatt","html_url":"https://github.com/farhanatt","followers_url":"https://api.github.com/users/farhanatt/followers","following_url":"https://api.github.com/users/farhanatt/following{/other_user}","gists_url":"https://api.github.com/users/farhanatt/gists{/gist_id}","starred_url":"https://api.github.com/users/farhanatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farhanatt/subscriptions","organizations_url":"https://api.github.com/users/farhanatt/orgs","repos_url":"https://api.github.com/users/farhanatt/repos","events_url":"https://api.github.com/users/farhanatt/events{/privacy}","received_events_url":"https://api.github.com/users/farhanatt/received_events","type":"User","site_admin":false},"body":"This put into words one of the feelings I failed to describe properly.  I ended up saying I didn't like the Concat syntax of `~`, but I think it's more that doing operations within a word is what causes the issue.  ","created_at":"2016-10-08T01:09:51Z","updated_at":"2016-10-08T01:11:04Z","html_url":"https://github.com/hmc-cs111-fall2016/regular-expressions/pull/16#discussion_r82491602","pull_request_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/comments/82491602"},"html":{"href":"https://github.com/hmc-cs111-fall2016/regular-expressions/pull/16#discussion_r82491602"},"pull_request":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/16","id":88206782,"html_url":"https://github.com/hmc-cs111-fall2016/regular-expressions/pull/16","diff_url":"https://github.com/hmc-cs111-fall2016/regular-expressions/pull/16.diff","patch_url":"https://github.com/hmc-cs111-fall2016/regular-expressions/pull/16.patch","issue_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/issues/16","number":16,"state":"open","locked":false,"title":"Anthony Romm","user":{"login":"aromm","id":19671873,"avatar_url":"https://avatars.githubusercontent.com/u/19671873?v=3","gravatar_id":"","url":"https://api.github.com/users/aromm","html_url":"https://github.com/aromm","followers_url":"https://api.github.com/users/aromm/followers","following_url":"https://api.github.com/users/aromm/following{/other_user}","gists_url":"https://api.github.com/users/aromm/gists{/gist_id}","starred_url":"https://api.github.com/users/aromm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aromm/subscriptions","organizations_url":"https://api.github.com/users/aromm/orgs","repos_url":"https://api.github.com/users/aromm/repos","events_url":"https://api.github.com/users/aromm/events{/privacy}","received_events_url":"https://api.github.com/users/aromm/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-06T06:48:07Z","updated_at":"2016-10-08T01:11:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14ad4b1a858accc8c1d1b4a3e55493bd97fee2c5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/16/commits","review_comments_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/16/comments","review_comment_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/issues/16/comments","statuses_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/statuses/592d9ebbbb34cd2641374a0421ed0b46fb1d5e6b","head":{"label":"aromm:master","ref":"master","sha":"592d9ebbbb34cd2641374a0421ed0b46fb1d5e6b","user":{"login":"aromm","id":19671873,"avatar_url":"https://avatars.githubusercontent.com/u/19671873?v=3","gravatar_id":"","url":"https://api.github.com/users/aromm","html_url":"https://github.com/aromm","followers_url":"https://api.github.com/users/aromm/followers","following_url":"https://api.github.com/users/aromm/following{/other_user}","gists_url":"https://api.github.com/users/aromm/gists{/gist_id}","starred_url":"https://api.github.com/users/aromm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aromm/subscriptions","organizations_url":"https://api.github.com/users/aromm/orgs","repos_url":"https://api.github.com/users/aromm/repos","events_url":"https://api.github.com/users/aromm/events{/privacy}","received_events_url":"https://api.github.com/users/aromm/received_events","type":"User","site_admin":false},"repo":{"id":69897938,"name":"regular-expressions","full_name":"aromm/regular-expressions","owner":{"login":"aromm","id":19671873,"avatar_url":"https://avatars.githubusercontent.com/u/19671873?v=3","gravatar_id":"","url":"https://api.github.com/users/aromm","html_url":"https://github.com/aromm","followers_url":"https://api.github.com/users/aromm/followers","following_url":"https://api.github.com/users/aromm/following{/other_user}","gists_url":"https://api.github.com/users/aromm/gists{/gist_id}","starred_url":"https://api.github.com/users/aromm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aromm/subscriptions","organizations_url":"https://api.github.com/users/aromm/orgs","repos_url":"https://api.github.com/users/aromm/repos","events_url":"https://api.github.com/users/aromm/events{/privacy}","received_events_url":"https://api.github.com/users/aromm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aromm/regular-expressions","description":"Assignment 5: implementing regular expressions as an internal DSL","fork":true,"url":"https://api.github.com/repos/aromm/regular-expressions","forks_url":"https://api.github.com/repos/aromm/regular-expressions/forks","keys_url":"https://api.github.com/repos/aromm/regular-expressions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aromm/regular-expressions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aromm/regular-expressions/teams","hooks_url":"https://api.github.com/repos/aromm/regular-expressions/hooks","issue_events_url":"https://api.github.com/repos/aromm/regular-expressions/issues/events{/number}","events_url":"https://api.github.com/repos/aromm/regular-expressions/events","assignees_url":"https://api.github.com/repos/aromm/regular-expressions/assignees{/user}","branches_url":"https://api.github.com/repos/aromm/regular-expressions/branches{/branch}","tags_url":"https://api.github.com/repos/aromm/regular-expressions/tags","blobs_url":"https://api.github.com/repos/aromm/regular-expressions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aromm/regular-expressions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aromm/regular-expressions/git/refs{/sha}","trees_url":"https://api.github.com/repos/aromm/regular-expressions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aromm/regular-expressions/statuses/{sha}","languages_url":"https://api.github.com/repos/aromm/regular-expressions/languages","stargazers_url":"https://api.github.com/repos/aromm/regular-expressions/stargazers","contributors_url":"https://api.github.com/repos/aromm/regular-expressions/contributors","subscribers_url":"https://api.github.com/repos/aromm/regular-expressions/subscribers","subscription_url":"https://api.github.com/repos/aromm/regular-expressions/subscription","commits_url":"https://api.github.com/repos/aromm/regular-expressions/commits{/sha}","git_commits_url":"https://api.github.com/repos/aromm/regular-expressions/git/commits{/sha}","comments_url":"https://api.github.com/repos/aromm/regular-expressions/comments{/number}","issue_comment_url":"https://api.github.com/repos/aromm/regular-expressions/issues/comments{/number}","contents_url":"https://api.github.com/repos/aromm/regular-expressions/contents/{+path}","compare_url":"https://api.github.com/repos/aromm/regular-expressions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aromm/regular-expressions/merges","archive_url":"https://api.github.com/repos/aromm/regular-expressions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aromm/regular-expressions/downloads","issues_url":"https://api.github.com/repos/aromm/regular-expressions/issues{/number}","pulls_url":"https://api.github.com/repos/aromm/regular-expressions/pulls{/number}","milestones_url":"https://api.github.com/repos/aromm/regular-expressions/milestones{/number}","notifications_url":"https://api.github.com/repos/aromm/regular-expressions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aromm/regular-expressions/labels{/name}","releases_url":"https://api.github.com/repos/aromm/regular-expressions/releases{/id}","deployments_url":"https://api.github.com/repos/aromm/regular-expressions/deployments","created_at":"2016-10-03T18:20:06Z","updated_at":"2016-10-03T18:20:07Z","pushed_at":"2016-10-06T06:35:57Z","git_url":"git://github.com/aromm/regular-expressions.git","ssh_url":"git@github.com:aromm/regular-expressions.git","clone_url":"https://github.com/aromm/regular-expressions.git","svn_url":"https://github.com/aromm/regular-expressions","homepage":null,"size":17,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"hmc-cs111-fall2016:master","ref":"master","sha":"a3f6d7ce17ef384f1d123e97fab6bbe052177e60","user":{"login":"hmc-cs111-fall2016","id":20343278,"avatar_url":"https://avatars.githubusercontent.com/u/20343278?v=3","gravatar_id":"","url":"https://api.github.com/users/hmc-cs111-fall2016","html_url":"https://github.com/hmc-cs111-fall2016","followers_url":"https://api.github.com/users/hmc-cs111-fall2016/followers","following_url":"https://api.github.com/users/hmc-cs111-fall2016/following{/other_user}","gists_url":"https://api.github.com/users/hmc-cs111-fall2016/gists{/gist_id}","starred_url":"https://api.github.com/users/hmc-cs111-fall2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmc-cs111-fall2016/subscriptions","organizations_url":"https://api.github.com/users/hmc-cs111-fall2016/orgs","repos_url":"https://api.github.com/users/hmc-cs111-fall2016/repos","events_url":"https://api.github.com/users/hmc-cs111-fall2016/events{/privacy}","received_events_url":"https://api.github.com/users/hmc-cs111-fall2016/received_events","type":"Organization","site_admin":false},"repo":{"id":69595769,"name":"regular-expressions","full_name":"hmc-cs111-fall2016/regular-expressions","owner":{"login":"hmc-cs111-fall2016","id":20343278,"avatar_url":"https://avatars.githubusercontent.com/u/20343278?v=3","gravatar_id":"","url":"https://api.github.com/users/hmc-cs111-fall2016","html_url":"https://github.com/hmc-cs111-fall2016","followers_url":"https://api.github.com/users/hmc-cs111-fall2016/followers","following_url":"https://api.github.com/users/hmc-cs111-fall2016/following{/other_user}","gists_url":"https://api.github.com/users/hmc-cs111-fall2016/gists{/gist_id}","starred_url":"https://api.github.com/users/hmc-cs111-fall2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmc-cs111-fall2016/subscriptions","organizations_url":"https://api.github.com/users/hmc-cs111-fall2016/orgs","repos_url":"https://api.github.com/users/hmc-cs111-fall2016/repos","events_url":"https://api.github.com/users/hmc-cs111-fall2016/events{/privacy}","received_events_url":"https://api.github.com/users/hmc-cs111-fall2016/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmc-cs111-fall2016/regular-expressions","description":"Assignment 5: implementing regular expressions as an internal DSL","fork":false,"url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions","forks_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/forks","keys_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/teams","hooks_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/hooks","issue_events_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/issues/events{/number}","events_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/events","assignees_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/assignees{/user}","branches_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/branches{/branch}","tags_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/tags","blobs_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/statuses/{sha}","languages_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/languages","stargazers_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/stargazers","contributors_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/contributors","subscribers_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/subscribers","subscription_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/subscription","commits_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/contents/{+path}","compare_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/merges","archive_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/downloads","issues_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/issues{/number}","pulls_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls{/number}","milestones_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/milestones{/number}","notifications_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/labels{/name}","releases_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/releases{/id}","deployments_url":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/deployments","created_at":"2016-09-29T18:26:14Z","updated_at":"2016-10-01T03:08:39Z","pushed_at":"2016-10-06T23:18:30Z","git_url":"git://github.com/hmc-cs111-fall2016/regular-expressions.git","ssh_url":"git@github.com:hmc-cs111-fall2016/regular-expressions.git","clone_url":"https://github.com/hmc-cs111-fall2016/regular-expressions.git","svn_url":"https://github.com/hmc-cs111-fall2016/regular-expressions","homepage":null,"size":74,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":18,"forks":18,"open_issues":18,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/16"},"html":{"href":"https://github.com/hmc-cs111-fall2016/regular-expressions/pull/16"},"issue":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/issues/16"},"comments":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/hmc-cs111-fall2016/regular-expressions/statuses/592d9ebbbb34cd2641374a0421ed0b46fb1d5e6b"}}}}
{"actor":{"display_login":"farhanatt"}}