Re: [fpc-pascal] Testing set membership for unicode chars

2013-01-21 Thread Honza
2013/1/20 Paul Ishenin : > 20.01.13, 23:21, Wimpie Nortje пишет: >> >> Hi list >> >> I want to test membership of a unicode char in a set / array of unicode >> chars. Something like >> >> var ucCh: unicodechar; >> >> if ucCh in [ UnicodeChar('0')..UnicodeChar('9')] then >> dosomething; >> >> I

Re: [fpc-pascal] State of fcl-stl generics lib

2013-01-19 Thread Honza
2013/1/11 Juha Manninen > > I remember seeing discussion about fcl-stl saying that it would still > need improvement but nobody is actively working on it. > I just couldn't find the thread about it now. So, what is the current state? > Sorry I have not studied the lib myself yet (long ToDo list).

Re: [fpc-pascal] Reversing bit-order of byte

2012-05-03 Thread Honza
Dne 3.5.2012 9:11 "Koenraad Lelong" napsal(a): > > Does anyone knows an efficient way to reverse bit-order of a byte for the arm-processor ? Lookup from a 256 byte precomputed table? Or I misunderstood the task. -jan ___ fpc-pascal maillist - fpc-pa

Re: [fpc-pascal] Re: Can it map class type as key?

2012-04-26 Thread Honza
2012/4/26 ZHANG Dao-yuan <1123mon...@gmail.com>: > Thanks for your makeshift :) . But the problem still confusing me. My code > is in type-section and it's a declaration not a statement. > >> tFpGMap > The form of the code is similar to a comparision expression and `<' here > looks like a less-than

Re: [fpc-pascal] Win64 and currency

2012-04-01 Thread Honza
2012/3/30 Marco van de Voort : > In our previous episode, Pierre Free Pascal said: >>   if you usee -Aas and -al >> you will see that >> TEST >> is just .quad -10 >> which is wrong of course... >>   Using -10.0 fixes the bug for now if >> you really need this correct fast. >> >>   It would be nice

[fpc-pascal] ANN: heLib/heContnrs stable version for FPC 2.6.0

2012-01-07 Thread Honza
The previously released (RC) version 0.4 was found to be working w/o known bugs with the latest stable FPC 2.6.0 (svn revison 19845). Now virtually (re)releasing the previous RC1 as the offical" stable. Download source tarball here: http://code.google.com/p/fprb/downloads/detail?name=release-0.4.t

Re: [fpc-pascal] IInterface type value and the "as" keyword

2011-12-11 Thread Honza
2011/12/11 Marco van de Voort : > In our previous episode, Honza said: >> Now I'm trying to make that code work with >> current stable (AFAICS that's 2.4.4) > > Correct, but it is relatively short before the 2.6.0 release, with a first > RC1 already available.

[fpc-pascal] IInterface type value and the "as" keyword

2011-12-11 Thread Honza
Hi list, after a long pause I'm trying to revive some code which I didn't touch as long as early this year. At that time it compiled OK with trunk FPC (I believe version 2.5.1). Now I'm trying to make that code work with current stable (AFAICS that's 2.4.4). Everything went smooth until compiler s

Re: [fpc-pascal] operator overloading and counting references / creating / destoying anonymous instances

2011-07-31 Thread Honza
2011/7/28 Bernd : > ¹ I depend on OpenSSL already anyways, so I thought why not make use > of its bignum too when I need it. I hope you're aware of the FPC GMP bindings: http://wiki.freepascal.org/gmp The section http://wiki.freepascal.org/gmp#Extensions_bindings_.26_types discuses extended bi

Re: [fpc-pascal] fgl.TFPGMap

2011-01-20 Thread Honza
2011/1/20 Alex Shishkin : > As I understand problem is in the compiler. It cant use overloaded operator > if it was defined after generic. AFAIK exactly that is the problem and that's why TFPGMap can't cope with some types. >> You can take a look on this container lib, which might be helpful for y

Re: [fpc-pascal] fgl.TFPGMap

2011-01-20 Thread Honza
2011/1/20 Alex Shishkin : > Following code causes error "Operator is not overloaded: "TObject" < > "TObject"" > How to make it work? > > program generictest2; > {$mode objfpc}{$H+} > uses >  fgl; > operator < (a: TObject; b: TObject): boolean; > begin >  result := PtrInt(a) < PtrInt(b); > end; > ty

Re: [fpc-pascal] Moving callbackfunctions to class

2010-12-30 Thread Honza
2010/12/30 Darius Blaszyk : > Though I understand the error, I do not know if there is a way to circumvent > this? I guess: In the callback you have to get the current window id using glutGetWindow, then dispatch the call to the right object instance using that id via some kind of mapping from wind

Re: [fpc-pascal] commutative operators

2010-12-29 Thread Honza
2010/12/29 David Emerson : > On Wed 29 Dec 2010, Honza wrote: >> IIRC you don't have to. > > well... I do have to. I get "can't determine which overloaded function to > call" > because I have a lot of similar-looking functions and := operators You&#

Re: [fpc-pascal] commutative operators

2010-12-29 Thread Honza
2010/12/29 David Emerson : > suppose I define an operator: > > operator + (a: one_type; b: another_type) : one_type; > > Is there any way to specify that it should be "commutative", so I don't have > to > additionally define the reverse: > > operator + (a: another_type; b: one_type) : one_type; II

Re: [fpc-pascal] generics class hierarchy

2010-12-19 Thread Honza
2010/12/19 Sven Barth : > While I DO agree with you (after some thinking about the consequences) that > a base class should not be allowed to be specified by a template parameter > (and this is the way it already is), I don't agree with you that the > documentation states this as clearly as you pro

Re: [fpc-pascal] generics class hierarchy

2010-12-19 Thread Honza
2010/12/19 David Emerson : Please see my just sent reply to Sven. -- bflm freepascal-bits.blogspot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] generics class hierarchy

2010-12-19 Thread Honza
2010/12/19 Sven Barth : >> "There is a single placeholder _T. It will be substituted by a type >> identifier when the generic class is specialized. The identifier _T >> *may not be used for anything else than a placehoder*. " >> > > According to the documentation I'd say that it should succeed, bec

Re: [fpc-pascal] generics class hierarchy

2010-12-18 Thread Honza
2010/12/19 David Emerson : > type >  generic gt_box<_t_point,_num> = class (_t_point)   // FAILS :-( > f_width, f_height : _num; > end; I think it should fail according to the docs, see: http://www.freepascal.org/docs-html/ref/refse42.html "There is a single placeholder _T. It will be substi

Re: [fpc-pascal] Initialize/Finalize with count, is it possible?

2010-11-20 Thread Honza
2010/11/20 Max Vlasov : >     FillChar(Section^, Count*ElementSize, 0); >     Initialize(TNameValueRec(Section^), Count); > > Is possible for such syntax to be supported? Probably I'm one of those rare > developer using it, and maybe because of this I just have to make some patch > by mysel

Re: [fpc-pascal] Widestring Questions

2010-10-25 Thread Honza
2010/10/26 Tobias Giesen : > I think the problem might be that Widestring reference counting is not > thread safe. But it worked fine in FPC 2.2. A bug may show anytime anywhere, but the built in ref counted string types are AFAIK thread safe what concerns the ref count per se. I suspect a subtle

Re: [fpc-pascal] IntList

2010-10-21 Thread Honza
2010/10/19 Brian Winfrey : > Take a look at http://code.google.com/p/fprb/.  I have just perused > it, but it looks pretty good. I'm willing to cooperate (as free time permits) on any required FPRB/heLib review/modification process would any part(s) of the code be considered/adopted by the dev tea

Re: [fpc-pascal] Optimized matrix multiplication functions for pascal?

2010-10-09 Thread Honza
2010/10/9 Bo Berglund : > So I need to get hold of two Delphi functions: > > function matmul(X, Y: array of double): array of double; > and > function transpose(X: array of double): array of double; > > Where can I find such functions? > I am not a matematician myself so I don't know what these > f

Re: [fpc-pascal] TFileStream and stdin - how to make this work?

2010-10-03 Thread Honza
2010/10/3 Bernd Kreuss : > TIOStream seems to work the same way on linux and windows (I tested only > with wine but it worked) ...and it will block. > > It seems I really have to do the receiving of the data in a separate > thread. > > (I wanted to avoid this because the things that must be done af

Re: [fpc-pascal] TFileStream and stdin - how to make this work?

2010-10-03 Thread Honza
2010/10/3 Bernd Kreuss : > this might be a stupid question but I find myself again struggling with > file IO and stdin/stdout. I am trying to do the following: > > StdIn := TFileStream.Create('/dev/stdin', fmOpenRead); > > and later on i want to poll whether there is something to read. I want > to

Re: [fpc-pascal] Build scripts for Freepascal and Lazarus compilation from source

2010-10-03 Thread Honza
2010/10/3 Frank Church : > I have posted an article and some code on some bash scripts I have developed > to install FPC and Lazarus from source at > http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source. > > Any comments and tips are well come.

Re: [fpc-pascal] How to get to Range Check Error location

2010-10-02 Thread Honza
2010/10/2 Juha Manninen (gmail) : Hi Juha, I just tried and can confirm that a LCL app running inside Lazarus (r27491), having turned on range checks is able to perfectly catch and show the place of an range check error (Ubuntu 10.04/AMD64). What I've not tried, but suggest to try, is to open the

Re: [fpc-pascal] Initializing records and other complicated structures

2010-09-27 Thread Honza
2010/9/27 Jim : > Fpc sometimes complains (hints) about local variables not being initialized. > My question: how do I initialize more complicated structures like > records? And should I need to (I'm guessing no in the example below, but > the contents of the record will be undefined - no problem a

Re: [fpc-pascal] Is Delphi7 on Windows to FPC on embedded Linux possible?

2010-09-25 Thread Honza
2010/9/25 Bo Berglund : > So then I found FPC and now I am looking for advice concerning if it would be > possible to use FPC/Lazarus to program for an embedded Linux board with a > graphics LCD screen. I want to be able to do the following: > > 1) Communicate via RS232 to the equipment core to c

Re: [fpc-pascal] Questions regarding arrays

2010-09-23 Thread Honza
2010/9/23 Graeme Geldenhuys : > Out of interest. Do you know if dynamic array elements are in sequence > (storage area in memory) too - like static arrays? So could I do the > same as above, but instead of using a static array, use a dynamic > array, and pass the address of the first element to the

Re: [fpc-pascal] Questions regarding arrays

2010-09-22 Thread Honza
2010/9/22 Graeme Geldenhuys : > type >  TAtomArray = array[0..0] of TAtom; >  PAtomArray = ^TAtomArray; > > Now if I change TAtomArray to the follow, then my code doesn't work. :-) > >  TAtomArray = array of TAtom;   // a dynamic array > > So what exactly is the difference between these two? > >  

Re: [fpc-pascal] Re: What is wrong with this enum and array related code

2010-09-12 Thread Honza
2010/9/12 Frank Church : > Does that mean that although an enum is an ordinal type, an integer cannot > be coerced into using it to index an array? IMO just cast it to the correct type (of the array index) giving the compiler a chance to accept it. -- bflm freepascal-bits.blogspot.com __

[fpc-pascal] Generic B+Trees, Lists and Vectors

2010-09-10 Thread Honza
With tests and documentation. Requires trunk FPC. Download: http://code.google.com/p/fprb/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Generic enumerators

2010-05-10 Thread Honza
Sample code for someone in need of generic containers with generic enumerators (no biz/ads there): http://freepascal-bits.blogspot.com/2010/05/sampler-generic-enumerators-for-generic.html ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:/

Re: [fpc-pascal] String buffer

2010-02-10 Thread Honza
On Tue, 9 Feb 2010 10:45:55 -0300, Fl?vio Etrusco wrote: > Some (hopefully constructive) commentaries (and then I would suggest > to add to LCL or FCL): > 1) It could be called really TStringBuffer; > 2) The 'W' methods could be called 'Append'; > 3) The GetS method could truncate the string to av

[fpc-pascal] String buffer

2010-02-09 Thread Honza
Probably just reinventing the wheel - I was not able to quickly find a String builder/buffer elsewhere. Source code for anyone possible interested is published on a blog (no ads there, so I hope it's OK to post the link): http://freepascal-bits.blogspot.com/2010/02/simple-string-buffer.html -bfl

Re: [fpc-pascal] Generics problem/question

2010-01-14 Thread Honza
Hi all. At Mantis Florian already explained, why it is not possible to provide more information in the error message. Still he meanwhile managed to make it better. I got some time to return to this and now I'm here: 17:11 myn...@tux64:~/fpc/bugreports/20100105$ cat project1.pas program project1;

Re: [fpc-pascal] Generics problem/question

2010-01-08 Thread Honza
Submitted: http://bugs.freepascal.org/view.php?id=15480 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Generics problem/question

2010-01-05 Thread Honza
Hi all, I tried to specialize fgl.TFPGList with some record type and got a compiler error. Am I doing something completely wrong (sorry in that case) or is this a bug? (Ubuntu 9.10, 64 bit) 22:35 myn...@tux64:~/fpc/bugreports/20100105$ cat project1.pas program project1; {$mode objfpc}{$H+}