Playing around with the benefits of using THIS SCRIPT over a variable and found this:
So does IS IDENTICAL have special semantics for THIS SCRIPT? I’m confused…
Playing around with the benefits of using THIS SCRIPT over a variable and found this:
I believe that what’s going on here is that THIS SCRIPT creates a new structure (a ringed copy of the script) each time you call it, so they’re equal but not identical to each other.
Since the expression isn’t being evaluated immediately, the variable is indeed being set before it’s called.
OK, is there a way to fix this?
Umm, I don’t see it as something to be fixed. IS IDENTICAL is meant to be a very strict comparison; it’s true only if the two data structures occupy the same space in memory, i.e., aren’t two structures at all, but one structure.
Is there a reason = isn’t what you want?
I think for stuff like a top-level script it shouldn’t be the same, but for something which is already a context, it should report the same context.
This would be rather confusing. Why do you want this?
Because it’s impossible to get a ring for a top level script, but any other level of script must be a context of some sort.