Re: Compound Expressions
- To: mathgroup at smc.vnet.net
- Subject: [mg29188] Re: [mg29178] Compound Expressions
- From: Ben Jacobson <bjacobson at illumitech.com>
- Date: Sat, 2 Jun 2001 05:54:42 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I get the same result with the input on the same line. But then if I use "Enter" to split the input into different lines, but still all a single CompoundExpression, it works as expected: Reproducing earlier result --------------------------- In[1]:= a = 3; Remove["Global`*"]; a = 3; a Out[1]= 3 In[2]:= a Out[2]= a Splitting input into different lines ------------------------------------- In[3]:=a = 3; Remove["Global`*"]; a = 3; a Out[6]=3 In[7]:=a Out[7]=3 This is truly weird. Ben Jacobson Illumitech Inc. At 04:15 AM 6/1/01 -0400, you wrote: >I see that the following is what Mathematica does, so it's clearly what >Mathematica does: > > In[147]:= a = 3; Remove["Global`*"]; a = 3; a > > Out[147]= 3 > > In[148]:= a > > Out[148]= a > > In[149]:= a = 3; Remove["Global`*"]; Print[a]; a = 3; Print[a] > > From In[149]:= Removed["a"] > > From In[149]:= 3 > > In[150]:= a > > Out[150]= a > >What I don't understand is, not what Mathematica does here -- I'm not >interested in tracing out the details; I believe it happens --but *why* >the language would have to be designed to function in this (utterly >bizarre and utterly confusing) way? > >To be more specific about this gripe: > >* The "Remove" expression clearly removes "a" immediately when it is >encountered, as the output of In[149] in particular confirms. > >* The subsequent "a=3" expression then clearly recreates "a" and >assigns it a value *after* the "Remove" has been processed, as both >In[147] and In[149] confirm. > >So how does it make sense to have the "Remove" come back to life and >operate *again*, long after it should have been forgotten, so to speak? > >Does it *have* to be designed this way? > >