cross-stack globals, also, file inclusion

Martin Baxter martin at
Sat Oct 25 19:39:36 EDT 2003

>Dar Scott wrote:
>I don't see how a compiled script can see a constant as other than a
>special global variable that cannot be changed.

Well I'm wading deeper into my ignorance here but I guess that from the
compiler's point of view a constant would presumably look the same way that
a variable looks to the engine at runtime, in that it represents a value
that has to be fetched from somewhere else. But I see no reason why a
constant would have to be got from some other location other than inline
with the object code at runtime. What would be the point of doing that ?

As I think of it, the routine data chunks we deal with are more-or-less
anonymous bytes until a piece of code actually runs, and that's presumably
when the engine finally decides how to treat them.

It may be that the compiler attempts to determine datatype by context at
compile-time or it may be that it leaves that decision for runtime and just
stores literal data in the object code as unmodified ascii code bytes (the
latter seems more likely to me). But either way I would expect the stored
value of the constant itself to be effectively "type-agnostic" and probably
just the ascii codes that I keyed in.

So if I had a global constant fred=123, I would expect the compiler to use
"add fred to x" exactly as if I had written: "add 123 to x"
And to use "put fred' the same as if i'd written "put 123"

And I would be free to do either or both as circumstance demanded.

I dimly recall that Hypercard held all values as strings internally, and
that may be colouring my expectations, clearly revolution is more complex
than Hypercard. But whatever happens internally, so long as it looks to me
like that's what's happening "I probably don't need to know the gory
details" ;-)


More information about the Use-livecode mailing list