Re: [fpc-devel] indexed property with default value for param?

2009-06-11 Thread Martin Friebe
Michael Van Canneyt wrote: On Wed, 10 Jun 2009, Martin wrote: However the follwing Syntax compiles fine: function GetFoo(Bar: integer; XY: Boolean = True): Integer; property Foo[Bar: integer; XY: Boolean] read GetFoo; a := Object.Foo[1]; But: Is that supposed to work? No, it is not. It is a

Re: [fpc-devel] indexed property with default value for param?

2009-06-11 Thread Martin Friebe
Daniël Mantione wrote: Op Thu, 11 Jun 2009, schreef Michael Van Canneyt: On Thu, 11 Jun 2009, Jonas Maebe wrote: I would think it is a natural extension of procedural overloading ? It's not that simple. Properties can be both hidden variable access as well as procedure access. Variable

[fpc-devel] local class of error?

2009-06-02 Thread Martin Friebe
Not sure if this is intended, or just a wrong assumptions by the parser? Procedure foo; type TSomeClass = Class of TSome; . gives the error: Error: Local class definitions are not allowed But there is no Class declaration. (Not sure what you call class of) TSome is declared elsewhere

[fpc-devel] virtual methods and smart-linking?

2009-04-09 Thread Martin Friebe
Just a question. Can smart linking detect and remove unused virtual methods? I did a few tests and it seems it does not remove them. If I understand it correctly, then this could be because virtual methods are nver directly linked (they go via the VMT) so the linker would not know? Best

[fpc-devel] unit imm.pp on windows

2009-02-19 Thread Martin Friebe
Hi, does anyone know if a unit imm.pp (see below) was ever part of FPC? (See http://bugs.freepascal.org/view.php?id=13140 ) If it was, what was the reason for it's removal? Martin head of imm.pp: { This file is part of the Free Pascal run time library. Copyright (c) 2005 by the Free

[fpc-devel] valgrind, parsing sym from exe

2009-01-28 Thread Martin Friebe
Hi, I am trying to use Valgrind on a executable build with fpc. I get the following error (the error was while using callgrind, with verbose output) ==18293== Reading syms from /data/OTHER/laz_trnc/lazarus (0x8048000) @@ unlikely looking definition in unparsed remains ; @@ expected ',' at

[fpc-devel] units not getting rebuild after changes in other used (uses) units

2009-01-21 Thread Martin Friebe
Hi, I encountered a strange problem. I am not yet sure what causes it, but I have a suspicion. Before I go all the way, of trying to prove the cause, and report it as a bug, let nme ask here if it may already be a knonw issue, or maybe is by design. Normally if I change a unit (e.g. changes

Re: [fpc-devel] Call initialisation of library automatically in unit-initialization?

2008-12-03 Thread Martin Friebe
Joost van der Sluis wrote: Op woensdag 03-12-2008 om 13:09 uur [tijdzone +0100], schreef Michael Van Canneyt: On Wed, 3 Dec 2008, Joost van der Sluis wrote: When you use the MySQL client, you have to call myslq_library_init to initialise the library, and mysql_library_end to

Re: [fpc-devel] Multithreading wait for

2008-12-03 Thread Martin Friebe
Mattias Gärtner wrote: Hi all, I'm looking for a high performance 'wait-for'. The situation: There are m threads working in parallel on n chunks of work (n=m). The n chunks are indexed 0..n-1. Sometimes one thread needs the result of some of the lower indexed chunks. For example the chunk

Re: [fpc-devel] Unicode and UTF8String

2008-12-01 Thread Martin Friebe
Florian Klaempfl wrote: Felipe Monteiro de Carvalho schrieb: On Mon, Dec 1, 2008 at 10:13 AM, Florian Klaempfl [EMAIL PROTECTED] wrote: No, it will be RTLString which type depends on the OS. Ok, so code would be something like this: var OSString: RTLString; MyString:

Re: [fpc-devel] Unicode and UTF8String

2008-12-01 Thread Martin Friebe
Marco van de Voort wrote: In our previous episode, Martin Friebe said: Why would you do this and not MyString := SomeRTLRoutine; ? If I understand that right, this may cause some overhead, that in some(few) cases is not needed. Correct. If I write an application using

Re: [fpc-devel] Unicode and UTF8String

2008-12-01 Thread Martin Friebe
Marco van de Voort wrote: In our previous episode, Martin Friebe said: I agree, using RTlString will probably help fpc to optimize your exe for each OS. But, using RTLString means you do not know, if you have UTF8 or not. Correct. Because UTF8 behaves slightly different from

Re: [fpc-devel] Unicode and UTF8String

2008-12-01 Thread Martin Friebe
Luiz Americo Pereira Camara wrote: Martin Friebe escreveu: All the code Widestring := RtlFunction; Utf8string := RtlFunction; will run, it may just perform badly. Yes and no. Let's assume the platforms windows and unix having UnicodeString (UTF-16) and UTF8String as native types

Re: [fpc-devel] Unicode and UTF8String

2008-12-01 Thread Martin Friebe
Mattias Gaertner wrote: On Mon, 01 Dec 2008 15:06:45 + Martin Friebe [EMAIL PROTECTED] wrote That would mean that in order to avoid conversation, some functions of the RTL would be needed in overloaded versions for each string type. IMHO this applies only to those, which do

Re: [fpc-devel] Unicode and UTF8String

2008-12-01 Thread Martin Friebe
Felipe Monteiro de Carvalho wrote: On Mon, Dec 1, 2008 at 10:13 AM, Florian Klaempfl [EMAIL PROTECTED] wrote: I assume that the new variable encoding type would be used for all unicode routines, am I right? No, it will be RTLString which type depends on the OS. The more I

Re: [fpc-devel] Unicode and UTF8String

2008-12-01 Thread Martin Friebe
Marco van de Voort wrote: In our previous episode, Mattias Gaertner said: Florian Klaempfl wrote: [...] My opinion is that it should be the programmers choice. I a programmer wants or needs a simpler way (keeping all the strings in is application in one format, which will be known to him)

Re: [fpc-devel] Unicode and UTF8String

2008-12-01 Thread Martin Friebe
Felipe Monteiro de Carvalho wrote: On Mon, Dec 1, 2008 at 7:33 PM, Martin Friebe [EMAIL PROTECTED] wrote: I suggested to have a rtl, that has overloaded functions for each string type. of course that sounds easier than in fact it will be. This is about the same as having all string

Re: [fpc-devel] Unicode and UTF8String

2008-12-01 Thread Martin Friebe
to set himself what RTLString means, (with the default being the OS depended). It isn't really a nice solution though. But I throw it into the discussion anyway. Otherwise I''ll have to see, If I can come up with something else. Jonas Maebe wrote: On 01 Dec 2008, at 22:33, Martin Friebe wrote

Re: [fpc-devel] Unicode and UTF8String

2008-12-01 Thread Martin Friebe
Mattias Gaertner wrote: [...] Also it would be nice (so I do not know how) not to have to duplicate code, in order to archive this. Something like generics, maybe. The goal of RTLString is to avoid duplicate code in the RTL. Yes I acknowledged that this would be a

Re: [fpc-devel] Unicode support in RTL - Roadmap

2008-11-21 Thread Martin Friebe
Felipe Monteiro de Carvalho wrote: On Fri, Nov 21, 2008 at 2:42 PM, Michael Schnell [EMAIL PROTECTED] wrote: And thus forces all users to understand the full UTF-8 spec and to rewrite their programs, even though the old code perfectly compiles and up to a certain extent seems to work. This

Re: [fpc-devel] Unicode and Lazarus

2008-11-20 Thread Martin Friebe
Daniël Mantione wrote: Op Thu, 20 Nov 2008, schreef Felipe Monteiro de Carvalho: So, what kind of support could be implemented in Free Pascal to improve things for Lazarus and it´s users? Maybe a real UTF8String? There will be a real UTF8string, i.e. ansistring with UTF-8 encoding as part of

[fpc-devel] assembler error with inlining on power pc / mac? [Fwd: [Lazarus] PPC: SynEditFoldedView giving parameter syntax error]

2008-11-06 Thread Martin Friebe
Hi, I do not have myself a power-pc, nor mac. But I have several reports like the below. I know from one instance (where this happened during cross-compiling from a linux box) that the error disappeared, when inlining was disabled (The units explicitly marks a lot of procedures for

[fpc-devel] a few installation issues (trunc on freebsd)

2008-11-02 Thread Martin Friebe
I have a few question, regarding my attempts to install fpc from trunc (I read the build faq, yet I have not succeeded...) On a freebsd (7.0) box, I have downloaded and installed the pre-compiled fpc 2.2.2 ( to use as my initial compiler.) I have created my workind dir /data/fpc_trunc/svn

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

2008-09-19 Thread Martin Friebe
Michael Van Canneyt wrote: On Fri, 19 Sep 2008, ABorka wrote Hi Michael, It was created in fpapache.pp in the handlerequest event. M:=MC.create(self); It worked without using the createnew, with the latest FPC source code. This is weird, because the code before that searches if there

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] Unicodestring branch, please test and help fixing

2008-09-12 Thread Martin Friebe
Just to make sure, all of this discussion is based on various collation for European languages? Or shall we include Arabic, Chinese and other languages? But they have there own chars, they can be identified without collation, so they do not need the language info, to be distinguished from

Re: [fpc-devel] Unicodestring branch, please test and help fixing

2008-09-12 Thread Martin Friebe
listmember wrote: Martin Friebe wrote: Just to make sure, all of this discussion is based on various collation No part of this discussion is based on collation. Ok, so we were talking about different things Here is a scenario for you: You have multilanguage text as data. Someone has

Re: [fpc-devel] Unicodestring branch, please test and help fixing

2008-09-12 Thread Martin Friebe
listmember wrote: IMHO The discussion splits here between: 1) How can this be done in a specific app 2) what should fpc provide as for 2: This would be on top of yet (afaik) missing basic functions such as Compare using collation x (where collation is given as argument to compare, not as part

Re: [fpc-devel] Unicodestring branch, please test and help fixing

2008-09-11 Thread Martin Friebe
Michael Van Canneyt wrote: On Thu, 11 Sep 2008, Anton Kavalenka wrote: Florian Klaempfl wrote: Graeme Geldenhuys schrieb: Remember, Unicode support is much more that simply storing and displaying text. You have various encodings, RTL or LTR direction etc. I can't see how a

Re: [fpc-devel] Unicodestring branch, please test and help fixing

2008-09-11 Thread Martin Friebe
listmember wrote: Actually, UTF-8 can contain bidi info, it's indeed a matter of the renderer. And, how do you propose doing a case-insensitive search in a given text that contains multiple languages? I assume you speak of multiply collations in on string? IMHO You can't? But you could use a

Re: [fpc-devel] Unicodestring branch, please test and help fixing

2008-09-11 Thread Martin Friebe
listmember wrote: I also do not know of other apps that could do this. (And it may not be possible). Look around. Databses for example, AFAIK the most you can do is define a collation per column. True. But, that does not mean that those app/databases are well thought out. Does it? Point of

synchronous class [Re: Multi threading support was Re: [fpc-devel] Russian locale information not compatible withFPClocale variables]

2008-07-31 Thread Martin Friebe
IMHO per class may create some problems? but maybe I am just overlooking something? TBar =class( TFoo ) end synchronized class; Let's say TFoo was declared in another unit, and TFoo was not declared Synchronized. Then TFoo code can be entered by anyone at any time. Even if a thread is in

[fpc-devel] protected members access across classes in the same package, but what about inherited cross package

2008-07-20 Thread Martin Friebe
Just a question, which came to my mind in relation to http://bugs.freepascal.org/view.php?id=11697 I understand that if you declare 2 classes in the same package (same file), then they are allowed to look at each others protected members (variables, properties, func, proc). I wonder what the

Re: [fpc-devel] C style operator doesn't work with properties in 2.3.1

2008-07-17 Thread Martin Friebe
Or Add a Method to the target object. (as long as it is part of your code base, or can be modified by you) and then do FDayList[itm.WeekDayNum].Rows[itm.Timeslot].AvailableSlotsInc(itm.CountSlots); In the class that defines property AvailableSlot; you can add procedure AvailableSlotsInc(n :

Re: [fpc-devel] C style operator doesn't work with properties in 2.3.1

2008-07-17 Thread Martin Friebe
From my understanding ( the fpc team probably can to more exact): * lexical level This would be like a simple Find and Replace on the text. This would work with anything, as it doesn't know what it is translating. (It is very similar to a (non-buildin) C-preprocessor) * parser level The

Re: [fpc-devel] The usage of Include() doesn't work any more in 2.3.1

2008-07-16 Thread Martin Friebe
Hi, just to add another opinion. Personally, I would thing that it was nice to allow (write-able) Properties to any var-param (even out-param). Write-able include properties with a setter-procedure. IMHO the way it could be done would be for the compiler to create a temporary variable. This

[fpc-devel] move(xx, ansistring[1] versus ansistring, len)

2008-05-12 Thread Martin Friebe
Hi, I am trying to find some info on how I can use move to archive the following: I am looking for an equal replacement of move(somepchar^, ansi_str_dest[1], len) The problem with ansi_str_dest[1] is that if the above call happens with a len of 0, and an ansi string with 0 length = this leads

Re: [fpc-devel] move(xx, ansistring[1] versus ansistring, len)

2008-05-12 Thread Martin Friebe
move(somepchar^,pchar(ansi_str_dest)^,len); doesn't check fpc_ansistr_unique. So it works only if ansi_str_dest has only one reference; or both strings will be modified (because no copy-on-write happens). At least, that's what I get to see, if I compile with -al and look at the assembler.

Re: [fpc-devel] move(xx, ansistring[1] versus ansistring, len)

2008-05-12 Thread Martin Friebe
to nil, in case of empty string, but since len is 0 nothing will happen. Thanks a lot Martin Jonas Maebe wrote: On 13 May 2008, at 00:17, Martin Friebe wrote: move(somepchar^,pchar(ansi_str_dest)^,len); doesn't check fpc_ansistr_unique. So it works only if ansi_str_dest has only one reference

Re: [fpc-devel] LockFree Queue algorithm

2008-01-27 Thread Martin Friebe
What about a long running (eg daemon) application? If temp/tail hits the upper boundary of Integer? (If I understand it correctly) I don't know if interlockedIncrement gives a boundary error, but if not, it still fails. - With currently integer, it gets a negative value, once crossing

interlocked commands [Re: [fpc-devel] LockFree Queue algorithm]

2008-01-27 Thread Martin Friebe
have to ensure alignment (as I believe fpc, aligns integer on 16 bit?) Martin Florian Klaempfl wrote: DarekM schrieb: Martin Friebe pisze: You will need to test it, but the following may also work procedure tFlQueue.push(const tm : tNodeQueue); var newTemp, lastTail, newTail

Re: [fpc-devel] Debug Info proposal

2008-01-13 Thread Martin Friebe
I haven't tested this, but from what I read, if strip can preserve the symbols in a separate file then gdb should be able to load them. http://www.delorie.com/gnu/docs/gdb/gdb_125.html |exec-file [ filename ]| Specify that the program to be run (but not the symbol table) is found in

Re: [fpc-devel] Debug Info proposal

2008-01-13 Thread Martin Friebe
sorry my mailer wrapped that a bit awkward. the important part was: |symbol-file [ filename ]| Read symbol table information from file filename. |PATH| is searched when necessary. Use the |file| command to get both symbol table and program to run from the same file. Martin