Understanding 'the defaultStack'

Richard Gaskin ambassador at fourthworld.com
Sat Oct 8 16:22:46 EDT 2016


J. Landman Gay wrote:

 > I have seen cases where the defaultstack doesn't follow the rule,
 > or uses some criteria I don't understand, where "go" doesn't set
 > the defaultstack automatically. I haven't yet pinned down a recipe.
 > Usually I just set it by script and move on.

The rule Dr. Raney gave me is that the defaultStack is the topmost 
visible stack of the lowest mode.

Beyond that I believe the only exceptions are normal scoping rules, such 
as a script in a palette stack referring to a button will try to resolve 
that reference in itself unless some other stack is specified.  But even 
then, calling "the defaultStack", regardless of where it's called from, 
should reflect that one rule unless you've explicitly sat it to 
something else.

If there are indeed exceptions it would be handy to find them and fix 
them.  Having a single rule for the defaultStack makes it very useful, 
and Raney'a definition seems logical.  If there are exceptions we might 
want to think long and hard about keeping them, as they may well be just 
regressions that crept in somewhere over the years.  I can't think of a 
case offhand where anything other than the one rule would be desirable.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list