[fpc-pascal] Record Method and Operators

Cesar Romero cesarliws at gmail.com
Wed Oct 22 15:54:19 CEST 2008


Florian Klaempfl escreveu:
> Cesar Romero schrieb:
>   
>> Hi,
>>
>> Im wondering if FPC Team have plans to support Record Methods/Operators
>> in future versions of FPC
>> I read the actual "Future plans" and the most closed item is "RTL:: More
>> compatibility with later Delphi versions."
>> But it do not means that records can be changed.
>>
>> I want to implement my ValueTypes using record with implicit operators
>> and constructor/destructor, like this code written by a friend, Lee Nover.
>>
>> TSpecifier = record
>>   S: AnsiString;
>>   WS: WideString;
>>   Intf: IInterface;
>>
>>   class operator Implicit(const S: AnsiString): TSpecifier;
>>   class operator Implicit(const C: Cardinal): TSpecifier;
>>   class operator Implicit(const D: Double): TSpecifier;
>>   class operator Implicit(const I: Integer): TSpecifier;
>>   class operator Implicit(const I64: Int64): TSpecifier;
>>   class operator Implicit(const V: TValue): TSpecifier;
>>   class operator Implicit(const WS: WideString): TSpecifier;
>>   class operator Implicit(const Intf: IInterface): TSpecifier;
>>
>>   class operator Implicit(const Spec: TSpecifier): AnsiString;
>>   class operator Implicit(const Spec: TSpecifier): Cardinal;
>>   class operator Implicit(const Spec: TSpecifier): Double;
>>   class operator Implicit(const Spec: TSpecifier): Integer;
>>   class operator Implicit(const Spec: TSpecifier): Int64;
>>   class operator Implicit(const Spec: TSpecifier): TValue;
>>   class operator Implicit(const Spec: TSpecifier): WideString;
>>   class operator Implicit(const Spec: TSpecifier): IInterface;
>>
>>   case NativeType: Integer of
>>     varInteger: (I: Integer);
>>     varInt64: (I64: Int64);
>>     varLongWord: (C: Cardinal);
>>     varDouble: (D: Double);
>>     varObject: (O: TValue);
>> end;
>>
>> My plans is to have a single framework compatible with Delphi 2007/2009
>> and FPC, so Ill not use some D2009 only resources, but implicit
>> operators make the live of users very better to write less and better code.
>>
>> Can I have any hope about this subject?
>>     
>
> What does it prevent you from using FPC's operator overloading
> capabilities to do so which has FPC for 10 years?
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>   
freepascal search is not working,
With google I found
http://courses.cs.vt.edu/~cs3304/FreePascal/doc/ref/node12.html

Interesting but is not what I mention, it is just the basic.

-- 
Cesar Romero
http://blogs.liws.com.br/cesar
http://blogs.liws.com.br/cesar/?feed=rss2




More information about the fpc-pascal mailing list