FPC New Features Trunk

This is an old revision of FPC New Features Trunk, edited by PascalDragon at . The current revision is 71454.

Added feature "Default"

About this page

Below you can find a list of new features introduced since the previous release, along with some background information and examples. Note that since svn trunk is by definition still under development, some of the features here may still change before they end up in a release version.

All systems

Language

Delphi-like namespaces units

Dynamic array constructors

New compiler intrinsic Default

type
  TRecord = record
    i: LongInt;
    s: AnsiString;
  end;

var
  i: LongInt;
  o: TObject;
  r: TRecord;
begin
  i := Default(LongInt); // 0
  o := Default(TObject); // Nil
  r := Default(TRecord); // ( i: 0; s: '')
end.
type
  generic TTest<T> = class
    procedure Test;
  end;

procedure TTest.Test;
var
  myt: T;
begin
  myt := Default(T); // will have the correct Default if class is specialized
end;

Support for type helpers

Code generator

Class field reordering

Removing the calculation of dead values

Shortcuts to speed up floating point calculations

New compiler targets

Support for the Java Virtual Machine and Dalvik targets

Support for the AIX target

See also