-
Notifications
You must be signed in to change notification settings - Fork 12
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
Use output when possible #50
Comments
This may be something that is different between Octave and Python. Notice the Similarily, when doing I wonder if we can get Octave to run in "script" mode, where it would print only explicit calls to stdout/stderr, and control the cell output from PythonOctave |
Ok thank you, I understand now. So all this is happening because when the interpreter executes a line without the semicolon it will always call display (indipendently of xoctave), which in this case is defined inside If you wanted something like ipython, you would need to prevent octave from calling However in my opinion this is far from what the Octave user expects, as we're used to being able to show variables just by removing the semicolon. I think if this behaved as ipython, any experienced octave user would think that it's not working. For me, for example, this is a major point, and one of the reasons I still won't use ipython: I often need to see what the content of a variable is and it would be cumbersome to write a printf call any time I need to do that. |
If you really think this is important, maybe it could be a configurable behaviour, but I think we should be keeping the current one at least as a possibility (if not the default). |
Yes.
I also think we should stick to Octave behavior as much as possible. I wonder then if we should ever send something in the Another thing with Ipython (and the |
At the moment no In my opinion we could keep this behaviour, as inside JupyterLab there is no visual difference (besides the little If this were the case, maybe it could be made optional, and the result could be sent anyway independently of the semicolon, whenever the
Totally possible and I quite like the idea. It would be enough to assign to a new variable the |
I've been doing some research on this, related to the The idea would be that As a reference, octave displays an output value when a statement without semicolon is:
In addition it will also assign and print the This has turned out to be quite difficult and I have not found a decent solution yet. The main reason is that I haven't found a way to reliably decide if a statement is a function or a variable and if it returns a value or not (the two things buried in the octave code). For example the expressions:
Have the same parse tree: graph TD;
statement --> expression
expression --> identifier
Yet one has a meaningful value, the other one shall not return anything, in fact the following expressions are and behave differently:
This is what I tried:
|
Executing
1+1
does not output but only prints tostdout
.jupyter_kernel_test
activationThe text was updated successfully, but these errors were encountered: