is there a way to delete global variables?
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
is there a way to delete global variables?

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Cadence
Author Message
bennys



Joined: 18 Aug 2005
Posts: 2

Posted: Mon Oct 31, 2005 1:10 pm    Post subject: is there a way to delete global variables? Reply with quote

once a variable is defined (for example by a=5)
is there a way to remove it from the memory without exiting cadence?
(after which an error "*Error* toplevel: undefined variable - a" should
appear in the CIW when trying to access the variable a)

Back to top
View user's profile Send private message
Andrew Beckett
Guest





Posted: Mon Oct 31, 2005 5:10 pm    Post subject: Re: is there a way to delete global variables? Reply with quote

On 31 Oct 2005 04:14:09 -0800, "bennys" <bennys@il.ibm.com> wrote:

Quote:
once a variable is defined (for example by a=5)
is there a way to remove it from the memory without exiting cadence?
(after which an error "*Error* toplevel: undefined variable - a" should
appear in the CIW when trying to access the variable a)

a='unbound

would do it.

Andrew.
Back to top
Trevor Bowen
Guest





Posted: Mon Oct 31, 2005 5:10 pm    Post subject: Re: is there a way to delete global variables? Reply with quote

is there a way to remove it from the oblist?

gc() - doesn't seem to help...

Andrew Beckett wrote:
Quote:
On 31 Oct 2005 04:14:09 -0800, "bennys" <bennys@il.ibm.com> wrote:


once a variable is defined (for example by a=5)
is there a way to remove it from the memory without exiting cadence?
(after which an error "*Error* toplevel: undefined variable - a" should
appear in the CIW when trying to access the variable a)


a='unbound

would do it.

Andrew.


Back to top
Andrew Beckett
Guest





Posted: Mon Oct 31, 2005 5:10 pm    Post subject: Re: is there a way to delete global variables? Reply with quote

On Mon, 31 Oct 2005 09:48:47 -0600, Trevor Bowen <m27315@gmail.com> wrote:

Quote:
is there a way to remove it from the oblist?

gc() - doesn't seem to help...



No. Once a symbol is in the symbol table, it's there until you exit. Note, a
variable does not have to be created for something to end up in the oblist -
doing:

a='someSymbol

will put someSymbol in the symbol table (note, oblist is really a mirror of the
internal symbol table, in list form). There is no garbage collection of symbols,
which is why you should be very careful about using symbols as dynamic data
structures.

That said, doing something like this:

a=myVar

will also put myVar in the symbol table, with a value of unbound. So it's no
different having an uninitialised variable than a variable which has been set to
unbound.

The amount of saving (in normal situations) by removing a symbol from the symbol
table is likely to be very small, so there is little benefit in doing this.

Regards,

Andrew.
Back to top
Trevor Bowen
Guest





Posted: Mon Oct 31, 2005 9:10 pm    Post subject: Re: is there a way to delete global variables? Reply with quote

Thanks for the insight, Andrew!

Andrew Beckett wrote:
Quote:
On Mon, 31 Oct 2005 09:48:47 -0600, Trevor Bowen <m27315@gmail.com> wrote:


is there a way to remove it from the oblist?

gc() - doesn't seem to help...




No. Once a symbol is in the symbol table, it's there until you exit. Note, a
variable does not have to be created for something to end up in the oblist -
doing:

a='someSymbol

will put someSymbol in the symbol table (note, oblist is really a mirror of the
internal symbol table, in list form). There is no garbage collection of symbols,
which is why you should be very careful about using symbols as dynamic data
structures.

That said, doing something like this:

a=myVar

will also put myVar in the symbol table, with a value of unbound. So it's no
different having an uninitialised variable than a variable which has been set to
unbound.

The amount of saving (in normal situations) by removing a symbol from the symbol
table is likely to be very small, so there is little benefit in doing this.

Regards,

Andrew.
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Cadence All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB