Delphi language features missing from the Free Pascal Compiler: what changed
Revision 1 to 2. 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 | ## Contents | |
| 4 | 4 | ||
| 5 | 5 | * 1 New since D4 | |
| 6 | 6 | * 1.1 Exporting of overloaded functions | |
| 7 | 7 | * 1.2 implements delegation of interfaces | |
| 8 | 8 | * 2 New since Delphi 2007 | |
| 9 | 9 | * 3 New since Delphi 2009 | |
| 10 | 10 | * 3.1 Anonymous Methods | |
| 11 | 11 | * 4 New since Delphi 2010 | |
| 12 | 12 | * 4.1 Custom Attributes | |
| 13 | 13 | * 4.2 Enhanced RTTI | |
| 14 | 14 | * 4.3 Delayed directive | |
| 15 | 15 | * 5 Misc | |
| 16 | 16 | * 6 Already implemented | |
| 17 | 17 | * 6.1 FPC 3.0.4/trunk | |
| 18 | 18 | * 6.1.1 Advanced records | |
| 19 | 19 | * 6.2 FPC 2.6.0 | |
| 20 | 20 | * 6.2.1 AS and IS extended for interfaces | |
| 21 | 21 | * 7 Reference | |
| 22 | 22 | ||
| 23 | 23 | ## New since D4 | |
| 24 | 24 | ||
| 25 | 25 | ### Exporting of overloaded functions | |
| 26 | 26 | ||
| 27 | 27 | (version not entirely sure, but came in with overloading, so definitely pre-D6) | |
| 28 | 28 | ||
| 29 | 29 | In library packages select an overloaded variant to export. Assume we have some overloaded methods: | |
| 30 | 30 | ||
| 31 | 31 | function doSomeThing(a:type1):type2;stdcall; function doSomeThing(a:type3):type4;stdcall; | |
| 32 | 32 | ||
| 33 | 33 | and in the library (for building the dll using the unit above) we want to export them: | |
| 34 | 34 | ||
| 35 | 35 | exports | |
| 36 | 36 | ``` | |
| 37 | 37 | doSomeThing(a:type1) name 'doSomeThingTYPE1', | |
| 38 | 38 | doSomeThing(a:type3) name 'doSomeThingTYPE3'; | |
| 39 | 39 | ``` | |
| 40 | 40 | ||
| 41 | 41 | ### implements delegation of interfaces | |
| 42 | 42 | ||
| 43 | 43 | Delegating interfaces to classes is not always supported, | |
| 44 | 44 | ||
| 45 | 45 | * [Mantis 16531](<http://bugs.freepascal.org/view.php?id=16531>) | |
| 46 | 46 | * [Mantis 8591](<http://bugs.freepascal.org/view.php?id=8951>) | |
| 47 | 47 | * [Mantis 23403](<http://bugs.freepascal.org/view.php?id=23403>) | |
| 48 | 48 | ||
| 49 | 49 | ## New since Delphi 2007 | |
| 50 | 50 | ||
| 51 | 51 | ## New since Delphi 2009 | |
| 52 | 52 | ||
| 53 | 53 | #### Anonymous Methods | |
| 54 | 54 | ||
| 55 | 55 | 1. <http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/anonymousmethods_xml.html> | |
| 56 | 56 | 2. <http://delphi.about.com/od/objectpascalide/a/understanding-anonymous-methods-in-delphi.htm> | |
| 57 | 57 | ||
| 58 | 58 | ## New since Delphi 2010 | |
| 59 | 59 | ||
| 60 | 60 | #### Custom Attributes | |
| 61 | 61 | ||
| 62 | 62 | 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. | |
| 63 | 63 | ||
| 64 | 64 | <http://delphi.about.com/od/oopindelphi/a/delphi-attributes-understanding-using-attributes-in-delphi.htm> | |
| 65 | 65 | ||
| 66 | 66 | #### Enhanced RTTI | |
| 67 | 67 | ||
| 68 | 68 | <http://docwiki.embarcadero.com/RADStudio/en/RTTI_directive_(Delphi)> | |
| 69 | 69 | ||
| 70 | 70 | #### Delayed directive | |
| 71 | 71 | ||
| 72 | 72 | Info is here: <http://docwiki.embarcadero.com/RADStudio/en/Libraries_and_Packages#Delayed_Loading> Some info about internals: | |
| 73 | 73 | ||
| 74 | 74 | 1. <http://blogs.embarcadero.com/abauer/2009/08/25/38894> | |
| 75 | 75 | 2. <http://blogs.embarcadero.com/abauer/2009/08/29/38896> | |
| 76 | 76 | 3. <http://blogs.embarcadero.com/chrishesik/2009/11/02/35056> | |
| 77 | 77 | ||
| 78 | 78 | fpc wiki about that topic: <http://wiki.freepascal.org/Dynamically_loading_headers> | |
| 79 | 79 | ||
| 80 | 80 | 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) | |
| 81 | 81 | ||
| 82 | 82 | ## Misc | |
| 83 | 83 | ||
| 84 | 84 | 1. [[packages|(Library) packages]] | |
| 85 | 85 | 2. "automated" keyword, which is like "public", but generates COM specific RTTI. Afaik this kind of COM usage is deprecated though. | |
| 86 | 86 | ||
| 87 | 87 | ## Already implemented | |
| 88 | 88 | ||
| 89 | 89 | ### FPC 3.0.4/trunk | |
| 90 | 90 | ||
| 91 | 91 | #### Advanced records | |
| 92 | 92 | ||
| 93 | 93 | <http://docwiki.embarcadero.com/RADStudio/en/Structured_Types#Records_.28advanced.29> | |
| 94 | 94 | ||
| 95 | 95 | ### FPC 2.6.0 | |
| 96 | 96 | ||
| 97 | 97 | #### AS and IS extended for interfaces | |
| 98 | 98 | ||
| 99 | 99 | New since Delphi 2010. Info is here: | |
| 100 | 100 | ||
| 101 | 101 | 1. <http://docwiki.embarcadero.com/RADStudio/en/Interface_References#Casting_Interface_References_to_Objects> | |
| 102 | 102 | 2. <http://blogs.embarcadero.com/abauer/2009/08/21/38893> | |
| 103 | 103 | ||
| 104 | 104 | Implemented in FPC 2.6.0. | |
| 105 | 105 | ||
| 106 | 106 | ## Reference | |
| 107 | 107 | ||
| 108 | 108 | 1. <http://edn.embarcadero.com/article/34324> | |
| 109 | 109 | 2. <http://edn.embarcadero.com/article/images/39076/New_Delphi_Coding_Styles_and_Architectures.pdf> | |
| 110 | 110 | 3. <http://docwiki.embarcadero.com/RADStudio/en/What's_New_in_Delphi_and_C%2B%2BBuilder_2010> | |
| 111 | 111 | ||
| 112 | 112 | --- | |
| 113 | - | ||
| 113 | + | *From the Free Pascal wiki, page "delphi language features which fpc does not have", as the Internet Archive kept it on 2022-10-01, last changed on 2021-06-12. 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).* |
