Libraries, 'start using' and stacks

Richard Gaskin ambassador at
Wed Oct 4 18:19:09 EDT 2006

Dave Cragg wrote:
> The stack doesn't have to be open before you "start using" it. You  
> can "start using" a stack directly with a file reference. (start  
> using stack "libsFolder/myLib.rev") When you start using a stack,  
> it's open in the sense that it is loaded into memory. But it doesn't  
> receive any openstack/opencard messages. Also, it isn't visible, but  
> it can be made visible in the normal way. (show stack "myLibrary")

But there is one odd anomaly worth noting, and unfortunately my BZ 
request is unlocatable now (purged?) so I have to reproduce the 
discussion here:

There is a conflict between the "close" command and the "stop using" 
command with regard to stacks which have their destroyStack property set 
to true.

Everything you say above applies, but if your library has its 
destroyStack set to true and you open it to work on it, as long as it's 
open it's still in the message path but once you close the stack it also 
gets pulled from memory, and hence from the stacksInUse queue.

The question for the designer of the engine is whether "close" should 
also mean "...and remove from stacksInUse", or whether "close" should 
simply mean "close" and continue honoring the stacksInUse until a "stop 
using" command is issued.

For myself, the choice seems clear enough in favor of the latter, esp. 
given that the independence of "open"/"close" from "start using"/"stop 
using" is already well established by being able to insert stacks in the 
message path without needing to open them.

So my BZ request was to complete the separation of the two sets of 
actions by also allowing a stack to be closed without altering its place 
in the stacksInUse.

If others here agree I'll reinstate my BZ request.

  Richard Gaskin
  Managing Editor, revJournal
  Rev tips, tutorials and more:

More information about the Use-livecode mailing list