On Sun, Apr 20, 2008 at 10:38 AM, Ondrej Certik <[EMAIL PROTECTED]> wrote:
>
>
>  On Sun, Apr 20, 2008 at 6:58 PM, William Stein <[EMAIL PROTECTED]> wrote:
>  >
>  >
>  >  On Sun, Apr 20, 2008 at 9:36 AM, Ondrej Certik <[EMAIL PROTECTED]> wrote:
>  >  >
>  >  >  On Fri, Apr 18, 2008 at 5:10 PM, William Stein <[EMAIL PROTECTED]> 
> wrote:
>  >  >  >
>  >  >  >
>  >  >  >  On Fri, Apr 18, 2008 at 4:59 AM, Ondrej Certik <[EMAIL PROTECTED]> 
> wrote:
>  >  >  >  >
>  >  >  >  >  On Thu, Apr 17, 2008 at 9:24 PM, Hector Villafuerte <[EMAIL 
> PROTECTED]> wrote:
>  >  >  >  >  >
>  >  >  >  >  >  On Thu, Apr 17, 2008 at 11:53 AM, William Stein <[EMAIL 
> PROTECTED]> wrote:
>  >  >  >  >  >  [...]
>  >  >  >  >  >
>  >  >  >  >  > >  In Sage the function is show_identifiers().
>  >  >  >  >  >  [...]
>  >  >  >  >  >
>  >  >  >  >  >  Oh, I misunderstood the question then... my bad. Thanks 
> William,
>  >  >  >  >
>  >  >  >  >  Why not to name it the same as in Matlab?
>  >  >  >  >
>  >  >  >  >  Ondrej
>  >  >  >
>  >  >  >  Because I named it the same as in Magma!
>  >  >
>  >  >  Haha, I didn't know that. :)
>  >  >
>  >  >
>  >  >  >  Also, in retrospect, I think Magma's "ShowIdentifiers()" is a far 
> far
>  >  >  >  less obfuscated name than Matlab's cryptics "whos", which frankly
>  >  >  >  looks like a spelling mistake or typo to me.
>  >  >
>  >  >  Agree. The only disadvantage is that it takes longer to type, because
>  >  >  "sho<TAB>" yields
>  >  >
>  >  >  sage: sho
>  >  >  show              show_default      show_identifiers
>  >  >
>  >  >  so I need to type "show_i<TAB>", then <BACKSPACE> and "()<ENTER>".
>  >  >  Actually it also works without the backspace.
>  >  >
>  >
>  >  Magma tends to have long verbose names like this.
>  >  For example, to compute the charpoly of a matrix
>  >  in Magma:
>  >
>  >  > A := MatrixAlgebra(RationalField(), 2)![1,2,3,4];
>  >  > R<x> := PolynomialRing(RationalField());
>  >  > CharacteristicPolynomial(A);
>  >  x^2 - 5*x - 2
>  >
>  >  Lots of long names.   But Magma code is very readable
>  >  (like Python), in my opinion.
>  >
>  >  In Sage the above is:
>  >
>  >  sage: a = matrix(QQ, 2, [1,2,3,4])
>  >  sage: a.charpoly()
>  >  x^2 - 5*x - 2
>
>  For anything, that is going to endup in scripts, I prefer (I would
>  even say require) longer names, because the code is going to be read
>  more times than written.
>
>  However for things that are only going to be used in the interactive
>  mode, I prefer short names. There are not so many things that belong
>  to this
>  cathegory, but I think show_identifiers() is one of them. Or will you
>  ever use show_identifiers() in a script/code?

Yes.  Actually show_identifiers was broken-ish / nonoptimal in sage-2.11,
and I recently fixed it for sage-3.0 specifically because it was being
used in some library code.  It's used to implement saving all current
variables defined in a session.

It could also be very useful for GUI code, I guess...

 -- William

--~--~---------~--~----~------------~-------~--~----~
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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to