lihaoyi / macropy

Macros in Python: quasiquotes, case classes, LINQ and more!
3.28k stars 178 forks source link

Get the various REPLs working *properly* #33

Closed lihaoyi closed 11 years ago

lihaoyi commented 11 years ago

MacroPy kinda-sorta works on the Python, PyPy and IPython REPLs now:

In [1]: import macropy.core.console
0=[]=====> MacroPy Enabled <=====[]=0
In : from macropy.macros2.tracing import macros, trace
In : trace%(1 + 2 + 3 + 4)
(1 + 2) -> 3
((1 + 2) + 3) -> 6
(((1 + 2) + 3) + 4) -> 10
Out[1]: 10

But there's some weird behavior: IPython's prompt changes from In[1]: to In:, and multi-line function and class bodies don't work in any of the shells; and that's because

dog

It would be great if someone who knows his way around the various Python REPLs (e.g. not me) could help fix up macropy/core/console.py to do things properly.

lihaoyi commented 11 years ago

Everything more or less works

https://github.com/lihaoyi/macropy/commit/eb1d4285e3ceb556bb400a13855a34a7f70edd25