# $MessageList inside and outside Block[] Why does 1/0$MessageList

ComplexInfinity


whereas

Block[{},
1/0;
$MessageList ]  Power::infy  ? At first sight I supposed that this disparity could be related to an answer I got here subtleties about variable shadowing in Block[] "Symbols are created at the instant that they are read -- not when they are evaluated.". But, may be, this time we are facing a totally different problem because $MessageList exists rigth before Block[] is read.

Have I missed some point explained in Messages leak out from Block ?

Thanks once more !!

• Not sure what do you expect, Block has nothing to do with this, try 1/ 0; $MessageList.Or have I missed something? – Kuba Mar 30 '15 at 10:13 • I expect the same message (Power::infy or ComplexInfinity) in both situations. – mitochondrial Mar 30 '15 at 12:27 • You should not, you have CompoundExpression in Block and two separate lines in first code area. $MessageList remembers only current execution line – Kuba Mar 30 '15 at 12:29

$MessageList is a global variable that gives a list of the names of messages generated during the evaluation of the current input line. The confusion is probably due to the wording, in reality Wolfram System reads expression by expression but not less than one line. See How parsing works, more or less. Those are two separate inputs 1/0$MessageList

Block[{},