CC'ed to => for follow ups
Graeme Geldenhuys wrote 8 lines
Apart from the general yes/no question....
(and I haven't looked deep into language design..., still...)
If for arguments sake, it was a yes:
1) "begin/end" are compound statements, not scopes (even mentioned on the big forum thread)
2) If a "inline scope" existed, no mention of "inline var" only at the start thereof.
3) same keyword "var" but significant difference: block vs single statement (one var only)
Currently (not tested), but from description
if foo then begin
writeln;
var bar: integer = 1; // mid (implied) scope
readln;
end;So within the "for arguments sake", shouldn't it then be
if foo then
// optional introduction of new keyword to start scope
var // "var" starts scope (and must be followed by "begin"
bar: integer = 1;
bar2: integer = 2;
begin
writeln;
readln;
end;- Without a "scope keyword" => "var" starts the new scope. That scope covers the next statement (which must be compound begin/end).
- var block ends at begin (which starts the statement for which the scope will last)
And the "for var i :=
is inconsistent. Its the only one that allows "var" mid-statement. (wel, its the only(?) LHS that can be mid statement...)
Any word on multi-line text blocks? ;-) Coming from Java, I so MISS that in Object Pascal! :-D
Aren't they in 3.3.1 already? And 2 forms? backtick and multi-single-quote?
