Delphi 语言特性和引入/弃用的版本列表 [英] List of Delphi language features and version in which they were introduced/deprecated
问题描述
在开始之前,我想指出,我已经诚实而真诚地通过 Google 反复、详尽地搜索了这样的东西,但一直找不到.
我需要(对于我正在开发的项目)所有 Delphi(2007 到最新发布的版本,我不再支持任何早于 2007 的版本)语言功能"的列表,以及它们所在的版本引入并(如适用)弃用、改进或移除.
我之前在 Stack Overflow 上也注意到过与此类似的问题,尽管其中大部分都以哪个功能最好"的形式表达,并认为不合适就关闭了.
如果有人知道这样的列表(或有足够的空闲时间来编译),我将不胜感激.
接受的答案将包含指向此类列表的链接或列表本身.
请注意,此答案仅列出了新的语言功能
不是新的 VCL/FMX 功能.
这里是 RAD Studio docwiki 的链接:
- Rad Studio 10.4 悉尼的新变化
- Rad Studio 10.3 Rio 的新功能
- Delphi 和 C++Builder 10.2 Tokyo 的新功能
- Delphi 和 C++Builder 10.1 Berlin 的新增功能
- Delphi 和 C++Builder 10 Seattle 的新增功能
- Delphi 和 C++Builder XE8 的新增功能一个>
- Delphi 和 C++Builder XE7 的新增功能一个>
- Delphi 和 C++Builder XE6 的新增功能一个>
- Delphi 和 C++Builder XE5 的新增功能一个>
- Delphi 和 C++Builder XE4 的新增功能
- Delphi 和 C++Builder XE3 的新增功能
- Delphi 和 C++Builder XE2 的新增功能
- Delphi 和 C++Builder XE 的新增功能
- Delphi 和 C++Builder 2010 的新增功能一个>
- Delphi 和 C++Builder 2009 的新增功能
- RAD Studio 的新增功能(Delphi for Win32 2007)一个>
- RAD Studio (C++Builder) 的新功能2007)
- Delphi 2006 的新增功能
- Delphi 2005 的新增功能
- Delphi 7 的新增功能
- Delphi 6 的新增功能
- Delphi 5 的新增功能
- 新功能德尔福 4
- Delphi 3 的新增功能
- Delphi 2 的新增功能
- Delphi 1 功能
来自 Embarcadero 的完整列表:最新消息
另请参阅:David I 的名单
总结:
- 在所有平台上统一内存管理 - 完整的 ARC 编译器已被删除,所有编译器现在都对对象使用手动(经典)内存管理
- 自定义管理记录
- 支持 macOS 64 位
- 支持 Android 64 位
- 64 位 Linux 编译器没有不再使用 ARC,而是使用默认的手动管理,这与 Windows 编译器中的相同.这使得将代码从 Windows 或 OSX 移植到 Linux 变得更加容易.
- 内联变量自动类型推断
- 在 Linux 上启用 8 位 AnsiChar/AnsiString 支持.
- C++Builder 和 Delphi 现在对所有调用使用相同的 ABI.
- 支持 Linux 服务器应用(使用 LLVM 和 ARC 的 Intel 64 位).
- 使用
@
运算符将动态数组分配给指针仅在对数组进行硬转换时才允许. - 更灵活的单元名称命名空间解析
- 对 Utf8String 和 RawByteString 在所有平台上输入
[弱]
、所有编译器都支持 [unsafe]
和[volatile]
属性.- OSX 上的扩展大小现在是 16 字节.
- 类和记录助手无法访问的私有成员它们扩展的类或记录.
- 支持高达 6.01 的 Android.
- 支持 Android 5.1.1 和 iOS 8.4
- 改进了 OSX 异常处理
- 支持 64 位 iOS;
- 新的整数类型:FixedInt、FixedUInt 所有平台上的 32 位整数类型;
- 新的平台相关整数类型:LongInt、LongWord(iOS-64 上为 64 位,所有其他平台上为 32 位);
function IsManagedType(T: TypeIdentifier): Boolean;函数 HasWeakRef(T: TypeIdentifier): Boolean;函数 GetTypeKind(T: TypeIdentifier): TTypeKind;函数 IsConstValue(Value): boolean;
- 安卓支持;
需要具有 ArmV6 + Neon 或 ArmV7 的设备进行部署
引入条件定义ANDROID - 类的运算符重载(但仅适用于 NextGen 编译器 {Android/iOS})一个>
XE4 中引入/启用了以下新条件:
自动引用计数
CPUARM
EXTERNAL_LINKER
IOS
下一代
UNDERSCOREIMPORTNAME
弱参考
弱点
弱参考重新引入了对 iOS 的支持.
新的
dependency
指令 用于指定外部库的依赖项(在 XE8 之前未记录).ARC 支持在 NextGen 编译器中(包括 TObject.DisposeOf).
请注意,ARC 的大部分基础工作已经在 XE3 中,但其中大部分已被禁用在 XE4 发布之前,
$IF
语句只能以$IFEND
和$IFDEF
、$IFDEF
、$ 结束IFOPT
指令只能用$ENDIF
终止.
在 XE4 中,情况发生了变化,因此 $ENDIF 成为了 $IF、$IFDEF、$IFNDEF 和 $IFOPT 的公认终结符.
- 记录内置类型的助手
- 取消了对 iOS 的支持.
- 原子内在函数:
AtomicExchange()
,AtomicIncrement()
,AtomicCmpExchange()
,AtomicDecrement()
- [ref] 属性的介绍.
跨平台支持 Mac OSX(32 位)和 iOS;
支持Win64;
修改了 RTL 以支持跨平台;
打包
现在强制记录的字节对齐(在 XE2 之前它不一定这样做)添加了八个新的 DEFINE:
ALIGN_STACK
CPUX86
CPUX64
MACOS(Mac 操作系统)
MACOS32
PC_MAPPED_EXCEPTIONS
图片
WIN64{$ExcessPrecision on/off}
编译器指令(仅限 x64)内置类型因目标平台(32/64 位)而异
- 扩展数据类型在 Win32 上为 10 个字节,但在 Win64 上为 8 (!) 个字节
{$STRINGCHECKS}
编译器指令在 XE 中被忽略;{$ALIGN}
指令的新 16 字节值:{$ALIGN}
指令的可接受值现在包括 1、2、4、8 和 16.- new
{$CODEALIGN}
指令,它设置过程或函数的起始地址. {$STRONGLINKTYPES ON}
指令- 支持正则表达式.
- 增强的 Delphi RTTI(运行时类型信息).
- 属性一个>
as
运算符可用于将接口引用转换回从中提取它的对象.is
运算符可用于验证接口引用是否是从某个类中提取的.- 可以在接口上执行正常的不安全转换:
TObject(SomeInterface)
. - new
delayed
指令指示外部库(例如 DLL)不会在声明时加载,而是要等到第一次调用该方法时才加载 - 类构造函数/析构函数
- 内部类型
string
现在映射到UnicodeString
; {$HighCharUnicode on|off}
编译器指令- 泛型;
function Default(T): T
内在函数(未记录)- 智能指针;
- 匿名方法;
- 支持嵌套异常和异常跟踪;
- 支持pointermath 和一个新的编译器指令:
{$PointerMath on|off}
; - 四个新的编译器警告:
W1057 从%s"到%s"的隐式字符串转换
,W1058 从%s"到%s"的潜在数据丢失的隐式字符串转换
,W1059 从%s"到%s"的显式字符串转换
,W1060 从%s"到%s"的潜在数据丢失的显式字符串转换
;
Exit
函数可以接受一个指定结果的参数;resourcestrings
作为 Widestrings;TObject
有一个 额外的隐藏指针TMonitor
以及它的 VMT 指针;deprecated
关键字现在可以包含附加文本
- 据我所知没有语言变化;
请注意,Delphi 2007 是一个不间断版本,D2006 中的 DCU 将在 D2007 中保持不变; - (2007 年的 .NET个性"引入泛型)
- 增强记录;
- 运算符重载;
static
方法和属性;- 班级助手;
- FastMM 是默认的内存管理器;
strict
私有/protected 可见性关键字;final
虚拟方法的关键字;{$METHODINFO}
指令;
for ... in
循环,inline
关键字- 允许使用声明中的通配符
- 嵌套类型
- 嵌套常量
{$REGION}
/{$ENDREGION}
指令
- 三个额外的编译器警告:
- Unsafe_Type,
- Unsafe_Code 和
- Unsafe_Cast.这些警告默认是禁用的,但可以启用
- 新编译器指令
{$WARN UNSAFE_CODE ON}
- 使用
TFormatSettings
结构格式化和解析数字、日期时间值和货币的例程的重载.
[TCustomVariantType][68]
提供 运算符重载自定义变体类型- 新的编译器指令:
{$IFDEF MSWINDOWS}
{$IFDEF LINUX}
- {{{1}}}>{{{}}代码>
{$MESSAGE 'message'}
{$SetPEFlags}
- 支持
{$IF}{$ELSE}
编译器指令 - 编译器提示指令:
实验性
、deprecated
、library
、platform
(但不推荐使用的附加文字) - Variant 不再基于 COM,而是改为与 CLX 兼容,基于 COM 的变体更名为
OLEVariant
- 类型常量不能分配给(用
{$J+}
覆盖) - 可以为枚举类型分配显式值(参见 C++);
- 接口属性
- 支持调用
varargs
外部函数(但仅适用于cdecl
调用约定) - 自定义变体
没有新的语言功能,但是:
- 动态数组
LongWord
和Int64
;Cardinal
是一个 UINT32 (在它是无符号的 31 位值之前)Real
占用 8 个字节,与double
相同(以前是 6 个字节);- 使用新的
{$REALCOMPATIBILITY ON}
编译器指令覆盖; REAL48
替换旧的 6 字节real
;
- 使用新的
- 支持
资源字符串
- 方法重载
- 默认参数
{$EXTERNALSYM}
和{$NODEFINE}
指令implements
属性的关键字莉>
- Wordbool、longbool 和 bytebool 将
true
存储为-1
而不是 1(布尔值不变) - 必须使用
packages
安装组件. - 断言.
out
参数.宽字符串
interface
和dispinterface
关键字和 COM (dispid
) 支持.
- 支持 32 位;
Ansistring
替换shortstring
作为默认字符串类型货币
Variant
(用于与 OLE 互操作自动化).- 线程支持和
ThreadVar
关键字. - 4 字节数据是 4 字节对齐的新
packed
关键字覆盖此行为; - TDateTime 开始于
1899/12/30
在 D1 下它开始于0000/00/00
- new
finalization
关键字 添加了 register
和stdcall
调用约定.packed
关键字.
Before I begin, I would like to point out that I have honestly and genuinely searched repeatedly and exhaustively via Google for such a thing, and been unable to find one.
I require (for a project I'm developing) a list of all Delphi (2007 to the very latest released version, I no longer support any version older than 2007) "Language Features", and the versions in which they were introduced and (where applicable) deprecated, improved or removed.
I have noted similar questions to this on Stack Overflow before, though most of those were phrased in the form of "which feature is best", and closed as deemed unsuitable.
If anyone knows of such a list (or has enough spare time to compile one), I would be very grateful.
The accepted answer will either contain a link to such a list, or the list itself.
Note that this answer only lists new language features
not new VCL/FMX features.
Here are the links to the RAD Studio docwiki:
- What's new in Rad Studio 10.4 Sydney
- What's new in Rad Studio 10.3 Rio
- What's new in Delphi and C++Builder 10.2 Tokyo
- What's new in Delphi and C++Builder 10.1 Berlin
- What's new in Delphi and C++Builder 10 Seattle
- What's new in Delphi and C++Builder XE8
- What's New in Delphi and C++Builder XE7
- What's New in Delphi and C++Builder XE6
- What's New in Delphi and C++Builder XE5
- What's New in Delphi and C++Builder XE4
- What's New in Delphi and C++Builder XE3
- What's New in Delphi and C++Builder XE2
- What's New in Delphi and C++Builder XE
- What's New in Delphi and C++Builder 2010
- What's New in Delphi and C++Builder 2009
- What's New in RAD Studio (Delphi for Win32 2007)
- What's New in RAD Studio (C++Builder 2007)
- What’s New in Delphi 2006
- What’s New in Delphi 2005
- What’s New in Delphi 7
- What’s New in Delphi 6
- What’s New in Delphi 5
- What's New in Delphi 4
- What's New in Delphi 3
- What's New in Delphi 2
- Delphi 1 Features
The full list from Embarcadero: What's New
See also: David I's list
To summarize:
- Unified memory management on all platforms - full ARC compiler has been removed and all compilers now use manual (classic) memory management for objects
- Custom managed records
- Support for macOS 64-bit
- Support for Android 64-bit
- The 64-bit Linux compiler no longer uses ARC, it instead uses the default manual managed, which is the same as in the Windows compiler. This makes porting code from Windows or OSX to Linux much easier.
- Inline variables with automatic type inference
- 8 bit AnsiChar/AnsiString support in enabled on Linux.
- C++Builder and Delphi now use the same ABI for all calls.
- Support for Linux server apps (Intel 64-bit using LLVM and ARC).
- Assigning a dynamic arrays to a pointer using the
@
operator is only allowed when hard-casting the array. - More flexible namespace resolution of unit names
- Native support for Utf8String and RawByteString type on all platforms
- The
[weak]
,[unsafe]
and[volatile]
attributes are supported on all compilers. - The size of extended on OSX is now 16 bytes.
- class and record helpers cannot access private members of the classes or records they extend.
- Support for Android up to 6.01.
- Support for Android 5.1.1 and iOS 8.4
- Improved OSX exception handling
- Support for 64-bit iOS;
- New integer types: FixedInt, FixedUInt 32-bit integer types on all platforms;
- New platform dependent integer types: LongInt, LongWord (64-bits on iOS-64, 32-bits on all other platforms);
New compiler intrinsic routines (undocumented):
function IsManagedType(T: TypeIdentifier): Boolean; function HasWeakRef(T: TypeIdentifier): Boolean; function GetTypeKind(T: TypeIdentifier): TTypeKind; function IsConstValue(Value): boolean;
- Android Support;
needs device with ArmV6 + Neon or ArmV7 for deployment
introduces conditional define ANDROID - Operator overloading for classes (but only for the NextGen compiler {Android/iOS})
The following new conditionals are introduced/enabled in XE4:
AUTOREFCOUNT
CPUARM
EXTERNAL_LINKER
IOS
NEXTGEN
UNDERSCOREIMPORTNAME
WEAKREF
WEAKINSTREF
WEAKINTREFReintroduced support for iOS.
New
dependency
directive for specifying the dependencies of an external library (undocumented until XE8).ARC support in NextGen compilers (including TObject.DisposeOf).
Note that much of the groundwork for ARC was already in XE3, but much of it was disabledBefore the XE4 release,
$IF
statements could only be terminated with$IFEND
, and the$IFDEF
,$IFNDEF
,$IFOPT
directives could only be terminated with$ENDIF
.
At XE4, this changed so that $ENDIF became an accepted terminator for $IF, $IFDEF, $IFNDEF, and $IFOPT.
- Record helpers for built-in types
- Removed support for iOS.
- Atomic intrinsic functions:
AtomicExchange()
,AtomicIncrement()
,AtomicCmpExchange()
,AtomicDecrement()
- Introduction of the [ref] attribute.
Cross platform support for Mac OSX (32-bit) and iOS;
Support for Win64;
Modified RTL to support cross platform;
Packed
Now Forces Byte Alignment of Records (Pre XE2 it did not necessarily do this)Eight new DEFINEs have been added:
ALIGN_STACK
CPUX86
CPUX64
MACOS (Mac operating system)
MACOS32
PC_MAPPED_EXCEPTIONS
PIC
WIN64{$ExcessPrecision on/off}
compiler directive (x64 only)The build-in types differ depending on the target platform (32/64-bit)
- Extended Data Type Is 10 bytes on Win32, but 8 (!) bytes on Win64
- The
{$STRINGCHECKS}
compiler directive is ignored in XE; - New 16-byte value for the
{$ALIGN}
directive: The acceptable values for the{$ALIGN}
directive now include 1, 2, 4, 8, and 16. - new
{$CODEALIGN}
directive, this sets the starting address for a procedure or function. - The
{$STRONGLINKTYPES ON}
directive - Support for regular expressions.
- Enhanced Delphi RTTI (Run Time Type Information).
- Attributes
- The
as
operator can be used to cast an interface reference back to the object from which it was extracted. - The
is
operator can be used to verify whether an interface reference was extracted from a certain class. - Normal unsafe casting can be performed on an interface:
TObject(SomeInterface)
. - new
delayed
directive indicates that an external library such as a DLL is not to be loaded at declaration time but is to wait until the first call to the method - Class Constructor/Destructor
- Intrinsic type
string
now maps toUnicodeString
; {$HighCharUnicode on|off}
compiler directive- Generics;
function Default(T): T
intrinsic function (Undocumented)- Smart pointers;
- Anonymous methods;
- Support for nested exceptions and exception tracing;
- support for pointermath and a new compiler directive:
{$PointerMath on|off}
; - Four new compiler warnings:
W1057 Implicit string cast from '%s' to '%s'
,W1058 Implicit string cast with potential data loss from '%s' to '%s'
,W1059 Explicit string cast from '%s' to '%s'
,W1060 Explicit string cast with potential data loss from '%s' to '%s'
;
- The
Exit
function can take a parameter specifying a result; resourcestrings
as Widestrings;TObject
has a extra hidden pointer toTMonitor
in addition to its VMT pointer;- the
deprecated
keyword can now have additional text
- No language changes that I know of;
Note that Delphi 2007 is a non-breaking release, DCU's from D2006 will work unchanged in D2007; - (The .NET 'personality' of 2007 introduced generics)
- Enhanced records;
- operator overloading;
static
methods and properties;- class helpers;
- FastMM is the default memory manager;
strict
private/protected visibility keyword;final
keyword for virtual methods;{$METHODINFO}
directive;
for ... in
loops,inline
keyword- Wildcard in uses statement allowed
- nested types
- nested constants
{$REGION}
/{$ENDREGION}
directives
- three additional compiler warnings:
- Unsafe_Type,
- Unsafe_Code, and
- Unsafe_Cast. These warnings are disabled by default, but can be enabled
- new compiler directive
{$WARN UNSAFE_CODE ON}
- Overloads of routines that format and parse numbers, date-time values, and currency using a
TFormatSettings
structure.
[TCustomVariantType][68]
provides operator overloading for custom variant types- New compiler directives:
{$IFDEF MSWINDOWS}
{$IFDEF LINUX}
{$LIBPREFIX}
{$LIBSUFFIX}
{$LIBVERSION}
{$MESSAGE 'message'}
{$SetPEFlags}
- Support for
{$IF}{$ELSE}
compiler directives - Compiler hinting directives:
experimental
,deprecated
,library
,platform
(but without additional text for deprecated) - Variant is no longer based on COM but changed to be CLX compatible, COM based variant renamed to
OLEVariant
- Typed constants cannot be assigned to (Override with
{$J+}
) - Enumerated types can be assigned an explicit value (cf C++);
- Interface properties
- Support for calling
varargs
external functions (but only for thecdecl
calling convention) - custom variants
No new language features, but:
- Dynamic arrays
LongWord
andInt64
;Cardinal
is an UINT32 (before it was unsigned 31-bit value)Real
takes 8 bytes and is the same asdouble
(previously it was 6 bytes);- Override with the new
{$REALCOMPATIBILITY ON}
compiler directive; REAL48
replaces the old 6-bytereal
;
- Override with the new
- Support for
resourcestrings
- Method overloading
- Default parameters
{$EXTERNALSYM}
and{$NODEFINE}
directivesimplements
keyword for properties
- Wordbool, longbool and bytebool store
true
as-1
instead of 1 (Boolean is unchanged) - Components must be installed using
packages
. - Assertions.
out
parameters.Widestring
interface
anddispinterface
keyword and COM (dispid
) support.
- Support for 32-bit;
Ansistring
replacesshortstring
as the default string typeCurrency
Variant
(for interop with OLE automation).- Threading support and
ThreadVar
keyword. - 4 byte data is 4 byte aligned new
packed
keyword overrides this behavior; - TDateTime starts at
1899/12/30
under D1 it started at0000/00/00
- new
finalization
keyword register
andstdcall
calling conventions added.packed
keyword.
这篇关于Delphi 语言特性和引入/弃用的版本列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!