{"action":"created","comment":{"url":"https://api.github.com/repos/smarr/SOMns/pulls/comments/114944427","pull_request_review_id":36445878,"id":114944427,"diff_hunk":"@@ -18,24 +18,54 @@\n \n public abstract class LexicalScope {\n \n+  private final LexicalScope outer;\n+\n+  public LexicalScope(final LexicalScope outer) {\n+    this.outer = outer;\n+  }\n+\n+  public LexicalScope getContextualScope() {\n+    return outer;\n+  }\n+\n+  public MixinScope getOuterScope() {\n+    LexicalScope next = getContextualScope();\n+    while (!(next instanceof MixinScope)) {\n+      if (next == null) {\n+        return null;\n+      }\n+\n+      next = next.getContextualScope();\n+    }\n+    return (MixinScope) next;\n+  }\n+\n+  public MethodScope getNextMethodScope() {\n+    LexicalScope next = getContextualScope();\n+    while (!(next instanceof MethodScope)) {\n+      if (next == null) {\n+        return null;\n+      }\n+\n+      next = next.getContextualScope();\n+    }\n+    return (MethodScope) next;\n+  }\n+\n+  public MixinDefinition getOuterMixin() {\n+    return getOuterScope().mixinDefinition;\n+  }\n+\n   // TODO: figure out whether we can use this lexical scope also for the\n   //       super sends. seems like we currently have two similar ways to solve\n   //       similar problems, instead of a single one\n   public static final class MixinScope extends LexicalScope {\n-    private final MixinScope outerMixin;\n     private HashMap<SSymbol, Dispatchable> slotsClassesAndMethods;\n \n     @CompilationFinal private MixinDefinition mixinDefinition;\n \n-    public MixinScope(final MixinScope outerMixin) {\n-      this.outerMixin = outerMixin;\n-    }\n-\n-    public MixinDefinition getOuter() {\n-      if (outerMixin != null) {\n-        return outerMixin.mixinDefinition;\n-      }\n-      return null;\n+    public MixinScope(final LexicalScope contextualScope) {","path":"src/som/interpreter/LexicalScope.java","position":60,"original_position":60,"commit_id":"6015f38657ac681e05df92d057fef92b3f123155","original_commit_id":"6015f38657ac681e05df92d057fef92b3f123155","user":{"login":"smarr","id":40815,"avatar_url":"https://avatars3.githubusercontent.com/u/40815?v=3","gravatar_id":"","url":"https://api.github.com/users/smarr","html_url":"https://github.com/smarr","followers_url":"https://api.github.com/users/smarr/followers","following_url":"https://api.github.com/users/smarr/following{/other_user}","gists_url":"https://api.github.com/users/smarr/gists{/gist_id}","starred_url":"https://api.github.com/users/smarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarr/subscriptions","organizations_url":"https://api.github.com/users/smarr/orgs","repos_url":"https://api.github.com/users/smarr/repos","events_url":"https://api.github.com/users/smarr/events{/privacy}","received_events_url":"https://api.github.com/users/smarr/received_events","type":"User","site_admin":false},"body":"context vs. contextual?","created_at":"2017-05-05T07:40:17Z","updated_at":"2017-05-05T07:45:21Z","html_url":"https://github.com/smarr/SOMns/pull/146#discussion_r114944427","pull_request_url":"https://api.github.com/repos/smarr/SOMns/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/smarr/SOMns/pulls/comments/114944427"},"html":{"href":"https://github.com/smarr/SOMns/pull/146#discussion_r114944427"},"pull_request":{"href":"https://api.github.com/repos/smarr/SOMns/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/smarr/SOMns/pulls/146","id":119092847,"html_url":"https://github.com/smarr/SOMns/pull/146","diff_url":"https://github.com/smarr/SOMns/pull/146.diff","patch_url":"https://github.com/smarr/SOMns/pull/146.patch","issue_url":"https://api.github.com/repos/smarr/SOMns/issues/146","number":146,"state":"open","locked":false,"title":"Abstract lexical constructs (preparation for Object Literals)","user":{"login":"richard-roberts","id":14899134,"avatar_url":"https://avatars0.githubusercontent.com/u/14899134?v=3","gravatar_id":"","url":"https://api.github.com/users/richard-roberts","html_url":"https://github.com/richard-roberts","followers_url":"https://api.github.com/users/richard-roberts/followers","following_url":"https://api.github.com/users/richard-roberts/following{/other_user}","gists_url":"https://api.github.com/users/richard-roberts/gists{/gist_id}","starred_url":"https://api.github.com/users/richard-roberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richard-roberts/subscriptions","organizations_url":"https://api.github.com/users/richard-roberts/orgs","repos_url":"https://api.github.com/users/richard-roberts/repos","events_url":"https://api.github.com/users/richard-roberts/events{/privacy}","received_events_url":"https://api.github.com/users/richard-roberts/received_events","type":"User","site_admin":false},"body":"In order to enable a cleaner implementation of object literals I have generalised the behaviour for the nesting of lexical constructs. In particular, I have introduced a new `LexicalBuilder` superclass, of which `MethodBuilder` and `MixinBuilder` are subclasses.\r\n\r\nLexicalBuilder builders can be nested arbitrarily. By relaxing the nesting in this way, it will be simpler to reuse `MixinBuilder`s to implement objects literals (issue #86, which requires `MixinBuilder`s to be nested inside of `MethodBuilder`s).\r\n\r\nBeyond enabling a simpler implementation for object literals, these changes remove the need for builders to keep a reference to both the outer self (in the sense of the containing object) and the contextual self - now only the contextual self is needed. Similar changes have been implemented in the `LexicalScope` construct.\r\n\r\nFinally, the introduction of the `SObjectWithContext` provides an single interface for interacting with VM objects that have a context. Currently the only implementor of this context is `SBlock`, but soon to be joined by `SObjectWithClass` to enable object literals.","created_at":"2017-05-05T00:27:57Z","updated_at":"2017-05-05T07:45:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0da5d59edddbb66fcc70d224d83d122013d5bb7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/smarr/SOMns/pulls/146/commits","review_comments_url":"https://api.github.com/repos/smarr/SOMns/pulls/146/comments","review_comment_url":"https://api.github.com/repos/smarr/SOMns/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smarr/SOMns/issues/146/comments","statuses_url":"https://api.github.com/repos/smarr/SOMns/statuses/6015f38657ac681e05df92d057fef92b3f123155","head":{"label":"richard-roberts:abstract-lexical-constructs","ref":"abstract-lexical-constructs","sha":"6015f38657ac681e05df92d057fef92b3f123155","user":{"login":"richard-roberts","id":14899134,"avatar_url":"https://avatars0.githubusercontent.com/u/14899134?v=3","gravatar_id":"","url":"https://api.github.com/users/richard-roberts","html_url":"https://github.com/richard-roberts","followers_url":"https://api.github.com/users/richard-roberts/followers","following_url":"https://api.github.com/users/richard-roberts/following{/other_user}","gists_url":"https://api.github.com/users/richard-roberts/gists{/gist_id}","starred_url":"https://api.github.com/users/richard-roberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richard-roberts/subscriptions","organizations_url":"https://api.github.com/users/richard-roberts/orgs","repos_url":"https://api.github.com/users/richard-roberts/repos","events_url":"https://api.github.com/users/richard-roberts/events{/privacy}","received_events_url":"https://api.github.com/users/richard-roberts/received_events","type":"User","site_admin":false},"repo":{"id":78785333,"name":"SOMns","full_name":"richard-roberts/SOMns","owner":{"login":"richard-roberts","id":14899134,"avatar_url":"https://avatars0.githubusercontent.com/u/14899134?v=3","gravatar_id":"","url":"https://api.github.com/users/richard-roberts","html_url":"https://github.com/richard-roberts","followers_url":"https://api.github.com/users/richard-roberts/followers","following_url":"https://api.github.com/users/richard-roberts/following{/other_user}","gists_url":"https://api.github.com/users/richard-roberts/gists{/gist_id}","starred_url":"https://api.github.com/users/richard-roberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richard-roberts/subscriptions","organizations_url":"https://api.github.com/users/richard-roberts/orgs","repos_url":"https://api.github.com/users/richard-roberts/repos","events_url":"https://api.github.com/users/richard-roberts/events{/privacy}","received_events_url":"https://api.github.com/users/richard-roberts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/richard-roberts/SOMns","description":"SOMns is a Simple Newspeak Implementation focusing on Concurrency Features","fork":true,"url":"https://api.github.com/repos/richard-roberts/SOMns","forks_url":"https://api.github.com/repos/richard-roberts/SOMns/forks","keys_url":"https://api.github.com/repos/richard-roberts/SOMns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/richard-roberts/SOMns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/richard-roberts/SOMns/teams","hooks_url":"https://api.github.com/repos/richard-roberts/SOMns/hooks","issue_events_url":"https://api.github.com/repos/richard-roberts/SOMns/issues/events{/number}","events_url":"https://api.github.com/repos/richard-roberts/SOMns/events","assignees_url":"https://api.github.com/repos/richard-roberts/SOMns/assignees{/user}","branches_url":"https://api.github.com/repos/richard-roberts/SOMns/branches{/branch}","tags_url":"https://api.github.com/repos/richard-roberts/SOMns/tags","blobs_url":"https://api.github.com/repos/richard-roberts/SOMns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/richard-roberts/SOMns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/richard-roberts/SOMns/git/refs{/sha}","trees_url":"https://api.github.com/repos/richard-roberts/SOMns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/richard-roberts/SOMns/statuses/{sha}","languages_url":"https://api.github.com/repos/richard-roberts/SOMns/languages","stargazers_url":"https://api.github.com/repos/richard-roberts/SOMns/stargazers","contributors_url":"https://api.github.com/repos/richard-roberts/SOMns/contributors","subscribers_url":"https://api.github.com/repos/richard-roberts/SOMns/subscribers","subscription_url":"https://api.github.com/repos/richard-roberts/SOMns/subscription","commits_url":"https://api.github.com/repos/richard-roberts/SOMns/commits{/sha}","git_commits_url":"https://api.github.com/repos/richard-roberts/SOMns/git/commits{/sha}","comments_url":"https://api.github.com/repos/richard-roberts/SOMns/comments{/number}","issue_comment_url":"https://api.github.com/repos/richard-roberts/SOMns/issues/comments{/number}","contents_url":"https://api.github.com/repos/richard-roberts/SOMns/contents/{+path}","compare_url":"https://api.github.com/repos/richard-roberts/SOMns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/richard-roberts/SOMns/merges","archive_url":"https://api.github.com/repos/richard-roberts/SOMns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/richard-roberts/SOMns/downloads","issues_url":"https://api.github.com/repos/richard-roberts/SOMns/issues{/number}","pulls_url":"https://api.github.com/repos/richard-roberts/SOMns/pulls{/number}","milestones_url":"https://api.github.com/repos/richard-roberts/SOMns/milestones{/number}","notifications_url":"https://api.github.com/repos/richard-roberts/SOMns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/richard-roberts/SOMns/labels{/name}","releases_url":"https://api.github.com/repos/richard-roberts/SOMns/releases{/id}","deployments_url":"https://api.github.com/repos/richard-roberts/SOMns/deployments","created_at":"2017-01-12T20:43:49Z","updated_at":"2017-01-12T20:43:53Z","pushed_at":"2017-05-05T05:52:43Z","git_url":"git://github.com/richard-roberts/SOMns.git","ssh_url":"git@github.com:richard-roberts/SOMns.git","clone_url":"https://github.com/richard-roberts/SOMns.git","svn_url":"https://github.com/richard-roberts/SOMns","homepage":"","size":8320,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"smarr:master","ref":"master","sha":"3ed3c17d4dad30667b9f227219841aa2dccb48f3","user":{"login":"smarr","id":40815,"avatar_url":"https://avatars3.githubusercontent.com/u/40815?v=3","gravatar_id":"","url":"https://api.github.com/users/smarr","html_url":"https://github.com/smarr","followers_url":"https://api.github.com/users/smarr/followers","following_url":"https://api.github.com/users/smarr/following{/other_user}","gists_url":"https://api.github.com/users/smarr/gists{/gist_id}","starred_url":"https://api.github.com/users/smarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarr/subscriptions","organizations_url":"https://api.github.com/users/smarr/orgs","repos_url":"https://api.github.com/users/smarr/repos","events_url":"https://api.github.com/users/smarr/events{/privacy}","received_events_url":"https://api.github.com/users/smarr/received_events","type":"User","site_admin":false},"repo":{"id":35489534,"name":"SOMns","full_name":"smarr/SOMns","owner":{"login":"smarr","id":40815,"avatar_url":"https://avatars3.githubusercontent.com/u/40815?v=3","gravatar_id":"","url":"https://api.github.com/users/smarr","html_url":"https://github.com/smarr","followers_url":"https://api.github.com/users/smarr/followers","following_url":"https://api.github.com/users/smarr/following{/other_user}","gists_url":"https://api.github.com/users/smarr/gists{/gist_id}","starred_url":"https://api.github.com/users/smarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarr/subscriptions","organizations_url":"https://api.github.com/users/smarr/orgs","repos_url":"https://api.github.com/users/smarr/repos","events_url":"https://api.github.com/users/smarr/events{/privacy}","received_events_url":"https://api.github.com/users/smarr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smarr/SOMns","description":"SOMns: A Newspeak for Concurrency Research","fork":false,"url":"https://api.github.com/repos/smarr/SOMns","forks_url":"https://api.github.com/repos/smarr/SOMns/forks","keys_url":"https://api.github.com/repos/smarr/SOMns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smarr/SOMns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smarr/SOMns/teams","hooks_url":"https://api.github.com/repos/smarr/SOMns/hooks","issue_events_url":"https://api.github.com/repos/smarr/SOMns/issues/events{/number}","events_url":"https://api.github.com/repos/smarr/SOMns/events","assignees_url":"https://api.github.com/repos/smarr/SOMns/assignees{/user}","branches_url":"https://api.github.com/repos/smarr/SOMns/branches{/branch}","tags_url":"https://api.github.com/repos/smarr/SOMns/tags","blobs_url":"https://api.github.com/repos/smarr/SOMns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smarr/SOMns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smarr/SOMns/git/refs{/sha}","trees_url":"https://api.github.com/repos/smarr/SOMns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smarr/SOMns/statuses/{sha}","languages_url":"https://api.github.com/repos/smarr/SOMns/languages","stargazers_url":"https://api.github.com/repos/smarr/SOMns/stargazers","contributors_url":"https://api.github.com/repos/smarr/SOMns/contributors","subscribers_url":"https://api.github.com/repos/smarr/SOMns/subscribers","subscription_url":"https://api.github.com/repos/smarr/SOMns/subscription","commits_url":"https://api.github.com/repos/smarr/SOMns/commits{/sha}","git_commits_url":"https://api.github.com/repos/smarr/SOMns/git/commits{/sha}","comments_url":"https://api.github.com/repos/smarr/SOMns/comments{/number}","issue_comment_url":"https://api.github.com/repos/smarr/SOMns/issues/comments{/number}","contents_url":"https://api.github.com/repos/smarr/SOMns/contents/{+path}","compare_url":"https://api.github.com/repos/smarr/SOMns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smarr/SOMns/merges","archive_url":"https://api.github.com/repos/smarr/SOMns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smarr/SOMns/downloads","issues_url":"https://api.github.com/repos/smarr/SOMns/issues{/number}","pulls_url":"https://api.github.com/repos/smarr/SOMns/pulls{/number}","milestones_url":"https://api.github.com/repos/smarr/SOMns/milestones{/number}","notifications_url":"https://api.github.com/repos/smarr/SOMns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smarr/SOMns/labels{/name}","releases_url":"https://api.github.com/repos/smarr/SOMns/releases{/id}","deployments_url":"https://api.github.com/repos/smarr/SOMns/deployments","created_at":"2015-05-12T13:27:56Z","updated_at":"2017-03-27T18:32:55Z","pushed_at":"2017-05-05T01:08:57Z","git_url":"git://github.com/smarr/SOMns.git","ssh_url":"git@github.com:smarr/SOMns.git","clone_url":"https://github.com/smarr/SOMns.git","svn_url":"https://github.com/smarr/SOMns","homepage":"","size":8153,"stargazers_count":13,"watchers_count":13,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":36,"forks":8,"open_issues":36,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/smarr/SOMns/pulls/146"},"html":{"href":"https://github.com/smarr/SOMns/pull/146"},"issue":{"href":"https://api.github.com/repos/smarr/SOMns/issues/146"},"comments":{"href":"https://api.github.com/repos/smarr/SOMns/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/smarr/SOMns/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/smarr/SOMns/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smarr/SOMns/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/smarr/SOMns/statuses/6015f38657ac681e05df92d057fef92b3f123155"}}}}
{"actor":{"display_login":"smarr"}}