just use it with records in delphi. BDS supports functions inside records and even supports operator overloading for records