Skip to content

Commit 0b3b1b0

Browse files
committed
Remove CastleGenericLists mentions, they don't exist anymore in latest CGE
1 parent 61bbae3 commit 0b3b1b0

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

modern_pascal_introduction.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,12 +1879,10 @@ TFPGList:: A generic list of types.
18791879
TFPGObjectList:: A generic list of object instances. It can "own" children.
18801880
TFPGMap:: A generic dictionary.
18811881

1882-
//Use `TFPGList` for lists of primitives (or records or old-style objects), `TFPGObjectList` for a list of class instances. *In the Castle Game Engine:* You can also use `CastleGenericLists` with `TGenericStructList` for a list of records or old-style objects, this workarounds the problem of impossibility to override their operators in older FPC versions.
1882+
//Use `TFPGList` for lists of primitives (or records or old-style objects), `TFPGObjectList` for a list of class instances.
18831883

18841884
In `FGL` unit, the `TFPGList` can be only used for types for which the equality operator (=) is defined. For `TFPGMap` the _"greater than"_ (>) and _"less than"_ (<) operators must be defined for the key type. If you want to use these lists with types that don't have built-in comparison operators (e.g. with records), you have to overload their operators as shown in the <<Operator overloading>>.
18851885

1886-
*In the Castle Game Engine* we include a unit `CastleGenericLists` that adds `TGenericStructList` and `TGenericStructMap` classes. They are similar to `TFPGList` and `TFPGMap`, but they do not require a definition of the comparison operators for the appropriate type (instead, they compare memory contents, which is often appropriate for records or method pointers). But the `CastleGenericLists` unit is deprecated since the engine version 6.3, as we advise using `Generics.Collections` instead.
1887-
18881886
If you want to know more about the generics, see <<Generics>>.
18891887

18901888
### Cloning: TPersistent.Assign

modern_pascal_introduction_bg.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,12 +1670,10 @@ TFPGList:: Генеричен списък от елементи от указа
16701670
TFPGObjectList:: Генеричен списък от екземпляри от указан клас. Може да "притежава" екземплярите.
16711671
TFPGMap:: Генеричен речник{empty}footnote:dictionary[].
16721672

1673-
//Use `TFPGList` for lists of primitives (or records or old-style objects), `TFPGObjectList` for a list of class instances. *In the Castle Game Engine:* You can also use `CastleGenericLists` with `TGenericStructList` for a list of records or old-style objects, this workarounds the problem of impossibility to override their operators in older FPC versions.
1673+
//Use `TFPGList` for lists of primitives (or records or old-style objects), `TFPGObjectList` for a list of class instances.
16741674

16751675
В модул `FGL`, `TFPGList` може да се използва само с типове, които имат дефиниран оператор за равенство (=). При `TFPGMap` за типа на ключа трябват дефинирани оператори _"по-голямо"_ (>) и _"по-малко"_ (<). Ако искате да използвате тези контейнери с типове, които нямат дефинирани оператори за сравнение (например записи), ще трябва да им дефинирате съответните оператори както е показано в <<Замяна на оператори>>.
16761676

1677-
В *Castle Game Engine* сме включили модул `CastleGenericLists`, който добавя класовете `TGenericStructList` и `TGenericStructMap`. Те са подобни на `TFPGList` и `TFPGMap`, но не изискват дефиниране на оператори за сравнение за съответните типове (вместо това, те сравняват съдържанието на паметта, което е често подходящо за записи или указатели). Но от версия 6.3 модула `CastleGenericLists` е маркиран като отживял (_deprecated_) и препоръчваме използването на `Generics.Collections` вместо него.
1678-
16791677
Ако искате да научите повече за генериците, вижте <<Generics>>.
16801678

16811679
### Клониране: TPersistent.Assign

modern_pascal_introduction_russian.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ while not Text.Eof do
10521052
10531053
### Списки
10541054
1055-
Для создания различных списков переменной длинны, лично я советую использовать generic классы из unit-а `FGL`. Можно использовать `TFPGList` для простых типов данных (включая record-ы или устаревшие object-ы), и `TFPGObjectList` для списка экземпляров классов. В *Castle Game Engine:* можно также использовать `TGenericStructList` из `CastleGenericLists` для создания списков record-ов или устаревших object-ов. Это позволяет обойти проблему невозможности override их операторов в старых версиях FPC.
1055+
Для создания различных списков переменной длинны, лично я советую использовать generic классы из unit-а `FGL`. Можно использовать `TFPGList` для простых типов данных (включая record-ы или устаревшие object-ы), и `TFPGObjectList` для списка экземпляров классов.
10561056
10571057
Применение таких списков является хорошей идеей по нескольким причинам: они типо-безопасны и их API имеет много полезных функций, таких как поиск, сортировка, итерация и т.п. Вообще говоря, не стоит использовать _динамические массивы_ (`array of X`, `SetLength(X, ...)`) поскольку их API очень неудобный - можно применить лишь `SetLength`. Также не желательно использовать `TList` или `TObjectList` поскольку это потребует преобразование типа из общего `TObject` в конкретный тип класса при каждом обращении.
10581058

modern_pascal_introduction_ukrainian.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,12 +1665,10 @@ TFPGList:: A generic list of types.
16651665
TFPGObjectList:: A generic list of object instances. It can "own" children.
16661666
TFPGMap:: A generic dictionary.
16671667

1668-
//Use `TFPGList` for lists of primitives (or records or old-style objects), `TFPGObjectList` for a list of class instances. *In the Castle Game Engine:* You can also use `CastleGenericLists` with `TGenericStructList` for a list of records or old-style objects, this workarounds the problem of impossibility to override their operators in older FPC versions.
1668+
//Use `TFPGList` for lists of primitives (or records or old-style objects), `TFPGObjectList` for a list of class instances.
16691669

16701670
In `FGL` unit, the `TFPGList` can be only used for types for which the equality operator (=) is defined. For `TFPGMap` the _"greater than"_ (>) and _"less than"_ (<) operators must be defined for the key type. If you want to use these lists with types that don't have built-in comparison operators (e.g. with records), you have to overload their operators as shown in the <<Operator overloading>>.
16711671

1672-
*In the Castle Game Engine* we include a unit `CastleGenericLists` that adds `TGenericStructList` and `TGenericStructMap` classes. They are similar to `TFPGList` and `TFPGMap`, but they do not require a definition of the comparison operators for the appropriate type (instead, they compare memory contents, which is often appropriate for records or method pointers). But the `CastleGenericLists` unit is deprecated since the engine version 6.3, as we advise using `Generics.Collections` instead.
1673-
16741672
If you want to know more about the generics, see <<Generics>>.
16751673

16761674
### Cloning: TPersistent.Assign

0 commit comments

Comments
 (0)