gilch
gilch
Oh, that looks useful actually. I must have missed that when I skimmed the docs the first time. The resulting pre-expanded files should have perfect compatibility with all the other...
Improved version ```python import ast, importlib, inspect, sys from macropy.core.macros import ModuleExpansionContext, detect_macros __main__ = sys.modules["__main__"] source = inspect.getsource(__main__) if "import macros\n" in source: tree = ast.parse(source) exec( compile( source=ast.Module(...
Hm, yes `macropy.__init__` might be too soon. Maybe the right place for the `import macropy.activate` is in `macropy.core.macros.Macros.__init__`? That way importing any macros would have activated them. Is activation required...
Hissp compiles to a very restricted subset of Python. It completely removes statements, and restricts expressions to just basic literal types (not collections or bytes in Lissp), calls, identifier and...
I want to enumerate the candidates, but this is getting too big for an issue comment. Moving to the wiki: https://github.com/gilch/hissp/wiki/Bundled-macro-candidates
OK, most of the candidates are implemented. I will probably end up dropping a few of these that don't seem worth it, but I expect to keep most of them....
#155 is ready.
Merged.
The missing candidates still up for consideration are * Arc ssyntax `:`, `!`, `~`, `.`. Anarki has more now. A bundled reader macro could expand these. This is getting too...
Adding `@#foo` as an abbreviation for `(operator..attrgetter 'foo)`. It's a bit strange that `spam.foo` in Python is easily expressed the same way in Lissp, and `spam-expr().foo()` is still easily expressed...