BookmarkSubscribeRSS Feed
vince_faller

Super User

Joined:

Mar 17, 2015

clear all variables in the here namespace

is there any way to delete the here namespace?  Or more to the point, all the variables in it without knowing the variable names?

namespace("here") << Delete

doesn't seem to work.  I could << Get contents and for through it, but I'm just wondering if there's a better way.  

1 ACCEPTED SOLUTION

Accepted Solutions
mpl34

Community Trekker

Joined:

Feb 16, 2016

Solution

Re: clear all variables in the here namespace

Does this work:

 

namespace("here")<<remove(namespace("here")<<getkeys);

 

At least you don't have to for through it.

3 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

Re: clear all variables in the here namespace

See if this will do what you want:

Names Default To Here( 1 );
x=44;
show(here:x);
clear symbols();
show(here:x);
Jim
vince_faller

Super User

Joined:

Mar 17, 2015

Re: clear all variables in the here namespace

nah, I want only the here namespace to be deleted (even more than cleared really)

::y = 14;
Names Default To Here( 1 );
x=44;
show(here:x);
show(::y);
delete symbols();
show(::y);
mpl34

Community Trekker

Joined:

Feb 16, 2016

Solution

Re: clear all variables in the here namespace

Does this work:

 

namespace("here")<<remove(namespace("here")<<getkeys);

 

At least you don't have to for through it.