{"action":"created","comment":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/comments/36196924","id":36196924,"diff_hunk":"@@ -84,4 +78,23 @@ DefineLink::DefineLink(Link &l)\n \tinit(l.getOutgoingSet());\n }\n \n+Handle DefineLink::get_definition(const Handle& alias) {\n+\t// Get all DefineLinks associated with that alias, beware that it\n+\t// will also return DefineLink with that alias as definition body.\n+    IncomingSet defs = alias->getIncomingSetByType(DEFINE_LINK);\n+\n+    // Return the first (supposedly unique) definition","path":"opencog/atoms/bind/DefineLink.cc","position":42,"original_position":42,"commit_id":"f85cff0a215c359984a758e592569a040b9aa15c","original_commit_id":"f85cff0a215c359984a758e592569a040b9aa15c","user":{"login":"linas","id":94368,"avatar_url":"https://avatars.githubusercontent.com/u/94368?v=3","gravatar_id":"","url":"https://api.github.com/users/linas","html_url":"https://github.com/linas","followers_url":"https://api.github.com/users/linas/followers","following_url":"https://api.github.com/users/linas/following{/other_user}","gists_url":"https://api.github.com/users/linas/gists{/gist_id}","starred_url":"https://api.github.com/users/linas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linas/subscriptions","organizations_url":"https://api.github.com/users/linas/orgs","repos_url":"https://api.github.com/users/linas/repos","events_url":"https://api.github.com/users/linas/events{/privacy}","received_events_url":"https://api.github.com/users/linas/received_events","type":"User","site_admin":false},"body":"you can throw an error if defs.size() > 1","created_at":"2015-08-04T14:51:27Z","updated_at":"2015-08-04T14:51:27Z","html_url":"https://github.com/opencog/atomspace/pull/185#discussion_r36196924","pull_request_url":"https://api.github.com/repos/opencog/atomspace/pulls/185","_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments/36196924"},"html":{"href":"https://github.com/opencog/atomspace/pull/185#discussion_r36196924"},"pull_request":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/185"}}},"pull_request":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/185","id":41554044,"html_url":"https://github.com/opencog/atomspace/pull/185","diff_url":"https://github.com/opencog/atomspace/pull/185.diff","patch_url":"https://github.com/opencog/atomspace/pull/185.patch","issue_url":"https://api.github.com/repos/opencog/atomspace/issues/185","number":185,"state":"open","locked":false,"title":"Fix define link","user":{"login":"ngeiswei","id":819225,"avatar_url":"https://avatars.githubusercontent.com/u/819225?v=3","gravatar_id":"","url":"https://api.github.com/users/ngeiswei","html_url":"https://github.com/ngeiswei","followers_url":"https://api.github.com/users/ngeiswei/followers","following_url":"https://api.github.com/users/ngeiswei/following{/other_user}","gists_url":"https://api.github.com/users/ngeiswei/gists{/gist_id}","starred_url":"https://api.github.com/users/ngeiswei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngeiswei/subscriptions","organizations_url":"https://api.github.com/users/ngeiswei/orgs","repos_url":"https://api.github.com/users/ngeiswei/repos","events_url":"https://api.github.com/users/ngeiswei/events{/privacy}","received_events_url":"https://api.github.com/users/ngeiswei/received_events","type":"User","site_admin":false},"body":"## Description\r\nAttempt to generalize DefineLink so that it can be used for anything not just in the context of the pattern matcher. It is still under the directory `opencog/atoms/bind`, maybe it should be moved elsewhere (like in `opencog/atoms/core`)\r\n\r\n* Modify DefineLink class so that the definition body can be anything (not only a ScopeLink)\r\n* Add a static method DefinieLink::get_definition(const Handle& alias) that return the definition body given a definition alias as in (DefineLink alias body)\r\n* Simplify BetaRedexLink. Warning it assumes the definition body is a ScopeLink, I didn't change that, ultimately I guess it should be able to handle non ScopeLink (constants).\r\n\r\nI strongly suspect BetaRedexLink and ExecutionOutputLink (or ApplyLink/ApplicationLink as we might soon rename it) are the same thing and should be unified.\r\n\r\n## UTest Results\r\n```\r\n100% tests passed, 0 tests failed out of 79\r\n```\r\n","created_at":"2015-08-04T10:14:48Z","updated_at":"2015-08-04T14:51:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09a9f02f800ada153160f4222cd4165fac8251a9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opencog/atomspace/pulls/185/commits","review_comments_url":"https://api.github.com/repos/opencog/atomspace/pulls/185/comments","review_comment_url":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencog/atomspace/issues/185/comments","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/f85cff0a215c359984a758e592569a040b9aa15c","head":{"label":"ngeiswei:fix-DefineLink","ref":"fix-DefineLink","sha":"f85cff0a215c359984a758e592569a040b9aa15c","user":{"login":"ngeiswei","id":819225,"avatar_url":"https://avatars.githubusercontent.com/u/819225?v=3","gravatar_id":"","url":"https://api.github.com/users/ngeiswei","html_url":"https://github.com/ngeiswei","followers_url":"https://api.github.com/users/ngeiswei/followers","following_url":"https://api.github.com/users/ngeiswei/following{/other_user}","gists_url":"https://api.github.com/users/ngeiswei/gists{/gist_id}","starred_url":"https://api.github.com/users/ngeiswei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngeiswei/subscriptions","organizations_url":"https://api.github.com/users/ngeiswei/orgs","repos_url":"https://api.github.com/users/ngeiswei/repos","events_url":"https://api.github.com/users/ngeiswei/events{/privacy}","received_events_url":"https://api.github.com/users/ngeiswei/received_events","type":"User","site_admin":false},"repo":{"id":34892320,"name":"atomspace","full_name":"ngeiswei/atomspace","owner":{"login":"ngeiswei","id":819225,"avatar_url":"https://avatars.githubusercontent.com/u/819225?v=3","gravatar_id":"","url":"https://api.github.com/users/ngeiswei","html_url":"https://github.com/ngeiswei","followers_url":"https://api.github.com/users/ngeiswei/followers","following_url":"https://api.github.com/users/ngeiswei/following{/other_user}","gists_url":"https://api.github.com/users/ngeiswei/gists{/gist_id}","starred_url":"https://api.github.com/users/ngeiswei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngeiswei/subscriptions","organizations_url":"https://api.github.com/users/ngeiswei/orgs","repos_url":"https://api.github.com/users/ngeiswei/repos","events_url":"https://api.github.com/users/ngeiswei/events{/privacy}","received_events_url":"https://api.github.com/users/ngeiswei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ngeiswei/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":true,"url":"https://api.github.com/repos/ngeiswei/atomspace","forks_url":"https://api.github.com/repos/ngeiswei/atomspace/forks","keys_url":"https://api.github.com/repos/ngeiswei/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ngeiswei/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ngeiswei/atomspace/teams","hooks_url":"https://api.github.com/repos/ngeiswei/atomspace/hooks","issue_events_url":"https://api.github.com/repos/ngeiswei/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/ngeiswei/atomspace/events","assignees_url":"https://api.github.com/repos/ngeiswei/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/ngeiswei/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/ngeiswei/atomspace/tags","blobs_url":"https://api.github.com/repos/ngeiswei/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ngeiswei/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ngeiswei/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/ngeiswei/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ngeiswei/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/ngeiswei/atomspace/languages","stargazers_url":"https://api.github.com/repos/ngeiswei/atomspace/stargazers","contributors_url":"https://api.github.com/repos/ngeiswei/atomspace/contributors","subscribers_url":"https://api.github.com/repos/ngeiswei/atomspace/subscribers","subscription_url":"https://api.github.com/repos/ngeiswei/atomspace/subscription","commits_url":"https://api.github.com/repos/ngeiswei/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/ngeiswei/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/ngeiswei/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/ngeiswei/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/ngeiswei/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/ngeiswei/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ngeiswei/atomspace/merges","archive_url":"https://api.github.com/repos/ngeiswei/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ngeiswei/atomspace/downloads","issues_url":"https://api.github.com/repos/ngeiswei/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/ngeiswei/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/ngeiswei/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/ngeiswei/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ngeiswei/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/ngeiswei/atomspace/releases{/id}","created_at":"2015-05-01T06:34:02Z","updated_at":"2015-05-03T09:13:21Z","pushed_at":"2015-08-04T09:15:11Z","git_url":"git://github.com/ngeiswei/atomspace.git","ssh_url":"git@github.com:ngeiswei/atomspace.git","clone_url":"https://github.com/ngeiswei/atomspace.git","svn_url":"https://github.com/ngeiswei/atomspace","homepage":"","size":140058,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"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":"opencog:master","ref":"master","sha":"535a0cdb9a60b26128280f5bf5af9d5fe3a6611c","user":{"login":"opencog","id":2109913,"avatar_url":"https://avatars.githubusercontent.com/u/2109913?v=3","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"repo":{"id":34678084,"name":"atomspace","full_name":"opencog/atomspace","owner":{"login":"opencog","id":2109913,"avatar_url":"https://avatars.githubusercontent.com/u/2109913?v=3","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencog/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":false,"url":"https://api.github.com/repos/opencog/atomspace","forks_url":"https://api.github.com/repos/opencog/atomspace/forks","keys_url":"https://api.github.com/repos/opencog/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencog/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencog/atomspace/teams","hooks_url":"https://api.github.com/repos/opencog/atomspace/hooks","issue_events_url":"https://api.github.com/repos/opencog/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/opencog/atomspace/events","assignees_url":"https://api.github.com/repos/opencog/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/opencog/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/opencog/atomspace/tags","blobs_url":"https://api.github.com/repos/opencog/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencog/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencog/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencog/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/opencog/atomspace/languages","stargazers_url":"https://api.github.com/repos/opencog/atomspace/stargazers","contributors_url":"https://api.github.com/repos/opencog/atomspace/contributors","subscribers_url":"https://api.github.com/repos/opencog/atomspace/subscribers","subscription_url":"https://api.github.com/repos/opencog/atomspace/subscription","commits_url":"https://api.github.com/repos/opencog/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencog/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencog/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencog/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencog/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/opencog/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencog/atomspace/merges","archive_url":"https://api.github.com/repos/opencog/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencog/atomspace/downloads","issues_url":"https://api.github.com/repos/opencog/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/opencog/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/opencog/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/opencog/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencog/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/opencog/atomspace/releases{/id}","created_at":"2015-04-27T16:32:57Z","updated_at":"2015-08-03T06:39:27Z","pushed_at":"2015-08-04T14:40:41Z","git_url":"git://github.com/opencog/atomspace.git","ssh_url":"git@github.com:opencog/atomspace.git","clone_url":"https://github.com/opencog/atomspace.git","svn_url":"https://github.com/opencog/atomspace","homepage":"","size":149972,"stargazers_count":15,"watchers_count":15,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":34,"forks":23,"open_issues":34,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/185"},"html":{"href":"https://github.com/opencog/atomspace/pull/185"},"issue":{"href":"https://api.github.com/repos/opencog/atomspace/issues/185"},"comments":{"href":"https://api.github.com/repos/opencog/atomspace/issues/185/comments"},"review_comments":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/185/comments"},"review_comment":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/185/commits"},"statuses":{"href":"https://api.github.com/repos/opencog/atomspace/statuses/f85cff0a215c359984a758e592569a040b9aa15c"}}}}