On 2021-10-07 15:57, Brian Milby via use-livecode wrote:
Clone stack avoids the check.  It is not that hard to get multiple
stacks with the same short name but different long names in memory (in
a standalone).  The engine makes sane choices when referencing the top
stack in that case.  Any individual stack can be referenced via the
long name.

Yes indeed, you don't actually need to even use clone stack - just 'set the name of' will do it.

However, the fact you can do that from script is a different case from what the IDE should let you do in the normal course of things (and indeed, perhaps we should plug the holes in the engine which let it happen) in (a perhaps vain?) attempt to stop people tying themselves into too many knots.

Things like the 'topStack' and 'defaultStack' are only sane references to the actual underlying stack if they are used as direct syntax (where they resolve to the internal pointer). As soon as they are rendered to a string (e.g. when passed as an argument) that link is gone - further, if a stack has not been saved then there is no way to distinguish one from the other with any string-based reference (a stack's long id is only different from its name / long name if it has a filename).

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to