ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 05 Dec 2016 03:25:59 -0600Problems with Var in Cloud.Sagemathhttp://ask.sagemath.org/question/23640/problems-with-var-in-cloudsagemath/Hi,
got a problem defining variables in cloud.sagemath:
http://www.directupload.net/file/d/3699/bs9eya98_png.htm
I just copied the code from
http://www.sagemath.org/doc/reference/calculus/sage/calculus/calculus.html
(the very first line)
but I also tried it myself with different letters and '`´". None worked.
Wed, 30 Jul 2014 11:23:23 -0500http://ask.sagemath.org/question/23640/problems-with-var-in-cloudsagemath/Answer by slelievre for <p>Hi,
got a problem defining variables in cloud.sagemath:
<a href="http://www.directupload.net/file/d/3699/bs9eya98_png.htm">http://www.directupload.net/file/d/36...</a></p>
<p>I just copied the code from
<a href="http://www.sagemath.org/doc/reference/calculus/sage/calculus/calculus.html">http://www.sagemath.org/doc/reference...</a>
(the very first line)
but I also tried it myself with different letters and '`´". None worked.</p>
http://ask.sagemath.org/question/23640/problems-with-var-in-cloudsagemath/?answer=23641#post-id-23641Is it possible that you previously evaluated a command defining `var` as a string? For example,
var = 'x1'
If you did that (and even if you erased that line), then the line
x1 = var('x1'); x1
would produce the exact error that you are seeing.
Try restarting the worksheet (using the orange "Restart" button at the top), this will reset all names, and now the code should execute as expected.Wed, 30 Jul 2014 13:15:29 -0500http://ask.sagemath.org/question/23640/problems-with-var-in-cloudsagemath/?answer=23641#post-id-23641Comment by slelievre for <p>Is it possible that you previously evaluated a command defining <code>var</code> as a string? For example,</p>
<pre><code>var = 'x1'
</code></pre>
<p>If you did that (and even if you erased that line), then the line</p>
<pre><code>x1 = var('x1'); x1
</code></pre>
<p>would produce the exact error that you are seeing.</p>
<p>Try restarting the worksheet (using the orange "Restart" button at the top), this will reset all names, and now the code should execute as expected.</p>
http://ask.sagemath.org/question/23640/problems-with-var-in-cloudsagemath/?comment=35917#post-id-35917Exactly. To check if "var" is available, for instance: a cell with
var
will give the following output:
<built-in function var>
so you know it is not available.
On the other hand, a cell with
war
will give
NameError: name 'war' is not defined
so you know this variable name is available.Mon, 05 Dec 2016 03:25:59 -0600http://ask.sagemath.org/question/23640/problems-with-var-in-cloudsagemath/?comment=35917#post-id-35917Comment by Torero for <p>Is it possible that you previously evaluated a command defining <code>var</code> as a string? For example,</p>
<pre><code>var = 'x1'
</code></pre>
<p>If you did that (and even if you erased that line), then the line</p>
<pre><code>x1 = var('x1'); x1
</code></pre>
<p>would produce the exact error that you are seeing.</p>
<p>Try restarting the worksheet (using the orange "Restart" button at the top), this will reset all names, and now the code should execute as expected.</p>
http://ask.sagemath.org/question/23640/problems-with-var-in-cloudsagemath/?comment=23696#post-id-23696Yup that worked.
So I have to be careful not to override given functions? Tue, 05 Aug 2014 04:48:25 -0500http://ask.sagemath.org/question/23640/problems-with-var-in-cloudsagemath/?comment=23696#post-id-23696