Puzzlement about DumpSave (and/or DownValues)
- To: mathgroup at smc.vnet.net
- Subject: [mg110145] Puzzlement about DumpSave (and/or DownValues)
- From: James Stein <mathgroup at stein.org>
- Date: Fri, 4 Jun 2010 08:01:22 -0400 (EDT)
This looks like a bug to me, but I know appearances can deceive! Cell 1 below defines two symbols: foo and list. After evaluation of Cell1, I thought Cell 2 would dump and restore symbol 'foo' but it does not. Now here is puzzlement: If you change DumpSave's second argument from 'list' to '{foo}', the code works !-- even though these are "identical" expressions: {foo} === list evaluates to True. Here is a clue to what might be the problem: Despite the fact that foo === list [ [ 1 ] ], they have different DownValues. Can two symbols with different DownValues really be identical? (Well, to quibble, they are not both symbols... ) (* Define a list of Symbols used in compound Heads: *) ClearAll [ foo, list ]; foo[ 1 ] = { 1, 2, 3 }; list = { foo }; (* Cell 2 fails *) DumpSave [ "foo.mx", list ]; ClearAll [ foo ]; Get [ "foo.mx" ]; (* Get what was dumped *) Definition[foo] (* Alas-- we get'Null' for foo! *) This is a simplified example, of course. I have hundreds of symbols, not just 'foo', and each is used as a compound head in several different ways. I was hoping to dump all these definitions to a single file. I hope I'm missing something that will make me feel dumb...