diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 6a54a5a38..bc130c482 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 = "1"; public const string Build = "0"; - public const string Revision = "1288"; + public const string Revision = "1290"; 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 0f3b455cc..6a385c820 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=1 -%REVISION%=1288 +%REVISION%=1290 %COREVERSION%=0 %MAJOR%=3 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 7e13880ed..c257f138e 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.1.0.1288' +!define VERSION '3.1.0.1290' diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index a5391d3c9..b6d93826b 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -8345,6 +8345,121 @@ begin Result := Self.Skip(from).Where((x,i)->i mod step = 0).Take(count) end; +// Дополнения июль 2016: Incremental +///-- +{function IncrementalSeq(Self: sequence of integer): sequence of integer; +begin + var iter := Self.GetEnumerator(); + if iter.MoveNext() then + begin + var prevItem := iter.Current; + while iter.MoveNext() do + begin + var nextItem := iter.Current; + yield nextItem - prevItem; + prevItem := nextItem; + end + end +end; + +///-- +function IncrementalSeq(Self: sequence of real): sequence of real; +begin + var iter := Self.GetEnumerator(); + if iter.MoveNext() then + begin + var prevItem := iter.Current; + while iter.MoveNext() do + begin + var nextItem := iter.Current; + yield nextItem - prevItem; + prevItem := nextItem; + end + end +end; + +/// Возвращает последовательность разностей соседних элементов исходной последовательности +function Incremental(Self: sequence of integer): sequence of integer; extensionmethod; +begin + Result := IncrementalSeq(Self); +end; + +/// Возвращает последовательность разностей соседних элементов исходной последовательности +function Incremental(Self: array of integer): sequence of integer; extensionmethod; +begin + Result := IncrementalSeq(Self); +end; + +/// Возвращает последовательность разностей соседних элементов исходной последовательности +function Incremental(Self: List): sequence of integer; extensionmethod; +begin + Result := IncrementalSeq(Self); +end; + +/// Возвращает последовательность разностей соседних элементов исходной последовательности +function Incremental(Self: LinkedList): sequence of integer; extensionmethod; +begin + Result := IncrementalSeq(Self); +end; + +/// Возвращает последовательность разностей соседних элементов исходной последовательности +function Incremental(Self: sequence of real): sequence of real; extensionmethod; +begin + Result := IncrementalSeq(Self); +end; + +/// Возвращает последовательность разностей соседних элементов исходной последовательности +function Incremental(Self: array of real): sequence of real; extensionmethod; +begin + Result := IncrementalSeq(Self); +end; + +/// Возвращает последовательность разностей соседних элементов исходной последовательности +function Incremental(Self: List): sequence of real; extensionmethod; +begin + Result := IncrementalSeq(Self); +end; + +/// Возвращает последовательность разностей соседних элементов исходной последовательности +function Incremental(Self: LinkedList): sequence of real; extensionmethod; +begin + Result := IncrementalSeq(Self); +end;} + +/// Возвращает последовательность разностей соседних элементов исходной последовательности. В качестве функции разности используется func +function Incremental(Self: sequence of T; func: (T,T)->T1): sequence of T1; extensionmethod; +begin + var iter := Self.GetEnumerator(); + if iter.MoveNext() then + begin + var prevItem := iter.Current; + while iter.MoveNext() do + begin + var nextItem := iter.Current; + yield func(prevItem,nextItem); + prevItem := nextItem; + end + end +end; + +/// Возвращает последовательность разностей соседних элементов исходной последовательности. В качестве функции разности используется func +function Incremental(Self: sequence of T; func: (T,T,integer)->T1): sequence of T1; extensionmethod; +begin + var iter := Self.GetEnumerator(); + if iter.MoveNext() then + begin + var ind := 0; + var prevItem := iter.Current; + while iter.MoveNext() do + begin + var nextItem := iter.Current; + ind += 1; + yield func(prevItem,nextItem,ind); + prevItem := nextItem; + end + end +end; + // ----------------------------------------------------- //>> Методы расширения типа List # Extension methods for List T // ----------------------------------------------------- diff --git a/bin/Lib/PABCRtl.dll b/bin/Lib/PABCRtl.dll index 4f095a4f8..75d4f5201 100644 Binary files a/bin/Lib/PABCRtl.dll and b/bin/Lib/PABCRtl.dll differ diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index 0b2ffc6ff..b6d93826b 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -8347,7 +8347,7 @@ end; // Дополнения июль 2016: Incremental ///-- -function IncrementalSeq(Self: sequence of integer): sequence of integer; +{function IncrementalSeq(Self: sequence of integer): sequence of integer; begin var iter := Self.GetEnumerator(); if iter.MoveNext() then @@ -8424,7 +8424,7 @@ end; function Incremental(Self: LinkedList): sequence of real; extensionmethod; begin Result := IncrementalSeq(Self); -end; +end;} /// Возвращает последовательность разностей соседних элементов исходной последовательности. В качестве функции разности используется func function Incremental(Self: sequence of T; func: (T,T)->T1): sequence of T1; extensionmethod;