August Karlstrom said:
Could you describe the semantics of scope and and lifetimes of variables
in such a language or do you know of an actual language where the above
code would make sense?
You are really stretching things here. The code you posted is C code,
right? How could it "make sense" in any other context?
To clarify: If we posit the existence of another language, in which pointers
are safe, then obviously that language isn't C. That's what I've been
saying all along. I don't see how posting C code is likely to tell us
anything about non-C languages (i.e., languages that aren't C).
Nitpickers note: Yes, I know there are some languages that are "almost C" -
probably close enough to C that your code would make sense to a
user/programmer of that "almost C" language, but that's obviously not the
point. And, as our friendly neighborhood regulars are so fond of pointing
out, C++ (for example) is completely different from C (as is C# and, for
that matter, anything else that isn't, in their tiny world view, C).
But I digress...
--
But the Bush apologists hope that you won't remember all that. And they
also have a theory, which I've been hearing more and more - namely,
that President Obama, though not yet in office or even elected, caused the
2008 slump. You see, people were worried in advance about his future
policies, and that's what caused the economy to tank. Seriously.
(Paul Krugman - Addicted to Bush)