Re: [fpc-devel] Light weight threads for FPC

2007-12-17 Thread David Butler
A big difference between threads and fibers in Windows is that threads are preemtively scheduled, while fibers are co-operatively scheduled. Unfortunately, Windows' fiber implementation has severe limitations. To get around this I created a library that does real light-weight "fibers". See here

Re: [fpc-devel] Unicode functions

2008-09-01 Thread David Butler
See: http://fundementals.sourceforge.net/cUnicodeChar.html The "Unicode letter table" contains upper/lower case codes. 2008/9/1 Jonas Maebe <[EMAIL PROTECTED]> > > On 26 Aug 2008, at 11:28, Graeme Geldenhuys wrote: > > On 8/26/08, Daniël Mantione <[EMAIL PROTECTED]> wrote: >> >>> Klingon does

[fpc-devel]Minor differences with Delphi

2003-11-06 Thread David Butler
Thanks for the great 1.90 release! I'm busy converting the open source "Fundamentals" units (http://fundementals.sourceforge.net/) to compile under FreePascal. So far I have found the following minor issues: * const MinCurrency : Currency = -922337203685477.5807; MaxCurrency : Currency = 92

Re: [fpc-devel]Minor differences with Delphi

2003-11-06 Thread David Butler
On Thu, 6 Nov 2003 23:31:27 +0100 (CET), you wrote: >> * Minor difference with Delphi units: >> * RaiseLastOSError is not defined in SysUtils. > >What is it supposed to do, specifically on non windows, or should it >be windows only? I had a look at Kylix's RaiseLastOSError function. It uses

Re: [fpc-devel]Minor differences with Delphi

2003-11-07 Thread David Butler
On Fri, 7 Nov 2003 09:15:17 +0100 (CET), you wrote: >> I had a look at Kylix's RaiseLastOSError function. It uses >> GetLastError which calls '__errno_location' from 'libc.so.6'. On >> Windows this uses the GetLastError WinAPI call. >> >> This is Delphi's implementation for RaiseLastOSError: > >[

[fpc-devel]FreePascal and AnsiStrings

2003-11-07 Thread David Butler
Hi FPC developers I see FreePascal uses the following internal format for AnsiStrings: Ptr - 8 : Length Ptr - 4 : Reference Count Ptr : Characters Delphi uses the following format: Ptr - 8 : Reference Count Ptr - 4 : Length Ptr : Characters My questions are: 1. Is the order purely incidental

[fpc-devel]IntToHex difference

2003-11-07 Thread David Butler
Hi A small difference between FreePascal and Delphi's IntToHex function: FreePascal's IntToHex function interprets the Digits parameter as the 'maximum number of digits'. Delphi interprets it as the 'minimum number of digits'. For example, FreePascal IntToHex($10, 1) = '0', whereas Delphi return

[fpc-devel]function overloading resolution order question

2003-11-07 Thread David Butler
Hi How does FreePascal resolve ambigious calls to overloaded functions? For example, if we have two procedures: procedure Test(const X: Integer); overload; procedure Test(const X: Extended); overload; If a call is made to Test(1), the procedure with the Integer parameter is called. When we hav

[fpc-devel]Compiler runtime error when using WideString character constant

2003-11-07 Thread David Butler
Hi I am using FreePascal 1.9.0[2003/11/05]. For the following code, the compiler crashes with "Runtime error 216 at 0x004467CA". type RR = record RA : WideString; end; const Z : RR = (RA: 'B'); The compiler does not crash if the 'B' is changed to a string of more than one character,

[fpc-devel]Compiler Runtime error

2004-02-28 Thread David Butler
Hi The following program makes fpc 1.9.2 exit with a runtime error: Runtime error 216 at 0x004CFAFF 0x004CFAFF 0x004CFC21 0x0046DADC 0x0046CF59 0x0046F0A1 0x0046F0B2 0x0046F0B2 0x0046F0B2 0x0046F736 0x00452D6E const WideA = WideChar(#65); var C : WideChar; begin C :=

Re: [fpc-devel] Extend the libraries people!

2005-06-05 Thread David Butler
On Fri, 03 Jun 2005 01:26:34 -0400, you wrote: >> What makes python interesting are the many classes it offers by default >> to perform standard tasks, especially in the text treatment department; >> regular expression stuff etc. >> >> The same goes for most languages; Mostly it's not the language

[fpc-devel] FPC 2.0 and Delphi difference in scope of protected class members

2005-06-07 Thread David Butler
Hi In Delphi the protected members are "visible anywhere in the module where its class is declared and from any descendant class, regardless of the module where the descendant class appears." It seems that FPC 2.0 doesn't support that second part: "regardless of the module where the descendant cl

[fpc-devel] Passing consts to const

2005-06-07 Thread David Butler
Hi The following code snippet gives a compile error: "Error: Can't assign values to const variable". It should be legal, since we are passing a const to a const parameter. It should only give that error if TestBuf was declared as "var Buf" instead of "const Buf". Regards David {$WRITEABLECONS

Re: [fpc-devel] Passing consts to const

2005-06-07 Thread David Butler
On Tue, 07 Jun 2005 19:59:56 +0200, you wrote: >David Butler wrote: >> {$WRITEABLECONST OFF} >> >> procedure TestBuf(const Buf; Size: Integer); >> begin >> end; >> >> const A : Byte = 1; > > From this point A is treated as a normal vari

Re: [fpc-devel] Passing consts to const

2005-06-07 Thread David Butler
On Tue, 7 Jun 2005 21:30:16 +0200 (CEST), you wrote: >> I don't want to say FPC should be doing everything the way Delphi >> does, but in this case it makes sense, in my opinion. > >Please report bugs/compatibilities to the bugs repository. Bugs posted on >the mailing list tend to be forgotten. A

Re: [fpc-devel] Passing consts to const

2005-06-07 Thread David Butler
On Tue, 7 Jun 2005 21:30:16 +0200 (CEST), you wrote: >> I don't want to say FPC should be doing everything the way Delphi >> does, but in this case it makes sense, in my opinion. > >Please report bugs/compatibilities to the bugs repository. Bugs posted on >the mailing list tend to be forgotten. A

Re: [fpc-devel] Patch to speed up Uppercase/Lowercase functions

2005-06-11 Thread David Butler
On Sat, 11 Jun 2005 13:33:57 +0200 (CEST), you wrote: >To compare, I made 6 versions of Lowercase: >Result on an AMD 64 3000: >Lowercase time to execute: 00:00:01.563 >Lowercase2 Time to execute: 00:00:01.363 >Lowercase3 Time to execute: 00:00:01.394 >Lowercase4 Time to execute: 00:00:00.999 >Low

Re: [fpc-devel] Patch to speed up Uppercase/Lowercase functions

2005-06-12 Thread David Butler
On Sat, 11 Jun 2005 18:36:44 +0200 (CEST), you wrote: >> The most expensive operation in the whole LowerCase function is the >> UniqueString allocation for when the string changes. For the case >> where the string is already in lower case it is important not call >> UniqueString. It makes a 600% d

[fpc-devel] Constant arrays sometimes produce incorrect data tables

2005-08-13 Thread David Butler
Hi all I picked up this weird code generation problem (it was also present in 2.0.0). I reported it as bug 4277 today. Unfortunately I can only reproduce it in a specific context, so please e-mail me for the unit. The problem is when you define an array of constant strings. For example: const

Re: [fpc-devel] Constant arrays sometimes produce incorrect data tables

2005-08-13 Thread David Butler
Hi Anton Thanks for the suggestion. I checked this by changing String to AnsiString, both in the declaration and where the array is accessed, but it still compiles differently in the two units. It seems that where the usual pattern is to store the table as "Ptr, Ptr, Ptr, ..., Value, Value, Valu

Re: [fpc-devel] language extensions

2007-06-14 Thread David Butler
Actually, Delphi now supports "for-in". It also supports things like nested classes, class helpers, operator overloading and inlining. See: http://dn.codegear.com/article/34324 On 14/06/07, Florian Klaempfl <[EMAIL PROTECTED]> wrote: Graeme Geldenhuys schrieb: > Hi, > > I found this websit

Re: [fpc-devel] language extensions

2007-06-14 Thread David Butler
On 14/06/07, Ales( Katona <[EMAIL PROTECTED]> wrote: David Butler wrote / napísal(a): > Actually, Delphi now supports "for-in". > > It also supports things like nested classes, class helpers, operator > overloading and inlining. All those features are because of .NE

Re: [fpc-devel] language extensions

2007-06-14 Thread David Butler
On 14/06/07, Bram Kuijvenhoven <[EMAIL PROTECTED]> wrote: Daniël Mantione wrote: > > Op Thu, 14 Jun 2007, schreef Florian Klaempfl: > >> Graeme Geldenhuys schrieb: >>> I like the "for-in" code. >> Using the default property is clean, using count imo not. Thought I >> admit I've no idea so far to

Re: [fpc-devel] language extensions

2007-06-14 Thread David Butler
Delphi supports iterator for the "for in" in different ways: * Dynamic arrays, static arrays, sets, strings and records have "built-in" iterators * For classes and interface it requires a method called "GetEnumerator". GetEnumerator can return a class, an interface or a record. This class, in