Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Strange behavior of the function Remove' topicStudent Support Forum > General > Archives > "Strange behavior of the function Remove"

Next Comment >Help | Reply To Topic
Author Comment/Response
Dmitry
09/10/12 03:00am

Hi,

Try executing the following command:
Remove[a]; a := 1
It removes symbol "a", but does not define it.
Of course, when executing separately, the following two commands
Remove[a];
a := 1
do what is expected.

Does anyone know, why a symbol definition following the removal of this symbol does not work?

P.S. I need this to manage memory usage by large amounts of data, e.g.:
(1) originally D is SetDelayed to load a huge array from disk into D, thereby D does not occupy a lot of memory before first use;
(2) once D is used first time, it turnes into a huge array;
(3) a symbol ClearD is defined (by SetDelayed), which removes D and then defines it as described in (1).
Thus D representing a huge array of data is available for computations anytime, but using the original SetDelayed definition and ClearD, I control its usage of memory.



URL: ,

Subject (listing for 'Strange behavior of the function Remove')
Author Date Posted
Strange behavior of the function Remove Dmitry 09/10/12 03:00am
Re: Strange behavior of the function Remove Bill Simpson 09/14/12 5:39pm
Re: Strange behavior of the function Remove Bill Simpson 09/14/12 6:10pm
Re: Re: Strange behavior of the function Remove Dmitry 09/16/12 01:44am
Next Comment >Help | Reply To Topic