954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to clear work space in Lua ?

Hi,

Is there any way to "clear" work space in Lua similar to the clear command in Matlab ?

Thanks !!

kartik14
Light Poster
32 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 
Is there any way to "clear" work space in Lua similar to the clear command in Matlab ?

There's not a built-in function to do that. Offhand, I think the simplest thing to do would be to run through the global environment , setting everything to nil . You'd have to be careful not to nuke any standard libraries you still want to have available, though--library functions are stored in global tables.

gusano79
Posting Pro
521 posts since May 2004
Reputation Points: 182
Solved Threads: 77
 

Ok , thanks !!

kartik14
Light Poster
32 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: