GitHub PullRequestReviewCommentEvent at 2014-09-16 19:10:34
Repository: metapolator
Actor: rrthomas
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/metapolator/metapolator/pulls/comments/17623640","id":17623640,"diff_hunk":"@@ -142,7 +53,119 @@ define([\n                 return value;\n         }\n         return null;\n-    }\n-    \n+    };\n+\n+    /**\n+     * Returns a ParameterValue instance\n+     * Raises KeyError if name is not registered in the parameterRegistry\n+     * of the controller.\n+     * Raises CPSKeyNotFoundError if there is no entry for name in CPS.\n+     * The CPSKeyNotFoundError may be used to create a cascading system\n+     * of StyleDict interfaces.\n+     *\n+     */\n+    _p._getParameter = function(name) {\n+        var cpsParameterValue = this._getCPSParameterValue(name);\n+        if(cpsParameterValue === null)\n+            throw new CPSKeyNotFoundError(name);\n+        return cpsParameterValue.factory(name, this._element, this.getAPI);\n+    };\n+\n+    /**\n+     * Return the value of a ParameterValue instance.\n+     * Raises KeyError and CPSKeyNotFoundError, see this._getParameter\n+     * for a description.\n+     *\n+     * This caches the result of this._getParameter which might become\n+     * problematic, because we'll have to invalidate the cached values.\n+     * If that proves to be hard, we should maybe skip the caching first\n+     * and see later how to make cache invalidation possible.\n+     * Not caching the value means that we get a different instance\n+     * for each call to this function, not perfect either.\n+     * ReferenceDict has a similar situation in its get method.\n+     */\n+    _p.getParameter = function(name) {\n+        // this is a caching mechanism, this might be harmful, because we\n+        // create a cache that needs invalidation from time to time.\n+        //  Maybe the\n+        // position of the cache could change?\n+        if(!(name in this._cache))\n+            this._cache[name] = this._getParameter(name);\n+        return this._cache[name]\n+                // using get value to at least remind me why I had\n+                // the instance cached,not the result of the parameter\n+                // calculation\n+                .getValue();\n+    };\n+\n+    /**\n+     * Return a value for this._element if name is a registered parameter\n+     * type the return value type is checked according to the parameter\n+     * type.\n+     *\n+     * ALso, as an exception: \"this\" will always return the MOM Element\n+     * of this StyleDict (return this._element).\n+     *\n+     * If name is no registered parameter type the @dictionary rules for\n+     * this element is are queried.\n+     *\n+     * If name is not an @dictionary parameter, it is queried on element\n+     * itself.\n+     *\n+     * If name is no registered parameter type, the return value may be\n+     * anything that is accessible or constructable from CPSformulae and\n+     * also a white-listed value on any reachable element.\n+     *\n+     * This API tries three sources of data:\n+     *    if name is a registered Parameter name\n+     *          this.getParameter(name); // raises CPSKeyNotFoundError if not defined\n+     *    else\n+     *          1. ReferenceDictionary: this._controller\n+     *                                .getReferenceDictionary(this._element)\n+     *                                .get(name);\n+     *          2. this._element[name] // needs propper whitelisting","path":"app/lib/models/CPS/StyleDict.js","position":226,"original_position":226,"commit_id":"0d0c2baa81af2ce0c32278d7f11dec3658250c9f","original_commit_id":"0d0c2baa81af2ce0c32278d7f11dec3658250c9f","user":{"login":"rrthomas","id":17382,"avatar_url":"https://avatars.githubusercontent.com/u/17382?v=2","gravatar_id":"f8d54f1ebed62ca2cf9092c3749d8b76","url":"https://api.github.com/users/rrthomas","html_url":"https://github.com/rrthomas","followers_url":"https://api.github.com/users/rrthomas/followers","following_url":"https://api.github.com/users/rrthomas/following{/other_user}","gists_url":"https://api.github.com/users/rrthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/rrthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrthomas/subscriptions","organizations_url":"https://api.github.com/users/rrthomas/orgs","repos_url":"https://api.github.com/users/rrthomas/repos","events_url":"https://api.github.com/users/rrthomas/events{/privacy}","received_events_url":"https://api.github.com/users/rrthomas/received_events","type":"User","site_admin":false},"body":"\"proper\"","created_at":"2014-09-16T19:10:34Z","updated_at":"2014-09-16T19:10:34Z","html_url":"https://github.com/metapolator/metapolator/pull/160#discussion_r17623640","pull_request_url":"https://api.github.com/repos/metapolator/metapolator/pulls/160","_links":{"self":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/comments/17623640"},"html":{"href":"https://github.com/metapolator/metapolator/pull/160#discussion_r17623640"},"pull_request":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/160"}}},"pull_request":{"url":"https://api.github.com/repos/metapolator/metapolator/pulls/160","id":21252347,"html_url":"https://github.com/metapolator/metapolator/pull/160","diff_url":"https://github.com/metapolator/metapolator/pull/160.diff","patch_url":"https://github.com/metapolator/metapolator/pull/160.patch","issue_url":"https://api.github.com/repos/metapolator/metapolator/issues/160","number":160,"state":"open","locked":false,"title":"new formulae language implementation","user":{"login":"graphicore","id":393132,"avatar_url":"https://avatars.githubusercontent.com/u/393132?v=2","gravatar_id":"1f5bd60f6b3e2e3e1e6a81a96f44a9a7","url":"https://api.github.com/users/graphicore","html_url":"https://github.com/graphicore","followers_url":"https://api.github.com/users/graphicore/followers","following_url":"https://api.github.com/users/graphicore/following{/other_user}","gists_url":"https://api.github.com/users/graphicore/gists{/gist_id}","starred_url":"https://api.github.com/users/graphicore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphicore/subscriptions","organizations_url":"https://api.github.com/users/graphicore/orgs","repos_url":"https://api.github.com/users/graphicore/repos","events_url":"https://api.github.com/users/graphicore/events{/privacy}","received_events_url":"https://api.github.com/users/graphicore/received_events","type":"User","site_admin":false},"body":"unified language and parser for the registered types  'vector' and 'real' and @dictionary parameters\r\nreferenceing of values across cps rules/@dictionaries etc\r\ntransformation matrices\r\nPolar vector constructor\r\nupdated importer that saves onDir and onLength\r\ngot rid of a lot old code\r\netc.\r\n","created_at":"2014-09-15T18:52:54Z","updated_at":"2014-09-16T19:10:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c49e373869c5be4c9f5069fe25a7531badf2691","assignee":{"login":"rrthomas","id":17382,"avatar_url":"https://avatars.githubusercontent.com/u/17382?v=2","gravatar_id":"f8d54f1ebed62ca2cf9092c3749d8b76","url":"https://api.github.com/users/rrthomas","html_url":"https://github.com/rrthomas","followers_url":"https://api.github.com/users/rrthomas/followers","following_url":"https://api.github.com/users/rrthomas/following{/other_user}","gists_url":"https://api.github.com/users/rrthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/rrthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrthomas/subscriptions","organizations_url":"https://api.github.com/users/rrthomas/orgs","repos_url":"https://api.github.com/users/rrthomas/repos","events_url":"https://api.github.com/users/rrthomas/events{/privacy}","received_events_url":"https://api.github.com/users/rrthomas/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/metapolator/metapolator/pulls/160/commits","review_comments_url":"https://api.github.com/repos/metapolator/metapolator/pulls/160/comments","review_comment_url":"https://api.github.com/repos/metapolator/metapolator/pulls/comments/{number}","comments_url":"https://api.github.com/repos/metapolator/metapolator/issues/160/comments","statuses_url":"https://api.github.com/repos/metapolator/metapolator/statuses/0d0c2baa81af2ce0c32278d7f11dec3658250c9f","head":{"label":"graphicore:vector-magintude-dir","ref":"vector-magintude-dir","sha":"0d0c2baa81af2ce0c32278d7f11dec3658250c9f","user":{"login":"graphicore","id":393132,"avatar_url":"https://avatars.githubusercontent.com/u/393132?v=2","gravatar_id":"1f5bd60f6b3e2e3e1e6a81a96f44a9a7","url":"https://api.github.com/users/graphicore","html_url":"https://github.com/graphicore","followers_url":"https://api.github.com/users/graphicore/followers","following_url":"https://api.github.com/users/graphicore/following{/other_user}","gists_url":"https://api.github.com/users/graphicore/gists{/gist_id}","starred_url":"https://api.github.com/users/graphicore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphicore/subscriptions","organizations_url":"https://api.github.com/users/graphicore/orgs","repos_url":"https://api.github.com/users/graphicore/repos","events_url":"https://api.github.com/users/graphicore/events{/privacy}","received_events_url":"https://api.github.com/users/graphicore/received_events","type":"User","site_admin":false},"repo":{"id":23322863,"name":"metapolator","full_name":"graphicore/metapolator","owner":{"login":"graphicore","id":393132,"avatar_url":"https://avatars.githubusercontent.com/u/393132?v=2","gravatar_id":"1f5bd60f6b3e2e3e1e6a81a96f44a9a7","url":"https://api.github.com/users/graphicore","html_url":"https://github.com/graphicore","followers_url":"https://api.github.com/users/graphicore/followers","following_url":"https://api.github.com/users/graphicore/following{/other_user}","gists_url":"https://api.github.com/users/graphicore/gists{/gist_id}","starred_url":"https://api.github.com/users/graphicore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphicore/subscriptions","organizations_url":"https://api.github.com/users/graphicore/orgs","repos_url":"https://api.github.com/users/graphicore/repos","events_url":"https://api.github.com/users/graphicore/events{/privacy}","received_events_url":"https://api.github.com/users/graphicore/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/graphicore/metapolator","description":"Design typeface families","fork":true,"url":"https://api.github.com/repos/graphicore/metapolator","forks_url":"https://api.github.com/repos/graphicore/metapolator/forks","keys_url":"https://api.github.com/repos/graphicore/metapolator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphicore/metapolator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphicore/metapolator/teams","hooks_url":"https://api.github.com/repos/graphicore/metapolator/hooks","issue_events_url":"https://api.github.com/repos/graphicore/metapolator/issues/events{/number}","events_url":"https://api.github.com/repos/graphicore/metapolator/events","assignees_url":"https://api.github.com/repos/graphicore/metapolator/assignees{/user}","branches_url":"https://api.github.com/repos/graphicore/metapolator/branches{/branch}","tags_url":"https://api.github.com/repos/graphicore/metapolator/tags","blobs_url":"https://api.github.com/repos/graphicore/metapolator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphicore/metapolator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphicore/metapolator/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphicore/metapolator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphicore/metapolator/statuses/{sha}","languages_url":"https://api.github.com/repos/graphicore/metapolator/languages","stargazers_url":"https://api.github.com/repos/graphicore/metapolator/stargazers","contributors_url":"https://api.github.com/repos/graphicore/metapolator/contributors","subscribers_url":"https://api.github.com/repos/graphicore/metapolator/subscribers","subscription_url":"https://api.github.com/repos/graphicore/metapolator/subscription","commits_url":"https://api.github.com/repos/graphicore/metapolator/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphicore/metapolator/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphicore/metapolator/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphicore/metapolator/issues/comments/{number}","contents_url":"https://api.github.com/repos/graphicore/metapolator/contents/{+path}","compare_url":"https://api.github.com/repos/graphicore/metapolator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphicore/metapolator/merges","archive_url":"https://api.github.com/repos/graphicore/metapolator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphicore/metapolator/downloads","issues_url":"https://api.github.com/repos/graphicore/metapolator/issues{/number}","pulls_url":"https://api.github.com/repos/graphicore/metapolator/pulls{/number}","milestones_url":"https://api.github.com/repos/graphicore/metapolator/milestones{/number}","notifications_url":"https://api.github.com/repos/graphicore/metapolator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphicore/metapolator/labels{/name}","releases_url":"https://api.github.com/repos/graphicore/metapolator/releases{/id}","created_at":"2014-08-25T17:46:22Z","updated_at":"2014-09-15T21:53:58Z","pushed_at":"2014-09-16T12:55:08Z","git_url":"git://github.com/graphicore/metapolator.git","ssh_url":"git@github.com:graphicore/metapolator.git","clone_url":"https://github.com/graphicore/metapolator.git","svn_url":"https://github.com/graphicore/metapolator","homepage":"metapolator.com","size":47279,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"metapolator:master","ref":"master","sha":"ad6ca9ea2aba1b904915400a20d4c3cd34f13f38","user":{"login":"metapolator","id":4283442,"avatar_url":"https://avatars.githubusercontent.com/u/4283442?v=2","gravatar_id":"ae3717c85d169e0d903c8bcab7d2160e","url":"https://api.github.com/users/metapolator","html_url":"https://github.com/metapolator","followers_url":"https://api.github.com/users/metapolator/followers","following_url":"https://api.github.com/users/metapolator/following{/other_user}","gists_url":"https://api.github.com/users/metapolator/gists{/gist_id}","starred_url":"https://api.github.com/users/metapolator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metapolator/subscriptions","organizations_url":"https://api.github.com/users/metapolator/orgs","repos_url":"https://api.github.com/users/metapolator/repos","events_url":"https://api.github.com/users/metapolator/events{/privacy}","received_events_url":"https://api.github.com/users/metapolator/received_events","type":"Organization","site_admin":false},"repo":{"id":9852744,"name":"metapolator","full_name":"metapolator/metapolator","owner":{"login":"metapolator","id":4283442,"avatar_url":"https://avatars.githubusercontent.com/u/4283442?v=2","gravatar_id":"ae3717c85d169e0d903c8bcab7d2160e","url":"https://api.github.com/users/metapolator","html_url":"https://github.com/metapolator","followers_url":"https://api.github.com/users/metapolator/followers","following_url":"https://api.github.com/users/metapolator/following{/other_user}","gists_url":"https://api.github.com/users/metapolator/gists{/gist_id}","starred_url":"https://api.github.com/users/metapolator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metapolator/subscriptions","organizations_url":"https://api.github.com/users/metapolator/orgs","repos_url":"https://api.github.com/users/metapolator/repos","events_url":"https://api.github.com/users/metapolator/events{/privacy}","received_events_url":"https://api.github.com/users/metapolator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metapolator/metapolator","description":"Design typeface families","fork":false,"url":"https://api.github.com/repos/metapolator/metapolator","forks_url":"https://api.github.com/repos/metapolator/metapolator/forks","keys_url":"https://api.github.com/repos/metapolator/metapolator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metapolator/metapolator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metapolator/metapolator/teams","hooks_url":"https://api.github.com/repos/metapolator/metapolator/hooks","issue_events_url":"https://api.github.com/repos/metapolator/metapolator/issues/events{/number}","events_url":"https://api.github.com/repos/metapolator/metapolator/events","assignees_url":"https://api.github.com/repos/metapolator/metapolator/assignees{/user}","branches_url":"https://api.github.com/repos/metapolator/metapolator/branches{/branch}","tags_url":"https://api.github.com/repos/metapolator/metapolator/tags","blobs_url":"https://api.github.com/repos/metapolator/metapolator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metapolator/metapolator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metapolator/metapolator/git/refs{/sha}","trees_url":"https://api.github.com/repos/metapolator/metapolator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metapolator/metapolator/statuses/{sha}","languages_url":"https://api.github.com/repos/metapolator/metapolator/languages","stargazers_url":"https://api.github.com/repos/metapolator/metapolator/stargazers","contributors_url":"https://api.github.com/repos/metapolator/metapolator/contributors","subscribers_url":"https://api.github.com/repos/metapolator/metapolator/subscribers","subscription_url":"https://api.github.com/repos/metapolator/metapolator/subscription","commits_url":"https://api.github.com/repos/metapolator/metapolator/commits{/sha}","git_commits_url":"https://api.github.com/repos/metapolator/metapolator/git/commits{/sha}","comments_url":"https://api.github.com/repos/metapolator/metapolator/comments{/number}","issue_comment_url":"https://api.github.com/repos/metapolator/metapolator/issues/comments/{number}","contents_url":"https://api.github.com/repos/metapolator/metapolator/contents/{+path}","compare_url":"https://api.github.com/repos/metapolator/metapolator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metapolator/metapolator/merges","archive_url":"https://api.github.com/repos/metapolator/metapolator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metapolator/metapolator/downloads","issues_url":"https://api.github.com/repos/metapolator/metapolator/issues{/number}","pulls_url":"https://api.github.com/repos/metapolator/metapolator/pulls{/number}","milestones_url":"https://api.github.com/repos/metapolator/metapolator/milestones{/number}","notifications_url":"https://api.github.com/repos/metapolator/metapolator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metapolator/metapolator/labels{/name}","releases_url":"https://api.github.com/repos/metapolator/metapolator/releases{/id}","created_at":"2013-05-04T10:51:47Z","updated_at":"2014-09-12T16:36:12Z","pushed_at":"2014-09-16T12:52:50Z","git_url":"git://github.com/metapolator/metapolator.git","ssh_url":"git@github.com:metapolator/metapolator.git","clone_url":"https://github.com/metapolator/metapolator.git","svn_url":"https://github.com/metapolator/metapolator","homepage":"metapolator.com","size":62692,"stargazers_count":75,"watchers_count":75,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":15,"forks":13,"open_issues":15,"watchers":75,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/160"},"html":{"href":"https://github.com/metapolator/metapolator/pull/160"},"issue":{"href":"https://api.github.com/repos/metapolator/metapolator/issues/160"},"comments":{"href":"https://api.github.com/repos/metapolator/metapolator/issues/160/comments"},"review_comments":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/160/comments"},"review_comment":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/metapolator/metapolator/pulls/160/commits"},"statuses":{"href":"https://api.github.com/repos/metapolator/metapolator/statuses/0d0c2baa81af2ce0c32278d7f11dec3658250c9f"}}}}