MathGroup Archive 1995

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

Search the Archive

Problem with Contexts


I experienced the following problem when defining Contexts:

Mathematica 2.2 for NeXT
Copyright 1988-93 Wolfram Research, Inc.
 -- NeXT graphics initialized -- 
In[1]:= Begin["Alice`"]
Out[1]= Alice`
In[2]:= x=1;y=2;x+y
Out[2]= 3
In[3]:= Begin["Bob`"]
Out[3]= Bob`
In[4]:= x=11;y=22;x+y
Out[4]= 33
In[5]:= Begin["Alice`"];y-x
Out[5]= 11
In[6]:= y-x
Out[6]= 1
In[7]:= Exit

For the In[5] I try to change the Context and do a calculation in
the same command, but the calculation is done using the previous
Context ("Bob"). However, the Context was changed as noted when
the calculation is repeated (In[6]). Is this a bug or am I missing
something about how Contexts are used and defined.

BTW--I found the same problem when using the Notebook interface BUT
when I concatenate the commands on separate lines it works okay--

Begin["Alice"];y-x

doesn't work, but

Begin["Alice"];
y-x
(the Shift-Return)

does work.

Thanks for the help,
Charlie

-- 
	NeXTMail to:		|	...to confer, converse, and 
	charlie at technosci.com	|	otherwise hobnob with my    
				|	brother wizards.	    



  • Prev by Date: Re: Extracting DSolve[]'s solution
  • Next by Date: Re: Re: Unique List
  • Previous by thread: Re: Extracting DSolve[]'s solution
  • Next by thread: Re: Problem with Contexts