diff --git a/InstallerSamples/WhatsNew/3_11_0/AdjacentGroupBy.pas b/InstallerSamples/WhatsNew/3_11_0/AdjacentGroupBy.pas new file mode 100644 index 000000000..c1a9ecb16 --- /dev/null +++ b/InstallerSamples/WhatsNew/3_11_0/AdjacentGroupBy.pas @@ -0,0 +1,22 @@ +// 3.11 - AdjacentGroupBy +type + Player = auto class + Name: string; Score: integer; + end; + +function GetPlayers := [ + new Player('Alice', 95), + new Player('Bob', 95), + new Player('Charlie', 110), + new Player('Diana', 110), + new Player('Karina', 120) +]; + +begin + var leaderboard := GetPlayers; + foreach var group in leaderboard.AdjacentGroupBy(p -> p.Score) do + begin + Println(group.Key); + group.Println; + end; +end. \ No newline at end of file diff --git a/InstallerSamples/WhatsNew/3_11_0/ArrInitWithEmpty.pas b/InstallerSamples/WhatsNew/3_11_0/ArrInitWithEmpty.pas index 0e4fc30c7..530e7e802 100644 --- a/InstallerSamples/WhatsNew/3_11_0/ArrInitWithEmpty.pas +++ b/InstallerSamples/WhatsNew/3_11_0/ArrInitWithEmpty.pas @@ -1,4 +1,4 @@ -// Уточнение инициализации элемента массива пустой коллекцией +// 3.11. Уточнение инициализации элемента массива пустой коллекцией begin var a: array of array of integer := [[],[],[1]]; Println(a,TypeName(a)); diff --git a/InstallerSamples/WhatsNew/3_11_0/BetweenNew.pas b/InstallerSamples/WhatsNew/3_11_0/BetweenNew.pas new file mode 100644 index 000000000..26e7856f1 --- /dev/null +++ b/InstallerSamples/WhatsNew/3_11_0/BetweenNew.pas @@ -0,0 +1,11 @@ +// 3.11. Внешняя Beetween +begin + Between(6,2,6).Print; + Between(6,2,6,inclusive := False).Println; + +// Универсальная Between. Должен поддерживаться интерфейс IComparable + var dt1 := DateTime.Create(2025,04,16); + var dt3 := DateTime.Now; + Between(DateTime.Now,dt1,dt3).Print; + Between(DateTime.Now,dt1,dt3,inclusive := False).Println; +end. \ No newline at end of file diff --git a/InstallerSamples/WhatsNew/3_11_0/Flag1.pas b/InstallerSamples/WhatsNew/3_11_0/Flag1.pas index 649e76a29..5af0f0abd 100644 --- a/InstallerSamples/WhatsNew/3_11_0/Flag1.pas +++ b/InstallerSamples/WhatsNew/3_11_0/Flag1.pas @@ -1,4 +1,5 @@ -uses Graph3D; +// 3.11. Cloth - анимируемый объект из ткани +uses Graph3D; begin Window.Caption := 'Развевающийся флаг'; diff --git a/InstallerSamples/WhatsNew/3_11_0/InRange.pas b/InstallerSamples/WhatsNew/3_11_0/InRange.pas index bae4f2d17..5f5863273 100644 --- a/InstallerSamples/WhatsNew/3_11_0/InRange.pas +++ b/InstallerSamples/WhatsNew/3_11_0/InRange.pas @@ -1,4 +1,5 @@ -begin +// 3.11. Внешняя InRange +begin // Поведение изменено!! Теперь диапазон [6,2] считается пустым 5.InRange(6,2).Println; diff --git a/InstallerSamples/WhatsNew/3_11_0/IsOrdered1.pas b/InstallerSamples/WhatsNew/3_11_0/IsOrdered1.pas index c7890adf8..47ad41257 100644 --- a/InstallerSamples/WhatsNew/3_11_0/IsOrdered1.pas +++ b/InstallerSamples/WhatsNew/3_11_0/IsOrdered1.pas @@ -1,4 +1,5 @@ -type +// 3.11 - IsOrdered +type Player = auto class Name: string; Points: integer; end; diff --git a/InstallerSamples/WhatsNew/3_11_0/ParticleSystem.pas b/InstallerSamples/WhatsNew/3_11_0/ParticleSystem.pas index 133879824..25725c168 100644 --- a/InstallerSamples/WhatsNew/3_11_0/ParticleSystem.pas +++ b/InstallerSamples/WhatsNew/3_11_0/ParticleSystem.pas @@ -1,4 +1,5 @@ -uses Graph3D; +// 3.11. ParticleSystem +uses Graph3D; begin View3D.BackgroundColor := Colors.Black; diff --git a/InstallerSamples/WhatsNew/3_11_0/SPython/py1.pys b/InstallerSamples/WhatsNew/3_11_0/SPython/py1.pys new file mode 100644 index 000000000..a4f7e3a8b --- /dev/null +++ b/InstallerSamples/WhatsNew/3_11_0/SPython/py1.pys @@ -0,0 +1 @@ +print('Привет! Это SPython!') \ No newline at end of file diff --git a/InstallerSamples/WhatsNew/3_11_0/exit_param1.pas b/InstallerSamples/WhatsNew/3_11_0/exit_param1.pas index b80388847..c9a415ee0 100644 --- a/InstallerSamples/WhatsNew/3_11_0/exit_param1.pas +++ b/InstallerSamples/WhatsNew/3_11_0/exit_param1.pas @@ -1,4 +1,5 @@ -function fff: integer; +// 3.11 - exit(param) +function fff: integer; begin exit(3) end; diff --git a/InstallerSamples/WhatsNew/3_11_0/exit_param2.pas b/InstallerSamples/WhatsNew/3_11_0/exit_param2.pas index e6d8401d4..9634c2f7a 100644 --- a/InstallerSamples/WhatsNew/3_11_0/exit_param2.pas +++ b/InstallerSamples/WhatsNew/3_11_0/exit_param2.pas @@ -1,4 +1,5 @@ -function IsPrime(n: integer): boolean; +// 3.11 - exit(param) +function IsPrime(n: integer): boolean; begin if n < 2 then exit(False); for var i:=2 to n.Sqrt.Trunc do diff --git a/InstallerSamples/WhatsNew/3_11_0/exit_param3.pas b/InstallerSamples/WhatsNew/3_11_0/exit_param3.pas index 0829699b2..f0555ece8 100644 --- a/InstallerSamples/WhatsNew/3_11_0/exit_param3.pas +++ b/InstallerSamples/WhatsNew/3_11_0/exit_param3.pas @@ -1,4 +1,5 @@ -begin +// 3.11 - exit(param) +begin var IsPrime: integer → boolean := n → begin if n < 2 then exit(False); for var i:=2 to n.Sqrt.Trunc do diff --git a/InstallerSamples/WhatsNew/3_11_0/exit_param4.pas b/InstallerSamples/WhatsNew/3_11_0/exit_param4.pas index ba17ecf39..ad391a4ba 100644 --- a/InstallerSamples/WhatsNew/3_11_0/exit_param4.pas +++ b/InstallerSamples/WhatsNew/3_11_0/exit_param4.pas @@ -1,4 +1,5 @@ -function FastPower(a: real; n: integer): real; +// 3.11 - exit(param) +function FastPower(a: real; n: integer): real; begin if n = 0 then exit(1); // a^0 = 1 if n = 1 then exit(a); // a^1 = a