On Tue, Mar 13, 2018 at 6:36 PM, Vincent Delecroix
<20100.delecr...@gmail.com> wrote:
> I remember somebdy implementing directly in Ipython at some Sage days
> (there is a way to plug hooks as we do with the preparser). The hook
> itself was very naive (just a while loop catching NameError in sage_eval).

That's actually almost exactly how it works in the Sage Notebook (it's
a for loop instead of a while loop with a limit of the number of names
to attempt to convert).

There's little about how it's implemented that isn't transferrable to IPython.

> On 13/03/2018 18:32, Erik Bray wrote:
>>
>> Paul Zimmerman pointed out to me that there's a feature of the legacy
>> Sage Notebook, automatic_names() [1], which turns on automatic
>> creation of symbolic variables and functions when they are not already
>> defined.  For example, by default if you enter:
>>
>>      sage: x + y + z
>>
>> you get:
>>
>>      NameError: name 'y' is not defined
>>
>> ('y', in this case, because 'x' is pre-defined as a special case).
>> With automatic_names(True) it inserts a shim into the Sage syntax
>> pre-processor that automatically creates variables from names not
>> already found in globals().
>>
>> I see no reason this feature needs to be confined to the legacy
>> Notebook, as opposed to being in Sage proper.  Then that feature would
>> be usable at the command-line, as well as in the Jupyter Notebook.
>>
>> Thoughts?
>>
>> [1]
>> https://github.com/sagemath/sagenb/blob/e6910891f445e47690760966441328971d51a78d/sagenb/misc/support.py#L602
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to