3 ms·
Yep, there's an issue for that! https://github.com/lihaoyi/macropy/issues/14 https://github.com/lihaoyi/macropy/issues/14 I've also gotten a basic implementati
by lihaoyi 13y ago
Yep, there's an issue for that! https://github.com/lihaoyi/macropy/issues/14 https://github.com/lihaoyi/macropy/issues/14
I've also gotten a basic implementation working in the CPython REPL, which requires you to run a function `macro_repl()` before you can use them. A Macro powered REPL would be super cool!
- lihaoyi 13y agoMacroPy now works with the CPython REPL: PS C:\Dropbox\Workspace\6.945\Project> python Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import macropy.core.macros 0=[]=====> MacroPy Enabled <=====[]=0 >>> from macropy.macros2.tracing import macros, trace >>> trace%[x*2 for x in range(3)] range(3) -> [0, 1, 2] (x * 2) -> 0 (x * 2) -> 2 (x * 2) -> 4 [(x * 2) for x in range(3)] -> [0, 2, 4] [0, 2, 4] It's somewhat hacky, but it seems to work pretty well. I went through the examples and most of them work perfectly in the REPL, except for those whose have blank-lines-in-class-def confuse it