-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support the debugger from the repl #1397
Comments
I also wanted to add, is it possible to have something like IPython's %pdb toggle in hy repl (when error is encountered set trace and pdb at point)? I have no idea how involved that feature would be. |
I'm not sure about that either, but IPython is actually pretty extensible. I think it would be pretty easy to create a custom I'm actually considering doing it the other way around: make an IHy that reads Hy by default, which would help with #1323 as well as these debugger issues. This would be quite a bit more involved, and use IPython's custom input transformation API. I'm reluctant to include this in Hy proper, at least at first. It would be a separate project. But it might be nicer to use than the default Hy repl, since we'd be able to get nice IPython features in Hy. |
Basic line magic is not hard. Here's a basic proof of concept. In [1]: from IPython.core.magic import register_line_magic
In [2]: @register_line_magic
...: def hy(line):
...: "interprets line as Hy"
...: import hy
...: return hy.eval(hy.read_str(line), globals())
...:
In [3]: %hy(+ 1 2)
Out[3]: 3
In [4]: %hy(setv foo 42)
In [5]: foo
Out[5]: 42 It's pretty limited, but might already be useful. Cell magic would be about as easy. |
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
Source entered interactively can now be displayed in traceback output. Also, the REPL object is now available in its namespace, so that, for instance, display options--like `spy`--can be turned on and off interactively. Closes hylang#1397.
related #741 #1395
We can't get a code listing in the debugger if the function was defined at the repl.
The usual Emacs workflow involves sending toplevel forms from the file buffer to the repl, so the lack of debugger support in this case is a pain.
The truth is, Python's repl can't do this either.
So maybe that's why no-one complained. But IPython can.
So I know it's possible in principle.
The text was updated successfully, but these errors were encountered: