- To: mathgroup at smc.vnet.net
- Subject: [mg29178] Compound Expressions
- From: aes <siegman at stanford.edu>
- Date: Fri, 1 Jun 2001 04:15:40 -0400 (EDT)
- Organization: Stanford University
- Sender: owner-wri-mathgroup at wolfram.com
I see that the following is what Mathematica does, so it's clearly what Mathematica does: In:= a = 3; Remove["Global`*"]; a = 3; a Out= 3 In:= a Out= a In:= a = 3; Remove["Global`*"]; Print[a]; a = 3; Print[a] From In:= Removed["a"] From In:= 3 In:= a Out= 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 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 and In 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?