diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index ae8365fee..46f31746e 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "8"; public const string Build = "3"; - public const string Revision = "3104"; + public const string Revision = "3105"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index d30613a18..cf50ebb58 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=3 -%REVISION%=3104 %MINOR%=8 +%REVISION%=3105 +%COREVERSION%=3 %MAJOR%=3 diff --git a/InstallerSamples/StandardUnits/PABCSystem/Serialization/SerializationGraph.pas b/InstallerSamples/StandardUnits/PABCSystem/Serialization/SerializationGraph.pas index 8ac010c36..a4c7782a5 100644 --- a/InstallerSamples/StandardUnits/PABCSystem/Serialization/SerializationGraph.pas +++ b/InstallerSamples/StandardUnits/PABCSystem/Serialization/SerializationGraph.pas @@ -12,7 +12,7 @@ type const fname = 'a.dat'; begin - var m := new Node(5,new Node(3,new Node(4,nil))); + var m := new Node(5,new Node(3,new Node(4,nil))); // Связный список Serialize(fname,m); // Сериализуем объект в файл var m1 := Deserialize(fname) as Node; // Десериализуем из файла Print(m1); diff --git a/InstallerSamples/StandardUnits/Timers/Timer1.pas b/InstallerSamples/StandardUnits/Timers/Timer1.pas index fadc43320..bcaf34290 100644 --- a/InstallerSamples/StandardUnits/Timers/Timer1.pas +++ b/InstallerSamples/StandardUnits/Timers/Timer1.pas @@ -1,20 +1,12 @@ -Uses Timers; +uses Timers; -var t1, t2: Timer; +procedure OnTimer1 := Write('!'); -procedure OnTimer1; -begin - Write('!'); -end; - -procedure OnTimer2; -begin - Write('?'); -end; +procedure OnTimer2 := Write('?'); begin - t1 := new Timer(200, OnTimer1); - t2 := new Timer(300, OnTimer2); + var t1 := new Timer(200, OnTimer1); + var t2 := new Timer(300, OnTimer2); t1.Start; t2.Start; Sleep(10000); diff --git a/InstallerSamples/StandardUnits/Timers/Timer2.pas b/InstallerSamples/StandardUnits/Timers/Timer2.pas index 073c3a6b9..0a85ccc2d 100644 --- a/InstallerSamples/StandardUnits/Timers/Timer2.pas +++ b/InstallerSamples/StandardUnits/Timers/Timer2.pas @@ -1,59 +1,37 @@ -// "Собачка". Иллюстрация использования таймера. -uses GraphABC, Timers; +// "Собачка". Иллюстрация использования таймера. +uses GraphWPF, Timers; var - t: Timer; - xx,yy,px,py: integer; + xx,yy,px,py: real; procedure Draw; begin FillCircle(xx,yy,11); end; -procedure Show; -begin - Brush.Color := clBlack; - Draw; -end; - -procedure Hide; -begin - Brush.Color := clWhite; - Draw; -end; - -procedure Move(x,y: integer); -begin - Hide; - xx := x; - yy := y; - show; -end; - -procedure Timer1; +procedure TimerProc; begin if (xx<>px) or (yy<>py) then begin var t := 1/10; var newx := round((1-t)*xx+t*px); var newy := round((1-t)*yy+t*py); - Move(newx,newy); + (xx,yy) := (newx,newy); end; end; -procedure MouseMove(x,y,mb: integer); begin - px := x; py := y; -end; + Window.Title := '"Собачка"'; + Brush.Color := Colors.Black; -begin - SetWindowCaption('"Собачка"'); - SetSmoothingOff; - OnMouseMove:=MouseMove; xx := 100; yy := 100; - px := xx; py := yy; - Show; - Timer1; - t := new Timer(20,Timer1); + + OnMouseMove := procedure(x,y,mb) -> (px,py) := (x,y); + + OnDrawFrame := dt -> begin + FillCircle(xx,yy,11); + end; + + var t := new Timer(20,TimerProc); t.Start; end. diff --git a/InstallerSamples/StandardUnits/Turtle/Turtle1.pas b/InstallerSamples/StandardUnits/Turtle/Turtle1.pas index 2d40e8812..242078259 100644 --- a/InstallerSamples/StandardUnits/Turtle/Turtle1.pas +++ b/InstallerSamples/StandardUnits/Turtle/Turtle1.pas @@ -43,7 +43,7 @@ begin end; begin - Init4; + Init1; ToPoint(x0,y0); SetWidth(0.5); //SetColor(Colors.Red); diff --git a/InstallerSamples/WhatsNew/3_7_2/AllDelimiters.pas b/InstallerSamples/WhatsNew/3_7_2/AllDelimiters.pas new file mode 100644 index 000000000..de7afaaf3 --- /dev/null +++ b/InstallerSamples/WhatsNew/3_7_2/AllDelimiters.pas @@ -0,0 +1,7 @@ +// Разделитель AllDelimiters содержит все основные символы, +// которые могут служить разделителями между словами +begin + var s := '123@!45 @#$678\/|?90~;'; + s.ToWords(AllDelimiters).Println; +end. + diff --git a/InstallerSamples/WhatsNew/3_7_2/BigIntSumProd.pas b/InstallerSamples/WhatsNew/3_7_2/BigIntSumProd.pas new file mode 100644 index 000000000..7d7cd928b --- /dev/null +++ b/InstallerSamples/WhatsNew/3_7_2/BigIntSumProd.pas @@ -0,0 +1,5 @@ +// Методы .Sum, .Average и .Product для последовательности BigInteger +begin + var s := SeqGen(10,i->BigInteger(i)**i); + Print(s.Sum,s.Product,s.Average); +end. diff --git a/InstallerSamples/WhatsNew/3_7_2/CountOf.pas b/InstallerSamples/WhatsNew/3_7_2/CountOf.pas new file mode 100644 index 000000000..800718aea --- /dev/null +++ b/InstallerSamples/WhatsNew/3_7_2/CountOf.pas @@ -0,0 +1,5 @@ +// Стандартный метод последовательности CountOf +begin + var a := Arr(1,3,5,7,1,2,1,3,1,5); + a.CountOf(1).Print; +end. diff --git a/InstallerSamples/WhatsNew/3_7_2/IsIntegerReal.pas b/InstallerSamples/WhatsNew/3_7_2/IsIntegerReal.pas new file mode 100644 index 000000000..3b65a6939 --- /dev/null +++ b/InstallerSamples/WhatsNew/3_7_2/IsIntegerReal.pas @@ -0,0 +1,12 @@ +// Методы строк .IsInteger и .IsReal +begin + var s := '123.4 3 5 6.6 a v 67'; + var (si,sr) := (0,0.0); + foreach var w in s.ToWords do + if w.IsInteger then + si += w.ToInteger + else if w.IsReal then + sr += w.Toreal; + Print(si,sr); +end. + diff --git a/InstallerSamples/WhatsNew/3_7_2/PermCombCart.pas b/InstallerSamples/WhatsNew/3_7_2/PermCombCart.pas new file mode 100644 index 000000000..9af09367d --- /dev/null +++ b/InstallerSamples/WhatsNew/3_7_2/PermCombCart.pas @@ -0,0 +1,14 @@ +// Все виды использования Permutations, Combinations, Cartesian +## +var a := Arr(1,3,5,7); +a.Permutations.Println; +a.Cartesian(2).Println; +a.Permutations(2).Println; +a.Combinations(2).Println; +Println; +var s := Seq(1,3,5,7); +s.Permutations.Println; +s.Cartesian(2).Println; +s.Permutations(2).Println; +s.Combinations(2).Println; + diff --git a/InstallerSamples/WhatsNew/3_7_2/ToWordsStrDelim.pas b/InstallerSamples/WhatsNew/3_7_2/ToWordsStrDelim.pas new file mode 100644 index 000000000..b716dd6aa --- /dev/null +++ b/InstallerSamples/WhatsNew/3_7_2/ToWordsStrDelim.pas @@ -0,0 +1,6 @@ +// Метод строк .ToWords со строкой, содержащей разделители +begin + var s := '123.4, 6.6; 67'; + s.ToWords(' ,;').PrintLines +end. + diff --git a/InstallerSamples/WhatsNew/3_7_2/bi.pas b/InstallerSamples/WhatsNew/3_7_2/bi.pas new file mode 100644 index 000000000..21aa5b3b8 --- /dev/null +++ b/InstallerSamples/WhatsNew/3_7_2/bi.pas @@ -0,0 +1,9 @@ +// Литералы BigInteger +begin + Println(25bi ** 25 + 17bi ** 17); + + var p := 1bi; + for var i:=2 to 50 do + p *= i; + Println($'50! = {p}'); +end. diff --git a/InstallerSamples/WhatsNew/3_7_2/ext_foreach.pas b/InstallerSamples/WhatsNew/3_7_2/ext_foreach.pas new file mode 100644 index 000000000..52045104a --- /dev/null +++ b/InstallerSamples/WhatsNew/3_7_2/ext_foreach.pas @@ -0,0 +1,10 @@ +// Расширенный foreach с распаковкой значений в переменные +begin + var a := Arr((1,2),(3,4),(5,6)); + foreach var (x,y) in a do // Распаковка кортежей + Print(x,y); + Println; + var b := Arr(|1,2,3|,|4,5|,|6,7,8,9|); + foreach var (x,y) in b do // Распаковка последовательностей + Print(x,y); +end. diff --git a/InstallerSamples/WhatsNew/3_7_2/usesInShortPrograms.pas b/InstallerSamples/WhatsNew/3_7_2/usesInShortPrograms.pas new file mode 100644 index 000000000..524d07ac4 --- /dev/null +++ b/InstallerSamples/WhatsNew/3_7_2/usesInShortPrograms.pas @@ -0,0 +1,4 @@ +// В коротких подпрограммах можно использовать подключение модулей +## +uses Graph3D; +Sphere(Origin,1); diff --git a/InstallerSamples/WhatsNew/3_8_0/MultidimensionalSlices.pas b/InstallerSamples/WhatsNew/3_8_0/MultidimensionalSlices.pas new file mode 100644 index 000000000..066822e93 --- /dev/null +++ b/InstallerSamples/WhatsNew/3_8_0/MultidimensionalSlices.pas @@ -0,0 +1,14 @@ +// Срезы многомерных массивов +begin + var m := MatrByRow(||1,2,3,4|,|5,6,7,8|,|9,10,11,12||); + Println(m[:,:]); // [[1,2,3,4],[5,6,7,8],[9,10,11,12]] + Println(m[::1,::1]); // [[1,2,3,4],[5,6,7,8],[9,10,11,12]] + Println(m[1:3,1:4]); // [[6,7,8],[10,11,12]] + Println(m[::2,::3]); // [[1,4],[9,12]] + Println(m[::-2,::-1]); // [[12,11,10,9],[4,3,2,1]] + Println(m[^2::-1,^2::-1]); // [[7,6,5],[3,2,1]] + Println(m[:^1,:^1]); // [[1,2,3],[5,6,7]] + Println(m[1,:]); // Одномерный массив [5,6,7,8] + Println(m[^1,:]); // Одномерный массив [9,10,11,12] + Println(m[:,^1]); // Одномерный массив [4,8,12] +end. \ No newline at end of file diff --git a/InstallerSamples/WhatsNew/3_8_0/UnpackLambdaParams.pas b/InstallerSamples/WhatsNew/3_8_0/UnpackLambdaParams.pas new file mode 100644 index 000000000..c73061bf0 --- /dev/null +++ b/InstallerSamples/WhatsNew/3_8_0/UnpackLambdaParams.pas @@ -0,0 +1,9 @@ +// Распаковка составного параметра лямбда-выражения в переменные +begin + var s := Seq(('Умнова',16),('Иванов',23), + ('Попова',17),('Козлов',24)); + Println('Совершеннолетние:'); + s.Where(\(name,age) -> age >= 18).Println; + Println('Сортировка по фамилии:'); + s.OrderBy(\(name,age) -> name).Println; +end. diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 38ae34dbe..a7f759924 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.3.3104 +3.8.3.3105 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index bae161b96..a951c92d4 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.3.3104' +!define VERSION '3.8.3.3105'