MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: math =!= mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108625] Re: math =!= mathematica
  • From: hemmecke <hemmecke at gmail.com>
  • Date: Thu, 25 Mar 2010 04:28:07 -0500 (EST)
  • References: <hocm7l$sfn$1@smc.vnet.net>

> >In[1]:= BeginPackage["A`"]
> >Out[1]= A`
>
> This is acceptable syntax. But do you really want a context with
> a one letter uppercase name? That practice will almost certainly
> cause you grief at some point.

I prepared my message for a short demonstration. Of course, I don't
use just A` as a context name. But, actually, what's wrong with A`
except for a name that is not conveying any meaning. It's a proper
name for a Mathematica context. Am I wrong?

> >In[2]:= {$ContextPath, $Context}
> >Out[2]= {{A`, System`}, A`}
> >In[3]:= `Array[c,3]=17

> What is it you want to do here? Redefine the built-in symbol
> Array? Definitely not a good idea.

OK, let me make my point clearer. Suppose we are in 2008 or even 2007.
http://www.wolfram.com/news/mathwire/mw-01-2009.html
That is, I am using Mathematica 6 and I'm writing a package that deals with q-
binomials.
Since I know, how to define them, I create a package and define a
function MyPackage`QBinomial that takes 3 parameters.
Of course, everything works fine, every test passes and I release it
to the public.

Then in 2009 Mathematica 7 come out and suddenly my package is broken.
You can also assume that I don't export my QBinomial, but just have it
in a `Private` context. Still, I don't want that any new Mathematica
version should influence my definition.
So replace Array in my previous code by QBinomial and appropriate
definitions and then maybe you know what the problem is.

And no matter what, but don't you find

In[5]:= `Array[c,3]

General::dupsym: The symbol Array with context A` already exists.

Out[5]= Removed[Array][c, 3]

a bit strange? Why "Removed[Array]"? I've never entered a "Remove"
command.

Ralf


  • Prev by Date: Re: Solving differential equations in Mathematica 7.0
  • Next by Date: Re: math =!= mathematica
  • Previous by thread: Re: math =!= mathematica
  • Next by thread: Re: math =!= mathematica