#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:39 mmezzarobba]:
> 1. Implement `%var a, b` (or perhaps `var a, b`) and/or
`SR.var('a').inject()`, leaving `var()` alone for the moment.
> 2. Change as much as possible of the documentation and examples to use
either `a = SR.var('a')` or `%var a`.
You'd need to take into account that the `%var` processing is done by the
REPL. So for notebook, ipython and the doctest framework (and any new
interfaces that arise) you'd have to provide it.
By making `var` not a function you're also blocking off reasonable
programmatic use. Presently:
{{{
sage: var(''.join('x%d '%i for i in [1..10]))
(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)
}}}
This is comparable to why in Python3 print was turned into a function.
Otherwise I like the missing quotes in the syntax; I dislike having to
explain what the modulo or string formatting sign is doing at the start of
a line when you're explaining to someone that sage is "just like python"
(should they know that already).
`SR.var('a').inject()` has problems. The incantation is obviously
atrocious to type. But also: note that `inject()` would simply be a method
on an expression. Would it inject all variables that occur in it?
--
Ticket URL: <http://trac.sagemath.org/ticket/17958#comment:41>
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.