{"action":"created","issue":{"url":"https://api.github.com/repos/rfk/pypyjs/issues/63","labels_url":"https://api.github.com/repos/rfk/pypyjs/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/rfk/pypyjs/issues/63/comments","events_url":"https://api.github.com/repos/rfk/pypyjs/issues/63/events","html_url":"https://github.com/rfk/pypyjs/issues/63","id":68354789,"number":63,"title":"Getting a return value from runsource?","user":{"login":"dsblank","id":168568,"avatar_url":"https://avatars.githubusercontent.com/u/168568?v=3","gravatar_id":"","url":"https://api.github.com/users/dsblank","html_url":"https://github.com/dsblank","followers_url":"https://api.github.com/users/dsblank/followers","following_url":"https://api.github.com/users/dsblank/following{/other_user}","gists_url":"https://api.github.com/users/dsblank/gists{/gist_id}","starred_url":"https://api.github.com/users/dsblank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsblank/subscriptions","organizations_url":"https://api.github.com/users/dsblank/orgs","repos_url":"https://api.github.com/users/dsblank/repos","events_url":"https://api.github.com/users/dsblank/events{/privacy}","received_events_url":"https://api.github.com/users/dsblank/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-14T12:22:09Z","updated_at":"2015-04-14T14:07:46Z","closed_at":null,"body":"In @minrk 's new [PyPy.js kernel](https://github.com/minrk/pypyjskernel) for Jupyter, he has:\r\n\r\n```javascript\r\n        code = \"r = c.runsource('''\" + code + \"''', '<input>', 'exec')\";\r\n        vm.eval(code).then(function() {\r\n            _finish_execute.apply(that, [r, request, true]);\r\n        });\r\n```\r\n\r\nbut that doesn't make expressions like `1 + 1` give 2 as a return value. In fact, I don't think anything is ever returned. I know that many Python implementations have alternate ways of interpreting code, that include the things that one types in a REPL. Is there an alternative to 'exec' for this here? Or another method to get a return value?"},"comment":{"url":"https://api.github.com/repos/rfk/pypyjs/issues/comments/92865215","html_url":"https://github.com/rfk/pypyjs/issues/63#issuecomment-92865215","issue_url":"https://api.github.com/repos/rfk/pypyjs/issues/63","id":92865215,"user":{"login":"dsblank","id":168568,"avatar_url":"https://avatars.githubusercontent.com/u/168568?v=3","gravatar_id":"","url":"https://api.github.com/users/dsblank","html_url":"https://github.com/dsblank","followers_url":"https://api.github.com/users/dsblank/followers","following_url":"https://api.github.com/users/dsblank/following{/other_user}","gists_url":"https://api.github.com/users/dsblank/gists{/gist_id}","starred_url":"https://api.github.com/users/dsblank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsblank/subscriptions","organizations_url":"https://api.github.com/users/dsblank/orgs","repos_url":"https://api.github.com/users/dsblank/repos","events_url":"https://api.github.com/users/dsblank/events{/privacy}","received_events_url":"https://api.github.com/users/dsblank/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T14:07:46Z","updated_at":"2015-04-14T14:07:46Z","body":"If that is code that can be written effectively here, I think that makes sense. Anyone that wants to make a REPL out of PyPy.js would possibly be interested in such an interface. \r\n\r\nPerhaps:\r\n\r\n```python\r\nrunsource(CODE, SOURCE, MODE)\r\n```\r\nwhere MODE is one of:\r\n* `eval`\r\n* `exec`\r\n* `interactive`, or `repl`, or ...?"}}