[fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Graeme Geldenhuys
Hi, I was following a discussion in the delphi.non-technical newsgroup. They raised an issue about distinct types. I tried the following example under FPC and unexpectedly, FPC doesn't raise any errors! If you declare a distinct type as follows: type TMyInteger = type Integer; The type TMyInte

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Michael Van Canneyt
On Thu, 18 Sep 2008, Graeme Geldenhuys wrote: > Hi, > > I was following a discussion in the delphi.non-technical newsgroup. > They raised an issue about distinct types. I tried the following > example under FPC and unexpectedly, FPC doesn't raise any errors! > > If you declare a distinct type

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Graeme Geldenhuys
On Thu, Sep 18, 2008 at 9:42 AM, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: >> >> The type TMyInteger <> Integer so you are not supposed to be allowed >> to assign one to the other. Yet you can. See the following program. > > But obviously delphi also allows it ? It compiles everything, > just

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Michael Van Canneyt
On Thu, 18 Sep 2008, Graeme Geldenhuys wrote: > On Thu, Sep 18, 2008 at 9:42 AM, Michael Van Canneyt > <[EMAIL PROTECTED]> wrote: > >> > >> The type TMyInteger <> Integer so you are not supposed to be allowed > >> to assign one to the other. Yet you can. See the following program. > > > > But ob

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said: > And it is also very annoying because > > Type > MyString = type string; > > Const > AString = 'something'; > > Var > M : MyString; > > begin > M:=AString; > end. > > Will no longer compile if you are too strict. They should at least

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Michael Van Canneyt
On Thu, 18 Sep 2008, Florian Klaempfl wrote: > Michael Van Canneyt schrieb: > > > > On Thu, 18 Sep 2008, Graeme Geldenhuys wrote: > > > > > Hi, > > > > > > I was following a discussion in the delphi.non-technical newsgroup. > > > They raised an issue about distinct types. I tried the following

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Florian Klaempfl
Michael Van Canneyt schrieb: On Thu, 18 Sep 2008, Graeme Geldenhuys wrote: Hi, I was following a discussion in the delphi.non-technical newsgroup. They raised an issue about distinct types. I tried the following example under FPC and unexpectedly, FPC doesn't raise any errors! If you declare

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Yury Sidorov
From: "Florian Klaempfl" <[EMAIL PROTECTED]> Michael Van Canneyt schrieb: On Thu, 18 Sep 2008, Graeme Geldenhuys wrote: Hi, I was following a discussion in the delphi.non-technical newsgroup. They raised an issue about distinct types. I tried the following example under FPC and unexpectedl

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Graeme Geldenhuys
On Thu, Sep 18, 2008 at 10:11 AM, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > And it is also very annoying because > > Type > MyString = type string; > > Const > AString = 'something'; > > Var > M : MyString; > > begin > M:=AString; > end. > > Will no longer compile if you are too strict

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Florian Klaempfl
Graeme Geldenhuys schrieb: On Thu, Sep 18, 2008 at 10:11 AM, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: And it is also very annoying because Type MyString = type string; Const AString = 'something'; Var M : MyString; begin M:=AString; end. Will no longer compile if you are too stric

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Florian Klaempfl
Yury Sidorov schrieb: From: "Florian Klaempfl" <[EMAIL PROTECTED]> Michael Van Canneyt schrieb: On Thu, 18 Sep 2008, Graeme Geldenhuys wrote: Hi, I was following a discussion in the delphi.non-technical newsgroup. They raised an issue about distinct types. I tried the following example unde

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Ivo Steinmann
Graeme Geldenhuys schrieb: > Hi, > > I was following a discussion in the delphi.non-technical newsgroup. > They raised an issue about distinct types. I tried the following > example under FPC and unexpectedly, FPC doesn't raise any errors! > > If you declare a distinct type as follows: > type TMy

[fpc-devel] MSG_NOSIGNAL in Mac OS X

2008-09-18 Thread Felipe Monteiro de Carvalho
Hello, The sockets unit for Mac OS X (FPC 2.2.2) does not contain MSG_NOSIGNAL, which is necessary for the correct functioning of the Synapse library. I modifyed the Synapse source (locally) to use $2 for MSG_NOSIGNAL, which is the same value for FreeBSD/NetBSD. Note that I have very little

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Graeme Geldenhuys
On Thu, Sep 18, 2008 at 11:34 AM, Florian Klaempfl <[EMAIL PROTECTED]> wrote: >> >> That's the whole point - it shouldn't be assignment compatible. You >> are creating a new MyString type, irrespective of what base-type it >> was based on. Only MyString types should be assigned to MyString >> typ

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Florian Klaempfl
Graeme Geldenhuys schrieb: eg: #2 type MyType = type Double; MyOtherType = type Double; Otherwise, what's the different between a "alias" type (eg #1) and a "distinct" type (eg #2)?? As I said: overloading. It means: compatible but not equal. If you want distinct: use as said, classes

Re: [fpc-devel] MSG_NOSIGNAL in Mac OS X

2008-09-18 Thread Marco van de Voort
In our previous episode, Felipe Monteiro de Carvalho said: > The sockets unit for Mac OS X (FPC 2.2.2) does not contain > MSG_NOSIGNAL, which is necessary for the correct functioning of the > Synapse library. > > I modifyed the Synapse source (locally) to use $2 for > MSG_NOSIGNAL, which is th

Re: [fpc-devel] MSG_NOSIGNAL in Mac OS X

2008-09-18 Thread Felipe Monteiro de Carvalho
Some searching says it doesn't exist in Mac OS X: http://lists.apple.com/archives/macnetworkprog/2002/Dec/msg00091.html But they have an equivalent. Curiously, my very simple webserver worked when hardcoding the constant =P http://wiki.lazarus.freepascal.org/Networking#Webserver_example -- Fe

Re: [fpc-devel] MSG_NOSIGNAL in Mac OS X

2008-09-18 Thread Marco van de Voort
In our previous episode, Felipe Monteiro de Carvalho said: > Some searching says it doesn't exist in Mac OS X: > > http://lists.apple.com/archives/macnetworkprog/2002/Dec/msg00091.html > > But they have an equivalent. I checked on my 10.4 and it is as there. It is not in the headers, and SO_nosi

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Yury Sidorov
From: "Florian Klaempfl" <[EMAIL PROTECTED]> Yury Sidorov schrieb: From: "Florian Klaempfl" <[EMAIL PROTECTED]> Michael Van Canneyt schrieb: On Thu, 18 Sep 2008, Graeme Geldenhuys wrote: Hi, I was following a discussion in the delphi.non-technical newsgroup. They raised an issue about di

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Florian Klaempfl
Yury Sidorov schrieb: Yes. But it works only partially. For example the following code is not compilable: Well, I wouldn't know either what you expect :) I expect that compiler will choose DoTest with ansistring parameter in that case. What rule do you apply to say this? //-- type

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Yury Sidorov
From: "Florian Klaempfl" <[EMAIL PROTECTED]> To: "FPC developers' list" Sent: Thursday, September 18, 2008 4:14 PM Subject: Re: [fpc-devel] Bug in FPC and declaring distinct types Yury Sidorov schrieb: Yes. But it works only partially. For example the following code is not compilable: Well,

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Florian Klaempfl
Yury Sidorov schrieb: From: "Florian Klaempfl" <[EMAIL PROTECTED]> To: "FPC developers' list" Sent: Thursday, September 18, 2008 4:14 PM Subject: Re: [fpc-devel] Bug in FPC and declaring distinct types Yury Sidorov schrieb: Yes. But it works only partially. For example the following code is

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Graeme Geldenhuys
On Thu, Sep 18, 2008 at 3:40 PM, Florian Klaempfl <[EMAIL PROTECTED]> wrote: >>> What rule do you apply to say this? >> >> Compiler treats '1234' as ansistring constant. Therefore ansistring >> overload must be choosen here. > > No, '1234' is taken as generic string constant. And which type is a g

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Yury Sidorov
From: "Florian Klaempfl" <[EMAIL PROTECTED]> Yury Sidorov schrieb: From: "Florian Klaempfl" <[EMAIL PROTECTED]> To: "FPC developers' list" Sent: Thursday, September 18, 2008 4:14 PM Subject: Re: [fpc-devel] Bug in FPC and declaring distinct types Yury Sidorov schrieb: Yes. But it works only

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Martin Friebe
Florian Klaempfl wrote: Yury Sidorov schrieb: Yury Sidorov schrieb: Yes. But it works only partially. For example the following code is not compilable: Well, I wouldn't know either what you expect :) I expect that compiler will choose DoTest with ansistring parameter in that case. What rule

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Florian Klaempfl
Graeme Geldenhuys schrieb: On Thu, Sep 18, 2008 at 3:40 PM, Florian Klaempfl <[EMAIL PROTECTED]> wrote: What rule do you apply to say this? Compiler treats '1234' as ansistring constant. Therefore ansistring overload must be choosen here. No, '1234' is taken as generic string constant. And w

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Florian Klaempfl
Yury Sidorov schrieb: From: "Florian Klaempfl" <[EMAIL PROTECTED]> Yury Sidorov schrieb: From: "Florian Klaempfl" <[EMAIL PROTECTED]> To: "FPC developers' list" Sent: Thursday, September 18, 2008 4:14 PM Subject: Re: [fpc-devel] Bug in FPC and declaring distinct types Yury Sidorov schrieb:

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Graeme Geldenhuys
On Thu, Sep 18, 2008 at 3:50 PM, Yury Sidorov <[EMAIL PROTECTED]> wrote: > > It makes implementation of utf8string impossible using this approach... > I agree. I created a distinct string type (TfpgString) in fpGUI. That way I could ensure TfpgString is a UTF-8 string and String is a AnsiString s

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Yury Sidorov
From: "Florian Klaempfl" <[EMAIL PROTECTED]> Yury Sidorov schrieb: From: "Florian Klaempfl" <[EMAIL PROTECTED]> Yury Sidorov schrieb: From: "Florian Klaempfl" <[EMAIL PROTECTED]> To: "FPC developers' list" Sent: Thursday, September 18, 2008 4:14 PM Subject: Re: [fpc-devel] Bug in FPC and decl

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Graeme Geldenhuys
On Thu, Sep 18, 2008 at 3:55 PM, Florian Klaempfl <[EMAIL PROTECTED]> wrote: > > Without any further code, the type 'asdf' is not defined, $H means only > ansistring might be prefered. So does that mean if you have {$H+} enabled, then in the example below, the p1(ansistring) version will be calle

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Florian Klaempfl
Yury Sidorov schrieb: We discussed this once and concluded, that something like this hurts more than it helps because an overloaded assignment operator allows the compiler always to mess really around :) Maybe. But you stated that it is possible to create fully functional utf8string type f

Re: [fpc-devel] Bug in FPC and declaring distinct types

2008-09-18 Thread Graeme Geldenhuys
On Thu, Sep 18, 2008 at 10:51 AM, Florian Klaempfl <[EMAIL PROTECTED]> wrote: > > This is not true. The main purpose is to be able to overload > functions/operators: > > type > TUTF8String = type ansistring; > > enables you to overload all procedure already defined for ansistrings with > UTF8Strin

[fpc-devel] What to expect if FPC fully supports unicode?

2008-09-18 Thread Graeme Geldenhuys
Hi, How far will Unicode support go in FPC when it is one day implemented? Anybody know if the following is allowed in D2009? Please add to the list... :-) eg: 1..) My I have the following class names? type TMyåClaß = class(TObject) end; 2..) What about function

Re: [fpc-devel] What to expect if FPC fully supports unicode?

2008-09-18 Thread Thaddy
Graeme Geldenhuys wrote: Please add to the list... :-) eg: 1..) My I have the following class names? type TMyåClaß = class(TObject) end; 2..) What about function and parameter names? type TMyåClaß = class(TObject) public property Nã

[fpc-devel] Re: What to expect if FPC fully supports unicode?

2008-09-18 Thread Graeme Geldenhuys
On Thu, Sep 18, 2008 at 4:45 PM, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote: > > Anybody know if the following is allowed in D2009? Oops, as a joke I posted the same message in the Delphi newsgroups. To my *huge* surprise, unicode identifiers _are_ supported in D2009. I guess CodeGear is a bit a

[fpc-devel] Re: What to expect if FPC fully supports unicode?

2008-09-18 Thread Graeme Geldenhuys
On Thu, Sep 18, 2008 at 4:45 PM, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote: > Hi, > > How far will Unicode support go in FPC when it is one day implemented? > Anybody know if the following is allowed in D2009? For those that haven't see it yet, here is D2009's take on this... http://windemo1.c

Re: [fpc-devel] Re: What to expect if FPC fully supports unicode?

2008-09-18 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: > > How far will Unicode support go in FPC when it is one day implemented? > > Anybody know if the following is allowed in D2009? > > For those that haven't see it yet, here is D2009's take on this... > > http://windemo1.codegear.com/Tiburon/Launc

Re: [fpc-devel] MSG_NOSIGNAL in Mac OS X

2008-09-18 Thread Jonas Maebe
On 18 Sep 2008, at 11:47, Felipe Monteiro de Carvalho wrote: The sockets unit for Mac OS X (FPC 2.2.2) does not contain MSG_NOSIGNAL, which is necessary for the correct functioning of the Synapse library. See http://bugs.freepascal.org/view.php?id=9401 Jonas

Re: [fpc-devel] What to expect if FPC fully supports unicode?

2008-09-18 Thread Daniël Mantione
Op Thu, 18 Sep 2008, schreef Graeme Geldenhuys: Hi, How far will Unicode support go in FPC when it is one day implemented? type TMyåClaß = class(TObject) public property Nãàm: unicodestring read ; end; Never say never, but the compiler uses shortstring

[fpc-devel] fcl-web improvement for apache modules, question

2008-09-18 Thread ABorka
Hi, I'm working on the Apache application (TCustomApacheApplication) simultaneous request handling. When the Apache module tries to create additional instances of the web module I get `Error: Duplicate name: A component named "FPWebModule1" already exists` How can we create multiple instanc

Re: [fpc-devel] fcl-web improvement for apache modules, question

2008-09-18 Thread Michael Van Canneyt
On Thu, 18 Sep 2008, ABorka wrote: > Hi, > > I'm working on the Apache application (TCustomApacheApplication) simultaneous > request handling. > > When the Apache module tries to create additional instances of the web module > I get > `Error: Duplicate name: A component named "FPWebModule1" al