{"action":"created","issue":{"url":"https://api.github.com/repos/azazel75/macropy/issues/20","repository_url":"https://api.github.com/repos/azazel75/macropy","labels_url":"https://api.github.com/repos/azazel75/macropy/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/azazel75/macropy/issues/20/comments","events_url":"https://api.github.com/repos/azazel75/macropy/issues/20/events","html_url":"https://github.com/azazel75/macropy/pull/20","id":368604516,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNzQwOTM2","number":20,"title":"Add Jupyter kernel for MacroPy","user":{"login":"Technologicat","id":16972251,"node_id":"MDQ6VXNlcjE2OTcyMjUx","avatar_url":"https://avatars0.githubusercontent.com/u/16972251?v=4","gravatar_id":"","url":"https://api.github.com/users/Technologicat","html_url":"https://github.com/Technologicat","followers_url":"https://api.github.com/users/Technologicat/followers","following_url":"https://api.github.com/users/Technologicat/following{/other_user}","gists_url":"https://api.github.com/users/Technologicat/gists{/gist_id}","starred_url":"https://api.github.com/users/Technologicat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Technologicat/subscriptions","organizations_url":"https://api.github.com/users/Technologicat/orgs","repos_url":"https://api.github.com/users/Technologicat/repos","events_url":"https://api.github.com/users/Technologicat/events{/privacy}","received_events_url":"https://api.github.com/users/Technologicat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-10T10:43:15Z","updated_at":"2018-10-10T21:36:48Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/azazel75/macropy/pulls/20","html_url":"https://github.com/azazel75/macropy/pull/20","diff_url":"https://github.com/azazel75/macropy/pull/20.diff","patch_url":"https://github.com/azazel75/macropy/pull/20.patch"},"body":"Macros in the IPython REPL! There was already `macropy.console`, but I really like readline, tab completion, and the other IPython features. Therefore, here's a first cut at a Jupyter kernel for MacroPy.\r\n\r\nOnce installed, the following works in ``jupyter console --kernel imacropy``:\r\n```python\r\nfrom unpythonic.syntax import macros, let\r\nlet((x, 1),\r\n    (y, 2))[\r\n      (x, y)]\r\n```\r\n(The startup command is too long to type, so I have aliased it to `mipython3` in my `.bashrc`.)\r\n\r\nThis inherits from `IPythonKernel` and plugs in an AST transformer, basically borrowing everything else from the standard IPython kernel.\r\n\r\nNote this requires renaming ``macropy/logging.py`` to avoid shadowing the stdlib module with the same name; otherwise installation of the new kernel fails due to Jupyter loading the wrong ``logging`` module.\r\n\r\nComments?\r\n\r\n[edit] kernel name."},"comment":{"url":"https://api.github.com/repos/azazel75/macropy/issues/comments/428741294","html_url":"https://github.com/azazel75/macropy/pull/20#issuecomment-428741294","issue_url":"https://api.github.com/repos/azazel75/macropy/issues/20","id":428741294,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODc0MTI5NA==","user":{"login":"Technologicat","id":16972251,"node_id":"MDQ6VXNlcjE2OTcyMjUx","avatar_url":"https://avatars0.githubusercontent.com/u/16972251?v=4","gravatar_id":"","url":"https://api.github.com/users/Technologicat","html_url":"https://github.com/Technologicat","followers_url":"https://api.github.com/users/Technologicat/followers","following_url":"https://api.github.com/users/Technologicat/following{/other_user}","gists_url":"https://api.github.com/users/Technologicat/gists{/gist_id}","starred_url":"https://api.github.com/users/Technologicat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Technologicat/subscriptions","organizations_url":"https://api.github.com/users/Technologicat/orgs","repos_url":"https://api.github.com/users/Technologicat/repos","events_url":"https://api.github.com/users/Technologicat/events{/privacy}","received_events_url":"https://api.github.com/users/Technologicat/received_events","type":"User","site_admin":false},"created_at":"2018-10-10T21:36:48Z","updated_at":"2018-10-10T21:36:48Z","author_association":"NONE","body":"Applying some polish.\r\n\r\n- Jupyter help `some_macro?` now works for macros (that are currently imported to the REPL). This works by importing the macro stubs as normal Python imports behind the scenes.\r\n- Macro expansion errors are properly reported by Jupyter.\r\n- If the user tells the REPL to import some macros from the same macro definition module again, the system reloads the module. This should allow semi-live updates to macro definitions: hack on your macros, re-import, re-test, without needing to exit the REPL session.\r\n\r\nIn the REPL, the set of macros available from `mymodule`, at any given time, are those specified in the most recent `from mymodule import macros, ...` import statement. This is a design decision that I might still change later.\r\n\r\n(The original basic REPL didn't consider the case of importing the same names multiple times over the same  REPL session; attempting to do that would introduce duplicate entries to the stored macro bindings. A first version at avoiding that produced the above solution.)"}}
{"actor":{"display_login":"Technologicat"}}