Hi all

> > Consider the following situation
> > ---------
> > sage: xc = var('x')
> > sage: xr = var('x', domain='real')
> > sage: xc
> > x
> > sage: xr
> > x
> > sage x
> > x
> > ---------

I beg your pardon for asking silly questions... would you please
explain which is the reason for having different variables with the
same name... and even more, with different domains?
I could be wrong but this looks me more like a confusing thing, rather
than a feature... am I wrong? Why don't simply remove the chance to
have this, and in case the variable is redefined with the same name,
just delete it and define it again?

If not, could you please make an example of usefulness of this? Thanks
a lot!

On 4 Set, 20:48, William Stein <wst...@gmail.com> wrote:
> 2009/9/4 Golam Mortuza Hossain <gmhoss...@gmail.com>:
>
>
>
> > Hi,
>
> > I am working on a patch that exposes few more properties
> > of GiNaC symbols in Sage. This will allow users to specify
> > their domains as well as custom latex_names.
>
> > Using Stan's example, it would be possible to do
> > -------
> > sui = var('sui', domain='real', latex_name="\\color{red}\\s_{u,i}")
> > -------
>
> Feature request -- can you make it so the *docstring* for the variable
> can be specified?  I will have to do this soon anyways if you don't,
> since it is needed for the units package.
>
> E.g.,
>
>   meter = var('meter', docstring="A meter is...", latex_name="m")
>

By the way, which is the status of the units package? Is the code
somewhere on the net? I'm quite curious! :)

Regards

Maurizio

>
>
> > However, there are some issues that needs to be discussed.
> > It seem that in GiNaC, its not possible to update the domain
> > of an already defined variable. On the hand one can have
> > different variables with same name (but different serial).
> > Thus, we need to move pynac symbol directory within Sage to allow
> > flexible usage but still keep unique variable names.
>
> > Consider the following situation
> > ---------
> > sage: xc = var('x')
> > sage: xr = var('x', domain='real')
> > sage: xc
> > x
> > sage: xr
> > x
> > sage x
> > x
> > ---------
>
> > Here we have two choices
>
> > (1)
> > ---------
> > sage xr is xc
> > True
> > sage: xr - xc
> > 0
> > ---------
>
> > (2)
> > -----------
> > sage: xr is xc
> > False
> > sage: xr - xc
> > x - x
> > -----------
>
> > Now my question is whether we should allow (2) or (1) ?
>
> I don't know.  I'm curious -- what does Maxima do?  Note that if
> Maxima can't do this, i.e. ,have one variable name with two domains,
> it will make using Maxima for anything more complicated, though not
> impossible, since we just name mangle the variable when moving it back
> and forth to Maxima.
>
> William
>
>
>
> > See also Burcin's this mail for related discussion
>
> >http://groups.google.com/group/pynac-devel/browse_thread/thread/76868...
>
> > Cheers,
> > Golam
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to