Open Entomy opened 5 years ago
If I'm correct, Ada uses declare
as the formal way to declare variables, but it's rarely used except to create local scope for temporary variables similar to {...}
in C#.
Ada didn't borrow Pascal's var
block which IS required:
Var
Origin : Point = (X:0.0; Y:0.0);
Partial : Point = (X:0.0);
Empty : Point = ();
Using declare
instead of var
makes it clear the subsequent statements declare more than just variables. Are arguing it should be required.
@Joebeazelman Whether variables would be declared within a block or not would be its own issue to contend. If this proposed option were to go forward, it would assume no declaration blocks. If declaration blocks are kept, this would be redundant.
Ada does:
It should be:
Rationale: This proposal is twofold:
This enables the more orthogonal design of introducing everything with the keyword of what's being introduced.
It's better for the parser as we have a clear introduction instead of repeatedly guessing why an identifier is at the start of a statement.
While
variable
is used,var
would be fine. I'm optimizing for syntax because intellisense greatly reduces keystrokes regardless.