On 09/04/2011 22:58, Jonathan M Davis wrote:
<snip>
So how, exactly, does the runtime get at data that doesn't exist?

Every time that you use an enum, it's replaced with the enum's value. So, it's
like you put a literal there which was identtical to the enum's value. So,
<snip>

That's what I'd made out people were saying. But Don seemed to be claiming that the [1, 2, 3, 4] doesn't exist at runtime.

If a had been an immutable variable, then a would not have been replaced with
its value in the writeln call, but rather a would be passed to writeln.

Exactly.

What I'm claiming ought to happen is for a to be replaced at compiletime with the (length, address) tuple pointing to [1, 2, 3, 4]. Am I imagining it, or is this basically the way string literals work?

Stewart.

Reply via email to