No, it's because FPC does not automatically generate code to initialize one variable with the value of another or the value of a function (which C supports.)
What I meant it that the way the FPC is currently implemented, initialization cannot be dynamic, because the code that parses the initialization directly spits out an assembly list (there is no intermediate layer like the node tree which allows the initialization to represent more complex concepts). It's literally: Read number -> Write to assembly.
It's very fast, but very limited, so it's not just values of a function, it's anything thats not a static data known at compile time. So for example you can't initialize managed records because the static assignment cannot execute the initialization operator (which is a bug).
It's just a technical limitation on how the FPC is currently build.
I find that very difficult to believe given that you have demonstrated having no grasp whatsoever of some of the most _basic_ concepts of compilers. What scope things are in is one of the most basic things there is and, btw, what is/belongs in one scope or another is independent of implementation. I don't care if you've read clang source or anything else. It has nothing to do with it.
What do you think a scope is? A scope is a set of symbols, represented through a symbol table. Scopes are spanned through syntax structures, in a strictly formal compiler (usually based on parsing tables), they would be strictly associated with AST nodes (which correspond to reduction rules in the grammar definition), while in a less formal compiler like a hand crafted recursive decent LL parser such as the FPC, scopes can be more dynamically managed (e.g. with statements do not have their own representation in the AST, they are basically macros based on an ephemeral symtable). But let's stick to the formal case.
Because you can do forward declarations in Pascal, functions are seperated in a function header and a function body. A forward declaration is a function header without a body and a function implementation is a header plus body.
<Function> ::= <Function Header>
| <Function Header> <Function Body>
Because the parameter symbols are defined in the function header, it must have it's own symtable independen of that of the function body (which contains any local declarations).
Additionally, if we look at the history of Pascal, while FPC is quite strict with scoping, TurboPascal isnt:
{$mode tp}
function foo: Integer;
var
foo: Double;
begin
end;
Here the variable foo shadows the function name (and thereby name of the result variable) foo. This is because the function header and the function body have different scopes.
When it comes to scanning and parsing, very little has changed in the last 60 or so years. There have been improvements but nothing that is a game changer. Moreover, some of the "improvements" have resulted in poorer language quality ("creative" compilers...)
It's not "creative", it's all based on formalisms. The problem is when the formalism doesn't make sense (like in JavaScript [2] == "2"). But even that was a mistake from 30 years ago that pretty much everyone agrees was a bad idea. Most of the current developments are in proving formalistic rules especially over the typesystem. Especially Algebraic typesystems with type inference that allow strict and static typing without losing flexibility in generic code. I mean the first version of that was introduced with ML already in the 80s, and all goes back to Prolog from the 70s, but the current developments both technologically (solving these constraint sets requires a lot of computing power) but also theoretically (as I mentioned before the CST has gone through some major discoveries with respect to new heuristics for efficient solving) make things possible which in the 70s and 80s where not feasable to be used on real world systems.
The automatic creation of a temporary in the "with" turns the "with" statement into a hidden assignment statement. The "with" statement is NOT an assignment statement. It is a scope declaration statement.
god forbid we "force" programmers to assign the result of a function to a variable. It's so much "easier" to create a hidden variable that represents the result and violate every principle of programming by allowing a value to be assigned to the functions' result outside the function. Convenience over correctness... that's the way to go.
With is what it is built to be. There is no fundamental rule on what with is supposed to be. Yes with declares a scope, but it declares a scope around an object. Either an already existing object, in case of a variable, or a newly allocated temporary object.
In my office I have a big fancy coffee machine. This machine fills coffee into a cup. If you bring your own cup great, it fills coffee in there. If you don't it gives you a new disposable cup to fill coffee into. Does this make the coffee machine now a cup dispenser? Not really, it's just a coffee machine which has a cup dispenser build into to fulfill it's role even if the user does not bring their own cup.
Similar with with. It creates a scope around an object. But if that object does not exist, it creates a new temporary object, limited to the scope of the with statement, to perform the action. Without it it could not provide it's functionality as intended