Delphi language features missing from the Free Pascal Compiler: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 1 | + | Note: some new Delphi features are already implemented in [[FPC New Features Trunk|FPC trunk]]. | |
| 2 | 2 | ||
| 3 | 3 | ## New since D4 | |
| 4 | 4 | ||
| 5 | 5 | ### Exporting of overloaded functions | |
| 6 | 6 | ||
| 7 | - | ||
| 8 | - | ||
| 9 | - | ||
| 10 | - | ||
| 11 | - | ||
| 7 | + | (version not entirely sure, but came in with overloading, so definitely pre-D6) | |
| 12 | 8 | ||
| 13 | - | ||
| 9 | + | In library packages select an overloaded variant to export. Assume we have some overloaded methods: | |
| 10 | + | ``` | |
| 11 | + | function doSomeThing(a: type1): type2; stdcall; | |
| 12 | + | function doSomeThing(a: type3): type4; stdcall; | |
| 13 | + | ``` | |
| 14 | 14 | ||
| 15 | + | and in the library (for building the dll using the unit above) we want to export them: | |
| 16 | + | ``` | |
| 15 | 17 | exports | |
| 16 | - | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 18 | + | doSomeThing(a: type1) name 'doSomeThingTYPE1', | |
| 19 | + | doSomeThing(a: type3) name 'doSomeThingTYPE3'; | |
| 20 | 20 | ``` | |
| 21 | 21 | ||
| 22 | 22 | ### implements delegation of interfaces | |
| 23 | 23 | ||
| 24 | - | ||
| 24 | + | Delegating interfaces to classes is not always supported, | |
| 25 | 25 | ||
| 26 | - | ||
| 27 | - | ||
| 28 | - | ||
| 26 | + | * [Mantis 16531](<http://bugs.freepascal.org/view.php?id=16531>) | |
| 27 | + | * [Mantis 8591](<http://bugs.freepascal.org/view.php?id=8951>) | |
| 28 | + | * [Mantis 23403](<http://bugs.freepascal.org/view.php?id=23403>) | |
| 29 | 29 | ||
| 30 | 30 | ## New since Delphi 2007 | |
| 31 | 31 | ||
| 32 | 32 | ## New since Delphi 2009 | |
| 33 | 33 | ||
| 34 | 34 | #### Anonymous Methods | |
| 35 | 35 | ||
| 36 | - | ||
| 37 | - | ||
| 36 | + | 1. <http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/anonymousmethods_xml.html> | |
| 37 | + | 2. <http://delphi.about.com/od/objectpascalide/a/understanding-anonymous-methods-in-delphi.htm> | |
| 38 | 38 | ||
| 39 | 39 | Supported since 3.3.1: [[FPC New Features Trunk|Support for Function References and Anonymous Functions]] | |
| 40 | 40 | ||
| 41 | 41 | ## New since Delphi 2010 | |
| 42 | 42 | ||
| 43 | 43 | #### Custom Attributes | |
| 44 | 44 | ||
| 45 | - | ||
| 45 | + | Custom Attributes are a language feature in Delphi that allow annotating types and type members with special objects that carry additional information. Attributes extend the object-oriented model with aspect-oriented elements. | |
| 46 | 46 | ||
| 47 | 47 | <http://delphi.about.com/od/oopindelphi/a/delphi-attributes-understanding-using-attributes-in-delphi.htm> | |
| 48 | 48 | ||
| 49 | 49 | Supported since 3.3.1: [[Custom Attributes]] | |
| 50 | 50 | ||
| 51 | 51 | #### Enhanced RTTI | |
| 52 | 52 | ||
| 53 | 53 | <http://docwiki.embarcadero.com/RADStudio/en/RTTI_directive_(Delphi)> | |
| 54 | 54 | ||
| 55 | 55 | #### Delayed directive | |
| 56 | 56 | ||
| 57 | - | ||
| 57 | + | Info is here: <http://docwiki.embarcadero.com/RADStudio/en/Libraries_and_Packages#Delayed_Loading> Some info about internals: | |
| 58 | 58 | ||
| 59 | - | ||
| 60 | - | ||
| 61 | - | ||
| 59 | + | 1. <http://blogs.embarcadero.com/abauer/2009/08/25/38894> | |
| 60 | + | 2. <http://blogs.embarcadero.com/abauer/2009/08/29/38896> | |
| 61 | + | 3. <http://blogs.embarcadero.com/chrishesik/2009/11/02/35056> | |
| 62 | 62 | ||
| 63 | 63 | fpc wiki about that topic: <http://wiki.freepascal.org/Dynamically_loading_headers> | |
| 64 | 64 | ||
| 65 | - | ||
| 65 | + | Originally I thought that delayed is similar to weakexternal which FPC has for some platforms but after reading this: <http://docwiki.embarcadero.com/CodeExamples/XE3/en/DelayedLoading_(Delphi)> I understand that this is simply a wrapper around LoadLibrary and GetProcessAdress with automatic loading and unloading.--[Paul Ishenin](</User:Paul_Ishenin> "User:Paul Ishenin") 13:45, 18 January 2013 (UTC) | |
| 66 | 66 | ||
| 67 | 67 | ## Misc | |
| 68 | 68 | ||
| 69 | - | ||
| 70 | - | ||
| 69 | + | 1. [[packages|(Library) packages]] | |
| 70 | + | 2. "automated" keyword, which is like "public", but generates COM specific RTTI. Afaik this kind of COM usage is deprecated though. | |
| 71 | 71 | ||
| 72 | 72 | ## Already implemented | |
| 73 | 73 | ||
| 74 | 74 | ### FPC 3.0.4 | |
| 75 | 75 | ||
| 76 | 76 | #### Advanced records | |
| 77 | 77 | ||
| 78 | 78 | <http://docwiki.embarcadero.com/RADStudio/en/Structured_Types#Records_.28advanced.29> | |
| 79 | 79 | ||
| 80 | 80 | ### FPC 2.6.0 | |
| 81 | 81 | ||
| 82 | 82 | #### AS and IS extended for interfaces | |
| 83 | 83 | ||
| 84 | - | ||
| 84 | + | New since Delphi 2010. Info is here: | |
| 85 | 85 | ||
| 86 | - | ||
| 87 | - | ||
| 86 | + | 1. <http://docwiki.embarcadero.com/RADStudio/en/Interface_References#Casting_Interface_References_to_Objects> | |
| 87 | + | 2. <http://blogs.embarcadero.com/abauer/2009/08/21/38893> | |
| 88 | 88 | ||
| 89 | - | ||
| 89 | + | Implemented in FPC 2.6.0. | |
| 90 | 90 | ||
| 91 | 91 | ## Reference | |
| 92 | 92 | ||
| 93 | - | ||
| 94 | - | ||
| 95 | - | ||
| 93 | + | 1. <http://edn.embarcadero.com/article/34324> | |
| 94 | + | 2. <http://edn.embarcadero.com/article/images/39076/New_Delphi_Coding_Styles_and_Architectures.pdf> | |
| 95 | + | 3. <http://docwiki.embarcadero.com/RADStudio/en/What's_New_in_Delphi_and_C%2B%2BBuilder_2010> | |
| 96 | 96 | ||
| 97 | 97 | --- | |
| 98 | - | ||
| 99 | - | ||
| 100 | - | ||
| 98 | + | *From the Free Pascal wiki, page "Delphi language features missing from the Free Pascal Compiler", as the Internet Archive kept it on 2025-05-16, last changed on 2025-02-04. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
