On Monday, September 6, 2010, Jason Grout <[email protected]> wrote:
> On 9/6/10 6:02 PM, Alasdair wrote:
>
> As you know, when you define a new variable:
>
> sage: a = 2
>
> the value is not automatically displayed.  So you have to:
>
> sage: a = a+3; a
>
> to display it.  This is different to all other CAS's (at least to my
> knowledge), where a variable assignment automatically returns the
> result unless you ask it not to.

Magma behaves the same way as Sage here, i.e., Magma does not autoprint.

Someone could implement is for Sage by adding a post eval hook that
checks for new variables in globals() then prints them...


>  Is there any way of coercing Sage
> into automatically returning the result of a variable assignment?
> This would be very handy for teaching.
>
>
>
> Not easily.  This is a python thing.  At least I don't know of a way to 
> automatically print out something like that.
>
> Thanks,
>
> Jason
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to 
> [email protected]
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to