What determines what is assigned to Out[]?
- To: mathgroup at smc.vnet.net
- Subject: [mg80285] What determines what is assigned to Out[]?
- From: "Andrew Moylan" <andrew.j.moylan at gmail.com>
- Date: Thu, 16 Aug 2007 07:20:45 -0400 (EDT)
All of the following result in % returning 1: 1; x = 1; x = 1; x = Null; Module[{}, x = 1;] I am starting to see a pattern here. Can anyone explain the exact rule that determines what gets assigned to the Out[] variable? This is important because, for example, compare the following fairly equivalent pieces of code: Module[{}, m = RandomReal[1, 10000000]; flag = 1;] Module[{}, flag = 1; m = RandomReal[1, 10000000];] The former assigns 1 to Out[], whereas the latter assigns a roughly 80MB lump of random reals to Out[]!