Re: [fpc-devel] Proposal: Supporting initial references for weakexternal

2011-01-11 Thread Jeppe Johansen
b) What happen if NoHandler is not found? Then TestProc cannot be resolved to any symbol, and will generate a weak undefined reference. Eg. it won't complain about an undefined reference I don't see where you reference the "weakinitial" symbol in your patch that's why I'm asking this questio

[fpc-devel] Variables declaraction inside code

2011-01-11 Thread kingbiz...@gmail.com
Something that I always thought very nice on other languages is the possible of adding variables inside the codes, I'm very happy using the FPC but came on my mind, FPC is always getting better and better (I first saw it like 2 years ago and I am impressed with its progress), would it on the fu

Re: [fpc-devel] Proposal: IIF - IfThen Cond True False

2011-01-11 Thread kingbiz...@gmail.com
Em 12/01/2011 05:00, Paul Ishenin escreveu: 12.01.2011 13:54, kingbiz...@gmail.com пишет: Well guys, thanks for replying, the generic method is a very nice method, I personally didn't know that the FPC support it, very thank you for that! FPC does not support it at the moment. I hope it will i

Re: [fpc-devel] Proposal: IIF - IfThen Cond True False

2011-01-11 Thread Paul Ishenin
12.01.2011 13:54, kingbiz...@gmail.com пишет: Well guys, thanks for replying, the generic method is a very nice method, I personally didn't know that the FPC support it, very thank you for that! FPC does not support it at the moment. I hope it will in a month. Best regards, Paul Ishenin _

Re: [fpc-devel] Proposal: IIF - IfThen Cond True False

2011-01-11 Thread kingbiz...@gmail.com
Em 12/01/2011 04:47, Marco van de Voort escreveu: In our previous episode, Paul Ishenin said: But even delphi does not have it for regular procedures/functions. I suppose because regular procedures/functions does not support overloading. ??? I use it all the time? Requires overload directive i

Re: [fpc-devel] Proposal: IIF - IfThen Cond True False

2011-01-11 Thread Paul Ishenin
12.01.2011 13:47, Marco van de Voort пишет: In our previous episode, Paul Ishenin said: But even delphi does not have it for regular procedures/functions. I suppose because regular procedures/functions does not support overloading. ??? I use it all the time? Requires overload directive iirc,

Re: [fpc-devel] Proposal: IIF - IfThen Cond True False

2011-01-11 Thread Marco van de Voort
In our previous episode, Paul Ishenin said: > But even delphi does not have it for regular procedures/functions. I > suppose because regular procedures/functions does not support overloading. ??? I use it all the time? Requires overload directive iirc, but works.

Re: [fpc-devel] String and UnicodeString and UTF8String

2011-01-11 Thread Marco van de Voort
In our previous episode, Jeff Wormsley said: > > encoding of full Unicode. Ansi and UCS2 (really UTF-16) only *look* > > easier to handle in user code, but both will fail and require special > > code whenever characters outside the assumed codepage may occur. > > Preface: I don't write internati

Re: [fpc-devel] Proposal: IIF - IfThen Cond True False

2011-01-11 Thread Paul Ishenin
12.01.2011 13:28, kingbiz...@gmail.com wrote: The problem: we have to do *one function for every type*, on the C and PHP method is is *globally* If we want one for Integer we must declare one for it, if we want one for X we need to declare it... I want to know from you, what you would think abou

Re: [fpc-devel] Proposal: Supporting initial references for weakexternal

2011-01-11 Thread Paul Ishenin
12.01.2011 13:21, Jeppe Johansen wrote: a) NoHandler must have the same arguments and calling convention as TestProc? With this solution, no. This uses only symbol names This I don't understand. What happen when I call DoSomething(1, 'test'); But DoSomething is not resolved and instead Hand

Re: [fpc-devel] Proposal: Supporting initial references for weakexternal

2011-01-11 Thread Jeppe Johansen
Den 12-01-2011 06:56, Paul Ishenin skrev: 12.01.2011 12:29, Jeppe Johansen wrote: A short example: procedure NoHandler; begin end; procedure TestProc; weakexternal name 'TestProc' set 'NoHandler'; ... begin TestProc; // This will call NoHandler end. If we modify the example: procedure NoHandle

Re: [fpc-devel] String and UnicodeString and UTF8Stringt

2011-01-11 Thread LacaK
...: the new ansistring type has a hidden "element size" field (in addition to the reference count, length and codepage), and from what I can see at page 10 of http://edn.embarcadero.com/article/images/38980/Delphi_and_Unicode.pdf, Delphi 2009's unicodestring is simply an ansistring(1200).

[fpc-devel] [fpprofiler] bug

2011-01-11 Thread Alex Shishkin
http://bugs.freepascal.org/view.php?id=18471 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] Proposal: Supporting initial references for weakexternal

2011-01-11 Thread Paul Ishenin
12.01.2011 12:29, Jeppe Johansen wrote: A short example: procedure NoHandler; begin end; procedure TestProc; weakexternal name 'TestProc' set 'NoHandler'; ... begin TestProc; // This will call NoHandler end. If we modify the example: procedure NoHandler; begin end; procedure TestProcHandler; [

[fpc-devel] Proposal: Supporting initial references for weakexternal

2011-01-11 Thread Jeppe Johansen
While trying to find a nice solution for generating interrupt vector tables on ARM, I found that the usually employed solution is to generate weak references to symbols, that are initialized to a single handler. This way an application can override the weak reference, by declaring a new symbol

Re: [fpc-devel] String and UnicodeString and UTF8String

2011-01-11 Thread Jeff Wormsley
On 01/11/2011 11:10 AM, Hans-Peter Diettrich wrote: UTF-8 combines an single (byte-based) storage type with lossless encoding of full Unicode. Ansi and UCS2 (really UTF-16) only *look* easier to handle in user code, but both will fail and require special code whenever characters outside the a

Re: [fpc-devel] String and UnicodeString and UTF8String

2011-01-11 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: And we have to deal with Windows, where the default is UTF16. ... since Delphi 2009 uses (unicode)string everywhere, we need at least also unicode versions. Since the generic Delphi "string" type can be any Unicode encoding now, it IMO would be legal to use UTF-8 or UT

Re: [fpc-devel] String and UnicodeString and UTF8String

2011-01-11 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: This has the advantage that you always have all optimal implementations available, regardless of the platform or default string encoding. It does not require extra work because we have to write all those versions also if we want the RTL to be compilable for different defau

Re: [fpc-devel] String and UnicodeString and UTF8String

2011-01-11 Thread Hans-Peter Diettrich
Marco van de Voort schrieb: Btw, while looking up rawbytestring I saw this in the Delphi help: "Declaring variables or fields of type RawByteString should rarely, if ever, be done, because this practice can lead to undefined behavior and potential data loss." IIRC RawByteString should be used

Re: [fpc-devel] Dwarf3 and the encoding of classes

2011-01-11 Thread Martin
On 11/01/2011 21:39, Joost van der Sluis wrote: On Tue, 2011-01-11 at 15:59 +, Martin wrote: On 11/01/2011 09:54, Joost van der Sluis wrote: There's a new version at that location now. This one has a better case-sensitivity patch and support for viewing class-constants. For those interested

Re: [fpc-devel] Dwarf3 and the encoding of classes

2011-01-11 Thread Joost van der Sluis
On Tue, 2011-01-11 at 15:59 +, Martin wrote: > On 11/01/2011 09:54, Joost van der Sluis wrote: > > > > There's a new version at that location now. This one has a better > > case-sensitivity patch and support for viewing class-constants. For > > those interested... > > > The new one crashes, whe

Re: [fpc-devel] Dwarf3 and the encoding of classes

2011-01-11 Thread Martin
On 11/01/2011 09:54, Joost van der Sluis wrote: There's a new version at that location now. This one has a better case-sensitivity patch and support for viewing class-constants. For those interested... The new one crashes, when my test application is run (dwarf and dwarf 3): >> TCmdLineDebugg

Re: [fpc-devel] String and UnicodeString and UTF8Stringt

2011-01-11 Thread Jonas Maebe
On 11 Jan 2011, at 10:47, Marco van de Voort wrote: Embacadero however decided otherwise and kept a wall between the 1 and 2 byte types. So at least 1 and 2 byte types as basetype are different targets. I'm actually not sure about that: the new ansistring type has a hidden "element size"

Re: [fpc-devel] String and UnicodeString and UTF8Stringt

2011-01-11 Thread Michael Schnell
On 01/11/2011 02:05 PM, Marco van de Voort wrote: That is wrong. Better read up on that. AFAIK, this is what they announced some time ago, Seemingly it turned out to be done some other way... Nonetheless fpc seems to intend to offer something like this (right now in an experimental branch).

Re: [fpc-devel] String and UnicodeString and UTF8Stringt

2011-01-11 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > Sorry I don't understand what you mean with this. > > Embacadero however decided otherwise and kept a wall between the 1 and 2 > > byte types. So at least 1 and 2 byte types as basetype are different > > targets. > Unfortunately I don't have Delphi >

Re: [fpc-devel] Dwarf3 and the encoding of classes

2011-01-11 Thread Joost van der Sluis
On Tue, 2011-01-11 at 17:02 +0700, Paul Ishenin wrote: > 11.01.2011 16:54, Joost van der Sluis wrote: > > http://www.lazarussupport.com/downloads/gdb_win32_fedora15_with_pascal_patches.zip > > > That one just crashed, when I tested with stabs > >>> Works here. Do you have an example pr

Re: [fpc-devel] String and UnicodeString and UTF8Stringt

2011-01-11 Thread Michael Schnell
On 01/11/2011 11:11 AM, Jonas Maebe wrote: in case the input string was empty). As the coding scheme and element size are control-block-variables it seems that even an empty string should have the appropriate definitions. -Michael ___ fpc-devel ma

Re: [fpc-devel] String and UnicodeString and UTF8Stringt

2011-01-11 Thread Michael Schnell
On 01/11/2011 10:47 AM, Marco van de Voort wrote: But it also required the input granularity (1,2 maybe 4) to be a variable. Sorry I don't understand what you mean with this. Embacadero however decided otherwise and kept a wall between the 1 and 2 byte types. So at least 1 and 2 byte types as b

Re: [fpc-devel] String and UnicodeString and UTF8Stringt

2011-01-11 Thread Jonas Maebe
On 11 Jan 2011, at 10:47, Marco van de Voort wrote: I still have to study Jonas last message. It seems to indicate that I misunderstood what rawbytestring. If that is true, Jonas is right, separating the targets will result in two targets (rawbytestring and unicodestring) Here's some nice ex

Re: [fpc-devel] Dwarf3 and the encoding of classes

2011-01-11 Thread Paul Ishenin
11.01.2011 16:54, Joost van der Sluis wrote: http://www.lazarussupport.com/downloads/gdb_win32_fedora15_with_pascal_patches.zip That one just crashed, when I tested with stabs Works here. Do you have an example program? The latest version of my testcase. There's a new version at that locat

Re: [fpc-devel] Dwarf3 and the encoding of classes

2011-01-11 Thread Joost van der Sluis
On Mon, 2011-01-10 at 20:43 +, Martin wrote: > On 10/01/2011 20:26, Joost van der Sluis wrote: > > On Mon, 2011-01-10 at 01:12 +, Martin wrote: > >> On 03/01/2011 11:30, Joost van der Sluis wrote: > >>> I also promised to build a Windows-gdb binary with the latest Dwarf-3 > >>> patches from

Re: [fpc-devel] String and UnicodeString and UTF8Stringt

2011-01-11 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > I had hoped that using the dynamically encoded string type nearly > everywhere would allow for a great lot of not OS-specific code in the > VCL (and LCL) without the need for excessive conversions maintaining the > systems' coding (UTF-16 or UTF-8

Re: dwarf3 and others too [Re: [fpc-devel] Dwarf3 and the encoding of classes]

2011-01-11 Thread Joost van der Sluis
On Tue, 2011-01-11 at 00:23 +, Martin wrote: > I did some more test., I will check in later... > > None of the old dwarf or stabs seems to define the <> operator for classes. > p Foo<>Bar > gives unknown symbold Foo<>Bar > So it does take it as one symbol? > > > nil > nil is not defined ever

Re: [fpc-devel] String and UnicodeString and UTF8String

2011-01-11 Thread LacaK
I think at most two are required for any target: unicodestring (D2009 compatibility), and if really necessary because somehow the unicodestring version causes too much overhead, an ansistring($) version as well. That's only for the classes though, I think most of the base RTL can be simpl

Re: [fpc-devel] String and UnicodeString and UTF8String

2011-01-11 Thread Michael Schnell
On 01/10/2011 04:27 PM, Marco van de Voort wrote: I think in the planned Embarcadero cross-compile products, string will also be utf-16 on OS X and Linux. Yak, I had hoped that using the dynamically encoded string type nearly everywhere would allow for a great lot of not OS-specific code in th

Re: [fpc-devel] String and UnicodeString and UTF8String

2011-01-11 Thread Michael Schnell
On 01/10/2011 04:27 PM, Marco van de Voort wrote: And what do we do if e.g. Lazarus changes opinion and goes from utf8 to utf16 on Windows? (e.g. the Delphi/unicode becomes the dominant influx). The current way Lazarus works (UTF-8 in a String Type called "ANSIString", as well with Windows as