Perhaps for reference, maxima_lib can only be instantiated once and, since 
sage.interfaces.maxima_lib is only referenced at start-up via lazy_import 
(which has its own problems), the instantiation happens upon import of 
sage.interfaces.maxima_lib:

sage: import sage.interfaces.maxima_lib
sage: sage.interfaces.maxima_lib.MaximaLib()
RuntimeError: Maxima interface in library mode can only be instantiated once
sage: sage.interfaces.maxima_lib.maxima #already instantiated
Maxima_lib

The pexpect interface, on the other hand, can be instantiated as much as 
you want, and separate instances are *not* equal (and they shouldn't be, 
because generally they would be in quite different states):

sage: M1=sage.interfaces.maxima.Maxima()
sage: M2=sage.interfaces.maxima.Maxima()
sage: M1 == M2
False

I would say it would be reasonable to have R_lib follow the same pattern. 
If it is deemed that maintaining a pexpect interface to R is not 
worthwhile, then that's a separate decision.


On Tuesday, December 25, 2018 at 1:04:06 PM UTC-8, Andrey Novoseltsev wrote:
>
> On Tuesday, 25 December 2018 13:53:07 UTC-7, Timo Kaufmann wrote:
>>
>> Am Dienstag, 25. Dezember 2018 16:32:10 UTC+1 schrieb Andrey Novoseltsev:
>>>
>>> It does not affect me personally at all, my use of R is limited to 
>>> making it work in SageMathCell. But if there is only one instance, then I 
>>> think R() should always return that single instance rather than a new 
>>> wrapper each time and perhaps it should be deprecated and removed from the 
>>> global namespace so that interaction goes through the precreated r object 
>>> only.
>>>
>>
>> Not sure how deprecation in sage works. Wouldn't that needlessly break 
>> some scripts?
>>  
>>
> Depends on your definition of needlessly - if there is no point anymore to 
> call R(), what's the point in keeping doing it? And if the use case before 
> was to create two different instances, then it is highly desirable to break 
> those scripts to make sure that there are no unexpected and hard to debug 
> consequences.
>

-- 
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