[fpc-pascal] Record Method and Operators
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? -- Cesar Romero http://blogs.liws.com.br/cesar http://blogs.liws.com.br/cesar/?feed=rss2 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Record Method and Operators
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? ___ I guess... nothing, but I cant find any docs until now, I googled about that and search on fpc site. If I can find docs about that and it can work as I expect, Ill use of cource. -- Cesar Romero http://blogs.liws.com.br/cesar http://blogs.liws.com.br/cesar/?feed=rss2 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Record Method and Operators
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@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 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Record Method and Operators
Florian, In which regard, quoting: The assignment operator is also used to convert types from one type to another. The compiler will consider all overloaded assignment operators till it finds one that matches the types of the left hand and right hand expressions. If no such operator is found, a 'type mismatch' error is given. ? It's not our fault that CG choose another syntax. ___ It is nobody fault, Im happy to have FPC around, and all resources is welcome. But my question was Is there any plans to support a compatible sintaxe? Yes, Maybe or No, will be a good answer. I dont want to blame FPC team or Delphi Team, I hope I can have a compatible sintaxe, and asking here I think I have more changes to get a positive answer. Thank you, -- Cesar Romero http://blogs.liws.com.br/cesar http://blogs.liws.com.br/cesar/?feed=rss2 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC + Indy
Hi Burkhard, Am Freitag, 18. Juli 2008 18:04 schrieb Cesar Romero: I wrote a appserver with fpc +Indy, all works just fine in OpenSuse 11, but when I install in a Fedora box (I tried Fedora 7, 8 and 9) it just dont run and raises the exception: An unhandled exception occurred at $08159DC9 : EIdCouldNotBindSocket : Could not bind socket. Address and port are already in use. $08159DC9 $0817CC21 $0817D404 $0817C8F5 $0806610D $08065D43 $08064228 $08048F7B EIdSocketError : Socket Error # 98 Im using a custom port number and Im sure that it is not in use, does anyone know if I should install custom packages in Fedora to have this working? IIRC, this is a bug which shows only on systems having IPv6 support enabled. Make sure to add a IPv4 binding to your server, otherwise it tries to start listening socket for IPv4 and IPv6, which fails (or something like that; can't remember the exact details ..). However, following code solved my problems: MyServer:=TIdTCPServer.create; MyServer.DefaultPort:=8099; MyServer.bindings.add.IPVersion:=Id_IPv4; I figured out that this weekend binding did the trick MyServer.bindings.add.IPVersion:=Id_IPv4; Thank you, for the reply. Best regards, -- Cesar Romero http://blogs.liws.com.br/cesar http://blogs.liws.com.br/cesar/?feed=rss2 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] FPC + Indy
I wrote a appserver with fpc +Indy, all works just fine in OpenSuse 11, but when I install in a Fedora box (I tried Fedora 7, 8 and 9) it just dont run and raises the exception: An unhandled exception occurred at $08159DC9 : EIdCouldNotBindSocket : Could not bind socket. Address and port are already in use. $08159DC9 $0817CC21 $0817D404 $0817C8F5 $0806610D $08065D43 $08064228 $08048F7B EIdSocketError : Socket Error # 98 Im using a custom port number and Im sure that it is not in use, does anyone know if I should install custom packages in Fedora to have this working? Regards, Cesar Romero http://blogs.liws.com.br/cesar ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC + Indy
Hi Michael, I wrote a appserver with fpc +Indy, all works just fine in OpenSuse 11, but when I install in a Fedora box (I tried Fedora 7, 8 and 9) it just dont run and raises the exception: An unhandled exception occurred at $08159DC9 : EIdCouldNotBindSocket : Could not bind socket. Address and port are already in use. $08159DC9 $0817CC21 $0817D404 $0817C8F5 $0806610D $08065D43 $08064228 $08048F7B EIdSocketError : Socket Error # 98 Im using a custom port number and Im sure that it is not in use, does anyone know if I should install custom packages in Fedora to have this working? Things that jump to mind: - If the port number is below 1024, you must run as root. The port Im using in 8090 or 8099 and Im already runnig as root for this tests. - It's also possible that the firewall settings are different on fedora by default No firewall started - Maybe selinux is installed and it doesn't allow anything by default ? I disabled that too. I tested: Hardware: OpenSuse 11 - works fine Fedora 7 - do not work VM: Fedora 8: do not work Fedora 9: do not work -- Cesar Romero http://blogs.liws.com.br/cesar http://blogs.liws.com.br/cesar/?feed=rss2 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC + Indy
Marco van de Voort escreveu: Im using a custom port number and Im sure that it is not in use, does anyone know if I should install custom packages in Fedora to have this working? Things that jump to mind: - If the port number is below 1024, you must run as root. The port Im using in 8090 or 8099 and Im already runnig as root for this tests. - It's also possible that the firewall settings are different on fedora by default No firewall started - Maybe selinux is installed and it doesn't allow anything by default ? I disabled that too. I agree with Michael, and the only thing I can think of is selinux. However in case of doubt, use strace. Btw, I assume this is indy 10. Yes, it is. -- Cesar Romero http://blogs.liws.com.br/cesar http://blogs.liws.com.br/cesar/?feed=rss2 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpGUI (a Free Pascal GUI Toolkit) v0.6 has been released
Hi Graeme, Great step, congrats. Are there any new screnshot? []s Cesar Hi, fpGUI version 0.6 has been released. Five months after the previous release, v0.6 is finally here. As always, lot has been improved and added. For example: a newly supported platform (FreeBSD) and 64-bit support just to mention two. Source and documentation are available for download at SourceForge: http://sourceforge.net/project/showfiles.php?group_id=182330 Release notes can be read at: http://sourceforge.net/project/shownotes.php?group_id=182330release_id=577323 For more information on fpGUI visit: http://opensoft.homeip.net/fpgui/ Support newsgroup: news://opensoft.homeip.net Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Pascal Translator for Virtual Machines
Hi Marco, Im glad to see that, Ill check out and keep in touch. []s Cesar Romero I finally setup a SourceForge project for the PTVM: https://sourceforge.net/projects/ptvm/ Right now it's at beta 0.3, and can translate and compile (with MTASC) a simple Hello World application. I'm working on translating types, sentences, etc. I'm using SVN since I have more experience with it. Please let me know if you need anything to test or contribute. Regards! -Marco ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Specifying a Interface type via $Interfaces
Graeme, Hi, Hi I want to start learning the use of Interfaces. It's a language feature I have by-passing for some time now. From what I have read this seems to be a handy language feature to learn. In the FPC documentation in mentions I can have COM or CORBA (Java) interface types. Could somebody please explain the difference. And why would I use one over the other? Im not sure, but I think that the one difference is about time life: COM uses ref count CORBA should be somethink like garbage collection []s Cesar Romero ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to analyze a core dump?
Where S is initialized? I only see L initialized. []s Cesar Romero 442: L:=length(s); 443: if L1 then exit; 444: case s[1] of so I can't see how it could possibly be uninitialized. Bye ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Unit for working with Lists, Double Linked Lists and Stacks
Catalin, Interesting stuff, unhappily the licence dont allow me to use in my business app. []s Cesar Romero Hello, Just wanted to contribute my two cents with this homemade Unit [attached to the mail] for working with: - Simple Linked Lists; - Double Linked Lists; - Stacks; Don't know of any other unit that does this, but think it is of use to the day-to-day Pascal developer. Feedback would be a bliss. Thank you. Note: This is a homemade project. I'm going to develop it further than what I need to do with it, if developers find it usefull. I welcome advices. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Unit for working with Lists, Double Linked Lists and Stacks
Catalin, Because it's GPL/GNU? :) Exactly []s Cesar Romero On Monday 04 June 2007 04:23, Cesar Romero wrote: Catalin, Interesting stuff, unhappily the licence dont allow me to use in my business app. []s Cesar Romero Hello, Just wanted to contribute my two cents with this homemade Unit [attached to the mail] for working with: - Simple Linked Lists; - Double Linked Lists; - Stacks; Don't know of any other unit that does this, but think it is of use to the day-to-day Pascal developer. Feedback would be a bliss. Thank you. Note: This is a homemade project. I'm going to develop it further than what I need to do with it, if developers find it usefull. I welcome advices. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Usage of TInterfacedObject. Automatic release?
Luiz Americo, This was my first idea. And now gains force again. The problem is that the bug can not be isolated easily. Another option is that there's a mem leak in delphi also. Does some one know how to trace a mem leak in delphi? Use FastMM with FullDebugOptions []s Cesar Romero ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Usage of TInterfacedObject. Automatic release?
var Manager: TVTDragManager; It should be Interface. like var Manager: IDropSource; or other implemented interface []s Cesar Romero Luiz Americo Pereira Camara escreveu: I'm tracing a memory leak in a Delphi ported component and found that the culprit was a TInterfacedObject descendant that was not being freed. I found that if i directly call Free or _Release the memory leak vanishes (Delphi code does not call these). My question is: is TInterfacedObject descendants supposed to be freed automatically or should i call Free directly? See attached example. Using fpc 2.1.4 under win32 XP SP2. Luiz ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Usage of TInterfacedObject. Automatic release?
Luiz Americo, Anyway, calling manually _Release avoid the leak and i will stay with it for now (I hope did not break anything). It can work for that case, but I think that is not a good ideia. If you are using a TInterfacedObject descendant, it will call the _Release when out of context, so in that especific case seems to never go out of context, and then you _realease call works, but in other place it can go out of context before, and the you will have others AV. - As Joao suggest, the best way is create a weak reference, where when 2 objects need to reference each other one should use Pointer to hold one reference - Avoid circular reference - Create a Finalization method that will set one of the references to nil []s Cesar Romero ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Usage of TInterfacedObject. Automatic release?
Joao Morais escreveu: Cesar Romero wrote: - Create a Finalization method that will set one of the references to nil Is this mandatory? I thought the compiler creates this code for global vars as well as it creates for local vars. Just a workaround to resolve circular references issues. []s Cesar ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Congratulations to FPC!
I saw 2 threads in borland non-tech and references to slashdot about morfik patents: Subject: Morfik Patents AJAX Compiler Is that what you guys are celebrating? I saw too that is a application patent not applyed yet, but I dee desagree with this kind of behavior, not yours, but from morfik, hope never need to use this software. []s Cesar Romero Hi all, After the awesome advanced image editor, Pixel at http://www.kanzelsberger.com. Now, FPC is officially used as backend compiler for another great product, Morfik at http://www.morfik.com. Congratulations! :) PS. Morfik's logo for FPC is nice. ;) -Bee- has Bee.ography at: http://beeography.wordpress.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Summer of code - Lazarus or FPC
Is Lazarus or FPC in Google summer of code? Did someone sent a proposal? []s Cesar Romero ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Summer of code - Lazarus or FPC
Felipe, Can you share your proposal, maybe we can discuss on list and resend in next edition. []s Cesar On 3/17/07, Cesar Romero [EMAIL PROTECTED] wrote: Is Lazarus or FPC in Google summer of code? Did someone sent a proposal? I sent a proposal, and it was rejected. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Write Windows Printer Driver
Have fpc translation of DDK for write printer driver done? Can someone point me a direction of where find this kind of information? Regards, Cesar Romero ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] THashedStringList vs TFPHashTable
Graeme, I dont know if is the same, but I know that the operations in THashedStringList is sloow, too much unecessary operations, I use TStringHash class for that. for interfaces: Look the unit JazzClass.pas in http://jazz.liws.com.br/download/jazz_a7.zip for objects: http://blogs.liws.com.br/cesar/download/ObjectRegister.html I wrote a article in my blog fast add and search objects http://blogs.liws.com.br/cesar/?p=23, sorry still portuguese, but you can look at source code: []s Cesar Romero Graeme Geldenhuys escreveu: Hi, Is TFPHashTable the same as Delphi's THashedStringList? I am looking for a List class that can hold large amounts of objects with a ID string associated for quick lookups. Regards, - Graeme - ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: Free Pascal widget set
Why not wxWidgets? Linux map to GTK - GTK 2.0 alread done Windows to Native widget set Mac to Cocoa Serious, I still dont undertande why not, is a licence issue? []s Cesar Romero http://blogs.liws.com.br/cesar As promised, the documenation for fpGUI (not complete) is available on the website at: http://opensoft.homeip.net/fpgui/docs/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] OO Delegation
Any updates in Delegation status? Im porting a delphi app that uses delegation a lot, is the the dailly dev snapshot news about this? []s Cesar Romero ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal