Yes, but the way I think of it is if you do a ‘go’ to another stack, then the defaultStack changes so that you can make shorter references to objects in what is most likely then the current stack of interest. I got in a muddle because that isn’t always true. I suppose I rubbed along for a few years before I got hit by that particular gotcha, so in a way Richard you’re right. Good documentation is probably all that’s needed, rather than trying to alter the engine’s behaviour.
My two Brexit-influenced, over-valued, eurocents.
> On 14 Oct 2016, at 23:08, Richard Gaskin <[hidden email]> wrote:
> Monte Goulding wrote:
> >> On 15 Oct 2016, at 8:01 AM, Richard Gaskin wrote:
> >> I can't recall the last time I needed defaultStack. It may well
> >> have been quite recently, but it must being doing what I expected
> >> it to do since I've never had to think about it before this thread.
> > Every time you use an object reference that doesn’t contain an
> > explicit stack reference you are using the defaultStack. You might
> > not be getting or setting the value but you would be depending on
> > it in a large part of your code.
> Exactly. It must be working pretty well as it is or we would have had many more confused posts for decades rather than just a dozen only very recently.
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> [hidden email]http://www.FourthWorld.com >
> use-livecode mailing list
> [hidden email] > Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
I think the more experienced devs have found ways to work around it. When in doubt, they use absolute references and don't depend on the engine to resolve relative references for them. I'm not sure if that makes your point or counters it. ;-)
>> On Oct 8, 2016, at 13:22 , Richard Gaskin wrote:
>>> The rule Dr. Raney gave me is that the defaultStack is the topmost
>>> visible stack of the lowest mode.
>> On Oct 14, 2016, at 14:21 , Peter Bogdanoff wrote:
>> Just tested in 8.1.1 RC 2: Two stacks open, one stack is the
>> topStack and is the defaultStack.
>> Setting that stack’s visible to false keeps it as the defaultStack
>> and the topStack.
> That breaks Dr. Raney's rule.
It's been nearly two decades since I had that conversation with Dr.
Raney. As I noted earlier, and as Jacque and Peter confirm, it's likely
I was just mistaken - it seems the actual rule is even simpler:
The defaultStack is the topmost stack with the lowest mode.
> I'm not sure who I am anymore...
Unless you've experienced a problem with it, just keep doing what you're
doing. It seems to be working as expected for most people in most
circumstances. We have more posts here exploring its definition than
about problems relating to its behavior.
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
On 10/15/16 9:53 AM, Richard Gaskin wrote:
> We have more posts here exploring its definition than about problems
> relating to its behavior.
The discussion was very helpful for me, I've never been clear about when
I need to specifically set the defaultstack, and usually I only figure
it out when errors happen. Then I'd set it specifically, still never
understanding why I had to.
I do use the defaultstack whenever I have many actions that need to
apply to a stack. If I'm only referring to an object once or twice I use
a long ID or name, but if I need to do lots of stuff it's way easier to
have a defaultstack.
One good example is the stack-builder tool I wrote for a client, which
creates and updates stacks. During creation there are hundreds of
commands to create objects, apply scripts and properties, import images,
etc. Using long references in every line of that code would be burdensome.
Until now I couldn't understand why "create stack x" required me to set
the defaultstack to the newly created one. Now I do.
> On Oct 15, 2016, at 10:53 AM, Richard Gaskin <[hidden email]> wrote:
> Bob Sneidar wrote:
> > I'm not sure who I am anymore...
> Unless you've experienced a problem with it, just keep doing what you're doing….
Be yourself -- everyone else is already taken. -- Oscar Wilde