#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:29 egourgoulhon]:
> Indeed, the end user has hardly the need of `z = symbol('z')` (am I
right ?),
Searching our current codebase and examples indicates you might not be
right in that assumption. I didn't do a precise count, but the occurrences
of `a=var('a')` and `c,d=var('c,d')` are quite frequent (half of the `var`
occurrences maybe?), so there's definitely an immediate need for it to do
an automatic replacement.
The fact that this developed in the first place also suggests that a
significant number of people were not aware of/did not trust the injecting
behaviour of `var`, so it's probably "surprising" behaviour (it's
certainly non-pythonic to go and scribble in the globals dictionary). That
indicates to me that the routine doing it needs a name that makes explicit
it's having a side effect. A normal way of doing that is making the name a
verb or verbal phrase, hence `declare_var` or `declare_symbol`.
For obtaining a symbol as a return value a noun or nominal phrase should
be OK, hence `var` or `symbol`.
--
Ticket URL: <http://trac.sagemath.org/ticket/17958#comment:30>
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.