Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> wrote:On 18/03/2025 12:17, Waldek Hebisch wrote:
A declaration like:There were some tweaks needed; it indicates some basic info missing fromWell, my intentions beter correspond to the C version below:
my write-up! (For example, that the function call needs to be bar() not
bar; 'const' is only for compile-time expressions; and that C's 'const'
doesn't exist - it only briefly mentions an attempt at 'let'.)
>
The revised code is shown below, with what I assumed were your
intentions.
int foo() {
const int c = c1(10);
const int b = c + c2(2);
const int a = b+c3(c);
bar();
baz();
return c;
}
Part of the question was if "execution" of declarations is
interleaved with execution of code or if declarations go
before the code.
That doesn't happen here:print aI see. So your feature conflicts with C feature "variable which is
int a:=100
>
the assignment is done at that place in the code (after print), but the
scope of 'a' is function-wide. My compiler doesn't detect accesses to
unitialised variables, but I could add a debug option to clear
stack-frame variables on function entry.)
initialized at declaration time is always used initialized".
Les messages affichés proviennent d'usenet.