Modernised Pascal
From Free Pascal wiki
more strongly syntax
1)
if ... then
...
elsif {!}
...
else
...
end; {!}
2)
if 1 > a < 3 then ... {!} end
3)
for i := 1 to 30 {+} step 5 {+.} do end {!}
4)
while ... do ... end; {!}
5) alias for long name:
when a = other_long_name1, b = other_long_name2 {!} do a.method1; end; {!}
6) block variables & initialization in declaration section:
declare // ? var a: integer := DataSet1.Field[1].AsInteger; const b: integer = 1; begin ... end;
7) (?) property information 'access' abstraction ( on code compilation phase ):
TClass1 = class ... published property FieldInt: Integer read fFieldInt write fFieldInt default 100; end;
constructor TClass1.Create(... begin inherited; fFieldInt := TClass1.FieldInt.DefaultValue; {!} // for non object types end;
procedure TClass1.Check(... begin if fFieldInt = TClass1.FieldInt.DefaultValue then ... end
- Rejected. A proposal like this show exactly why begin/end is elegant, you don't need elseif.
- Rejected. Only purpose is to save some typing.
- "step" proposal not rejected (but not accepted as well), removal of "begin" rejected
- Rejected ... for removal of "begin"
- Rejected; aliases makes code harder to read.
- Don't understand what you want here.
- const field_default=100 does the same. Rejected.
Daniel-fpc 11:02, 17 Dec 2005 (CET)