Maybe it is a *convention* that "_" is the previous result.

"_" is a legitimate variable name in Python, so it is sometimes used for results you don't really intend to keep.

The following produces 8 in the Sage Cell:

_ = 1 + 2
_ + 5

Rob

On 04/11/2017 03:44 PM, Andrey Novoseltsev wrote:
On Tuesday, 11 April 2017 14:13:28 UTC-6, Ingo Dahn wrote:

    From the net I got that the result of the previous computation can be
    referred to as _. But if I try to use it in SageCell like in
    1+2
    _+5
    I get an error. What is the correct way to refer to previous results?


I never used or saw _ used in SageMathCell. There is a question of what
"previous computation" is. Since I am used to SageNB, for me previous
computation is the result of the previous cell, which does not make much sense
when there is only one cell ;-)

I don't think that SageMathCell has any special treatment for _ on its own, so
if it does or does not work, it is due to Sage/IPython/Jupyter/etc handing
actual code and output. So - if things worked before and got broken I'll try to
fix them, but if they never worked I claim that it is by design and should not
be impemented.

--
You received this message because you are subscribed to the Google Groups
"sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-cell+unsubscr...@googlegroups.com
<mailto:sage-cell+unsubscr...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-cell/3f6cebdb-073f-4ec6-ac5c-b73d637bf8c7%40googlegroups.com
<https://groups.google.com/d/msgid/sage-cell/3f6cebdb-073f-4ec6-ac5c-b73d637bf8c7%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-cell+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-cell/MTAwMDAyNy5iZWV6ZXI.1491951226%40quikprotect.
For more options, visit https://groups.google.com/d/optout.

Reply via email to