#17958: implement declare_var, deprecate (None)var
-----------------------------+------------------------
       Reporter:  rws        |        Owner:
           Type:  defect     |       Status:  new
       Priority:  major      |    Milestone:  sage-6.6
      Component:  symbolics  |   Resolution:
       Keywords:             |    Merged in:
        Authors:             |    Reviewers:
Report Upstream:  N/A        |  Work issues:
         Branch:             |       Commit:
   Dependencies:             |     Stopgaps:
-----------------------------+------------------------

Comment (by nbruin):

 Replying to [comment:24 nbruin]:
 > Replying to [comment:23 mmezzarobba]:
 > > I doubt you can use sage (and not shoot yourself in the foot on every
 possible occasion) without understanding this kind of things at least a
 little.
 >
 > You can do some very simple examples, such as differentiating a
 function, plotting one, trying to compute an antiderivative without
 understanding the way python names (really, python has "names" in its
 namespaces. Variables have other connotations) and SR symbols interact;
 sort of the level of "wolfram alpha". We have to give people at that level
 at least a way into sage, otherwise they don't even get to shoot
 themselves in the foot, experience that as unpleasant and then gain the
 motivation to learn how to avoid that in the future.
 >
 > There's a reason why maple, mathematica, maxima went with their
 approach. We can't quite do that, but we have to make the hurdle as low as
 possible. I think
 > {{{
 > var('x')
 > }}}
 > or
 > {{{
 > declare_var('x')
 > }}}
 > are about the best we can do. I think it's a problem they return
 something in addition to injecting a binding. If we need to produce
 feedback on the action taken, I think printing something would be
 preferable (it's a routine that's only meant to be used interactively
 anyway), so perhaps:
 > {{{
 > sage: declare_var('x,y')
 > Declaring x, y as symbolic variables
 > sage: A=declare_var('z')
 > Declaring z as a symbolic variable
 > sage: A
 > None
 > sage: declare_var('w',quiet=True)
 > sage:
 > }}}
 > (where the `quiet` would be the gateway to getting people to use other
 ways--perhaps we shouldn't provide that)
 >
 > I'd be completely OK with `declare_var` being spelled as `var` too. The
 main thing is that I think it has been shown that injecting ''as well as''
 returning something is harmful, so I hope we can change our interface to
 not do that.

--
Ticket URL: <http://trac.sagemath.org/ticket/17958#comment:25>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

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

Reply via email to