MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: garbage collection with Unique and Temporary

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69777] Re: garbage collection with Unique and Temporary
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Sat, 23 Sep 2006 04:43:52 -0400 (EDT)
  • References: <acbec1a40609212340t54f2838dpe4b944d6622748f0@mail.gmail.com>

I think the folowing might show the answer, which is, "Yes".

In[1]:=
vars={x[1],y[2]};
Module[{aliasList=Table[Unique[],{Length@vars}]},
  SetAttributes[#,Temporary]&/@aliasList;Print[aliasList];1+z]
??$1

From In[1]:=
{$1,$2}

Out[2]=
1+z

Information::notfound:Symbol $1 not found.

On 9/22/06, Chris Chiasson <chris at chiasson.name> wrote:
> Imagine that, inside a Module, I manually create a variable using
> Unique and assign it the Temporary attribute. If the variable does not
> appear in any definitions when the module exits, will it be garbage
> collected via Remove? If not, what happens?
>
> --
> http://chris.chiasson.name/
>


-- 
http://chris.chiasson.name/


  • Prev by Date: Re: Re: Add Quotation Marks to Data in a file
  • Next by Date: Re: Suggestions for translating a Do[] loop ...
  • Previous by thread: garbage collection with Unique and Temporary
  • Next by thread: DSolve fails with Telegraph equation