[sage-support] The %R line magic and %%R cell magic no longer work in the jupyter notebook

2015-11-13 Thread Emmanuel Charpentier
Dear list,

Last time I looked (about sage 6.9 or thereabout) the %R line magic and %%R 
cell magic were supstitute to the %r magic, useful in the ipython noteboook 
where %r dosn't work as intended.

%load_ext rmagic gives its usual warning that it has moved to rpy2, but 
neither %R nor %%R are listed in the possible tab-completions of %, and 
trying to use them lead to an error message ("%R line magic nof found" and 
"%%R cell magic not found", or something to that effect).

%r still launches an R interpreter you can't get out of.

Is that new ?

--
Emmanuel Charpentier

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


Re: [sage-support] Re: recursion

2015-11-13 Thread Christophe Bal
Hello.

I think also that the problem comes from the fact that liste are copiez by
reference.
Le 13 nov. 2015 06:25, "Nils Bruin"  a écrit :

> On Thursday, November 12, 2015 at 6:09:26 PM UTC-8, Roberto La Scala wrote:
>
>> It happens that the value of the list l changes for different values of i.
>>
>> Since you are not saying what answer you expected, it is difficult to
> judge in what sense the answer seemed strange to you. However, the
> following is sometimes considered surprising in python:
>
> sage: a=[1]
> sage: b=[a,a]
> sage: b
> [[1], [1]]
> sage: b[1].append(2)
> sage: b
> [[1, 2], [1, 2]]
>
> As you can see, b is a list consisting of *the same* list a. Hence, a
> change to "a" in one place affects all occurrences.
>
> Whenever you *mutate* a list, you have to ask yourself if you are free to
> do so or if someone else might be holding a reference to the same list and
> therefore will be affected by the change too.
>
> One solution here would be to *replace* b[1] by a new list rather than
> append an element to b[1].
>
> sage: a=[1]
> sage: b=[a,a]
> sage: b[1]= a + [2]
> sage: b
> [[1], [1, 2]]
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>

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