{"action":"created","issue":{"url":"https://api.github.com/repos/opencog/atomspace/issues/1475","repository_url":"https://api.github.com/repos/opencog/atomspace","labels_url":"https://api.github.com/repos/opencog/atomspace/issues/1475/labels{/name}","comments_url":"https://api.github.com/repos/opencog/atomspace/issues/1475/comments","events_url":"https://api.github.com/repos/opencog/atomspace/issues/1475/events","html_url":"https://github.com/opencog/atomspace/issues/1475","id":282166339,"number":1475,"title":"CompositionLink fails a basic test","user":{"login":"linas","id":94368,"avatar_url":"https://avatars2.githubusercontent.com/u/94368?v=4","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2017-12-14T16:46:36Z","updated_at":"2017-12-15T14:29:19Z","closed_at":null,"author_association":"OWNER","body":"CompositionLink was introduced in #1473 but doesn't work for me...\r\n\r\nTry this at home:\r\n```\r\n(use-modules (opencog))\r\n(use-modules (opencog exec))\r\n\r\n; define a function that returns x-1\r\n(define minus-one\r\n   (Lambda\r\n      (Variable \"$g\")\r\n      (Plus (Number -1) (Variable \"$g\"))))\r\n\r\n(cog-execute!  (Put minus-one (Number 5)))\r\n; prints (NumberNode \"4.000000\") as expected\r\n\r\n; define a functin that returns x^2\r\n(define square\r\n   (Lambda\r\n      (Variable \"$x\")\r\n      (Times (Variable \"$x\")(Variable \"$x\"))))\r\n\r\n(cog-execute!  (Put square (Number 5)))\r\n; prints (NumberNode \"25.000000\") as expected\r\n\r\n(define cmp (Composition minus-one square))\r\n\r\n(cog-execute!  (Put cmp (Number 2)))\r\n; Error: PutLink cannot handle CompositionLink\r\n\r\n(cog-execute!  (Put cmp (List (Number 2))))\r\n; This also fails.\r\n```"},"comment":{"url":"https://api.github.com/repos/opencog/atomspace/issues/comments/352019053","html_url":"https://github.com/opencog/atomspace/issues/1475#issuecomment-352019053","issue_url":"https://api.github.com/repos/opencog/atomspace/issues/1475","id":352019053,"user":{"login":"ngeiswei","id":819225,"avatar_url":"https://avatars1.githubusercontent.com/u/819225?v=4","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},"created_at":"2017-12-15T14:29:19Z","updated_at":"2017-12-15T14:29:19Z","author_association":"OWNER","body":"Yes, and you have shown, `PutLink` is almost `ComposeLink`. I suppose we could implement `ComposeLink` with `PutLink` plus other operators, I'm open to it, but for practical immediate purposes `ComposeLink` it doing what I need."}}
{"actor":{"display_login":"ngeiswei"}}