{"action":"created","comment":{"url":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/comments/26094474","id":26094474,"diff_hunk":"@@ -0,0 +1,36 @@\n+* = import Manifold.core\n+* = import Manifold.digital\n+\n+Type TrafficLight = (\n+\tgreen:Boolean  = false,\n+\tyellow:Boolean = false,\n+\tred:Boolean    = false\n+)\n+\n+GREEN_SECONDS  = 10\n+YELLOW_SECONDS = 3\n+TOTAL_SECONDS  = 2 * (GREEN_SECONDS + YELLOW_SECONDS)\n+\n+seconds = Manifold.Digital.count(hz: 1, mod: TOTAL_SECONDS)\n+\n+if (seconds < GREEN_SECONDS) {\n+  north_light = south_light = (green: true)\n+  east_light = west_light = (red: true)\n+\n+} else if (seconds < GREEN_SECONDS + YELLOW_SECONDS) {\n+  north_light = south_light = (yellow: true)\n+  east_light = west_light = (red: true)\n+\n+} else if (seconds < GREEN_SECONDS + YELLOW_SECONDS + GREEN_SECONDS) {\n+  north_light = south_light = (red: true)\n+  east_light = west_light = (green: true)\n+\n+} else {\n+  north_light = south_light = (red: true)\n+  east_light = west_light = (yellow: true)\n+}\n+\n+Manifold.Digital.led[0..3]  = TrafficLight north_light","path":"examples/traffic-light.manifold","position":33,"original_position":33,"commit_id":"c48fd788b8b8027b09f08a4a607b58011edd30a3","original_commit_id":"c48fd788b8b8027b09f08a4a607b58011edd30a3","user":{"login":"lucaswoj","id":281306,"avatar_url":"https://avatars.githubusercontent.com/u/281306?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswoj","html_url":"https://github.com/lucaswoj","followers_url":"https://api.github.com/users/lucaswoj/followers","following_url":"https://api.github.com/users/lucaswoj/following{/other_user}","gists_url":"https://api.github.com/users/lucaswoj/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswoj/subscriptions","organizations_url":"https://api.github.com/users/lucaswoj/orgs","repos_url":"https://api.github.com/users/lucaswoj/repos","events_url":"https://api.github.com/users/lucaswoj/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswoj/received_events","type":"User","site_admin":false},"body":"In some (most?) languages, the `..` operator indicates the end index is exclusive and the `...` operator indicates the end index is inclusive. ","created_at":"2015-03-10T02:11:53Z","updated_at":"2015-03-10T02:11:53Z","html_url":"https://github.com/manifold-lang/manifold-frontend/pull/67#discussion_r26094474","pull_request_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/comments/26094474"},"html":{"href":"https://github.com/manifold-lang/manifold-frontend/pull/67#discussion_r26094474"},"pull_request":{"href":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/67","id":30121043,"html_url":"https://github.com/manifold-lang/manifold-frontend/pull/67","diff_url":"https://github.com/manifold-lang/manifold-frontend/pull/67.diff","patch_url":"https://github.com/manifold-lang/manifold-frontend/pull/67.patch","issue_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/issues/67","number":67,"state":"open","locked":false,"title":"Traffic light example","user":{"login":"lucaswoj","id":281306,"avatar_url":"https://avatars.githubusercontent.com/u/281306?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswoj","html_url":"https://github.com/lucaswoj","followers_url":"https://api.github.com/users/lucaswoj/followers","following_url":"https://api.github.com/users/lucaswoj/following{/other_user}","gists_url":"https://api.github.com/users/lucaswoj/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswoj/subscriptions","organizations_url":"https://api.github.com/users/lucaswoj/orgs","repos_url":"https://api.github.com/users/lucaswoj/repos","events_url":"https://api.github.com/users/lucaswoj/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswoj/received_events","type":"User","site_admin":false},"body":"Attached is an example for a simple traffic light control system in Manifold, using many features of the spec (some of which are unimplemented). I hope this PR can be a good platform for discussion! More complex programs to follow.","created_at":"2015-02-26T22:01:22Z","updated_at":"2015-03-10T02:11:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fa05a70dfaa93b393c434a7610ba4710e379791","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/67/commits","review_comments_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/67/comments","review_comment_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/issues/67/comments","statuses_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/statuses/c48fd788b8b8027b09f08a4a607b58011edd30a3","head":{"label":"manifold-lang:example","ref":"example","sha":"c48fd788b8b8027b09f08a4a607b58011edd30a3","user":{"login":"manifold-lang","id":7672984,"avatar_url":"https://avatars.githubusercontent.com/u/7672984?v=3","gravatar_id":"","url":"https://api.github.com/users/manifold-lang","html_url":"https://github.com/manifold-lang","followers_url":"https://api.github.com/users/manifold-lang/followers","following_url":"https://api.github.com/users/manifold-lang/following{/other_user}","gists_url":"https://api.github.com/users/manifold-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/manifold-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manifold-lang/subscriptions","organizations_url":"https://api.github.com/users/manifold-lang/orgs","repos_url":"https://api.github.com/users/manifold-lang/repos","events_url":"https://api.github.com/users/manifold-lang/events{/privacy}","received_events_url":"https://api.github.com/users/manifold-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":23838886,"name":"manifold-frontend","full_name":"manifold-lang/manifold-frontend","owner":{"login":"manifold-lang","id":7672984,"avatar_url":"https://avatars.githubusercontent.com/u/7672984?v=3","gravatar_id":"","url":"https://api.github.com/users/manifold-lang","html_url":"https://github.com/manifold-lang","followers_url":"https://api.github.com/users/manifold-lang/followers","following_url":"https://api.github.com/users/manifold-lang/following{/other_user}","gists_url":"https://api.github.com/users/manifold-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/manifold-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manifold-lang/subscriptions","organizations_url":"https://api.github.com/users/manifold-lang/orgs","repos_url":"https://api.github.com/users/manifold-lang/repos","events_url":"https://api.github.com/users/manifold-lang/events{/privacy}","received_events_url":"https://api.github.com/users/manifold-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/manifold-lang/manifold-frontend","description":"Frontend compiler for Manifold high-level language","fork":false,"url":"https://api.github.com/repos/manifold-lang/manifold-frontend","forks_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/forks","keys_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/teams","hooks_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/hooks","issue_events_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/events","assignees_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/tags","blobs_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/languages","stargazers_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/stargazers","contributors_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/contributors","subscribers_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/subscribers","subscription_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/subscription","commits_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/merges","archive_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/downloads","issues_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/labels{/name}","releases_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/releases{/id}","created_at":"2014-09-09T15:20:34Z","updated_at":"2015-03-09T19:50:57Z","pushed_at":"2015-03-09T19:50:57Z","git_url":"git://github.com/manifold-lang/manifold-frontend.git","ssh_url":"git@github.com:manifold-lang/manifold-frontend.git","clone_url":"https://github.com/manifold-lang/manifold-frontend.git","svn_url":"https://github.com/manifold-lang/manifold-frontend","homepage":null,"size":1028,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":42,"forks":3,"open_issues":42,"watchers":0,"default_branch":"master"}},"base":{"label":"manifold-lang:master","ref":"master","sha":"fd363f9fdf1545741a3faba218b7e911665f392d","user":{"login":"manifold-lang","id":7672984,"avatar_url":"https://avatars.githubusercontent.com/u/7672984?v=3","gravatar_id":"","url":"https://api.github.com/users/manifold-lang","html_url":"https://github.com/manifold-lang","followers_url":"https://api.github.com/users/manifold-lang/followers","following_url":"https://api.github.com/users/manifold-lang/following{/other_user}","gists_url":"https://api.github.com/users/manifold-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/manifold-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manifold-lang/subscriptions","organizations_url":"https://api.github.com/users/manifold-lang/orgs","repos_url":"https://api.github.com/users/manifold-lang/repos","events_url":"https://api.github.com/users/manifold-lang/events{/privacy}","received_events_url":"https://api.github.com/users/manifold-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":23838886,"name":"manifold-frontend","full_name":"manifold-lang/manifold-frontend","owner":{"login":"manifold-lang","id":7672984,"avatar_url":"https://avatars.githubusercontent.com/u/7672984?v=3","gravatar_id":"","url":"https://api.github.com/users/manifold-lang","html_url":"https://github.com/manifold-lang","followers_url":"https://api.github.com/users/manifold-lang/followers","following_url":"https://api.github.com/users/manifold-lang/following{/other_user}","gists_url":"https://api.github.com/users/manifold-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/manifold-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manifold-lang/subscriptions","organizations_url":"https://api.github.com/users/manifold-lang/orgs","repos_url":"https://api.github.com/users/manifold-lang/repos","events_url":"https://api.github.com/users/manifold-lang/events{/privacy}","received_events_url":"https://api.github.com/users/manifold-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/manifold-lang/manifold-frontend","description":"Frontend compiler for Manifold high-level language","fork":false,"url":"https://api.github.com/repos/manifold-lang/manifold-frontend","forks_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/forks","keys_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/teams","hooks_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/hooks","issue_events_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/events","assignees_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/tags","blobs_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/languages","stargazers_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/stargazers","contributors_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/contributors","subscribers_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/subscribers","subscription_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/subscription","commits_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/merges","archive_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/downloads","issues_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/labels{/name}","releases_url":"https://api.github.com/repos/manifold-lang/manifold-frontend/releases{/id}","created_at":"2014-09-09T15:20:34Z","updated_at":"2015-03-09T19:50:57Z","pushed_at":"2015-03-09T19:50:57Z","git_url":"git://github.com/manifold-lang/manifold-frontend.git","ssh_url":"git@github.com:manifold-lang/manifold-frontend.git","clone_url":"https://github.com/manifold-lang/manifold-frontend.git","svn_url":"https://github.com/manifold-lang/manifold-frontend","homepage":null,"size":1028,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":42,"forks":3,"open_issues":42,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/67"},"html":{"href":"https://github.com/manifold-lang/manifold-frontend/pull/67"},"issue":{"href":"https://api.github.com/repos/manifold-lang/manifold-frontend/issues/67"},"comments":{"href":"https://api.github.com/repos/manifold-lang/manifold-frontend/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/manifold-lang/manifold-frontend/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/manifold-lang/manifold-frontend/statuses/c48fd788b8b8027b09f08a4a607b58011edd30a3"}}}}