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

2013-01-21 Thread Honza
2013/1/20 Paul Ishenin paul.ishe...@gmail.com: 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 juha.mannine...@gmail.com 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

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

2012-05-03 Thread Honza
Dne 3.5.2012 9:11 Koenraad Lelong fpas...@brouwerij.homelinux.net 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 ___

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. tFpGMaptObject 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 mar...@stack.nl: 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 if

[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:

[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

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

2011-12-11 Thread Honza
2011/12/11 Marco van de Voort mar...@stack.nl: 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. Since 2.6.0 might arrive

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

2011-07-31 Thread Honza
2011/7/28 Bernd prof7...@googlemail.com: ¹ 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

Re: [fpc-pascal] fgl.TFPGMap

2011-01-20 Thread Honza
2011/1/20 Alex Shishkin alexv...@mail.ru: 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; type  

Re: [fpc-pascal] fgl.TFPGMap

2011-01-20 Thread Honza
2011/1/20 Alex Shishkin alexv...@mail.ru: 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

Re: [fpc-pascal] Moving callbackfunctions to class

2010-12-30 Thread Honza
2010/12/30 Darius Blaszyk dhkblas...@zeelandnet.nl: 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

Re: [fpc-pascal] commutative operators

2010-12-29 Thread Honza
2010/12/29 David Emerson dle...@angelbase.com: 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) :

Re: [fpc-pascal] commutative operators

2010-12-29 Thread Honza
2010/12/29 David Emerson dle...@angelbase.com: 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 right, I verified it just now. I

Re: [fpc-pascal] generics class hierarchy

2010-12-19 Thread Honza
2010/12/19 Sven Barth pascaldra...@googlemail.com: 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

Re: [fpc-pascal] generics class hierarchy

2010-12-19 Thread Honza
2010/12/19 David Emerson dle...@angelbase.com: 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 pascaldra...@googlemail.com: 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

Re: [fpc-pascal] generics class hierarchy

2010-12-18 Thread Honza
2010/12/19 David Emerson dle...@angelbase.com: 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

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

2010-11-20 Thread Honza
2010/11/20 Max Vlasov max.vla...@gmail.com:     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

Re: [fpc-pascal] Widestring Questions

2010-10-25 Thread Honza
2010/10/26 Tobias Giesen tobias_subscri...@tgtools.com: 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

Re: [fpc-pascal] IntList

2010-10-21 Thread Honza
2010/10/19 Brian Winfrey bwcod...@gmail.com: 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

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

2010-10-09 Thread Honza
2010/10/9 Bo Berglund bo.bergl...@gmail.com: 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

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

2010-10-03 Thread Honza
2010/10/3 Frank Church vfcli...@gmail.com: 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

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

2010-10-03 Thread Honza
2010/10/3 Bernd Kreuss prof7...@googlemail.com: 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

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

2010-10-03 Thread Honza
2010/10/3 Bernd Kreuss prof7...@googlemail.com: 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

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

2010-10-02 Thread Honza
2010/10/2 Juha Manninen (gmail) juha.mannine...@gmail.com: 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

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

2010-09-27 Thread Honza
2010/9/27 Jim hakki...@gmail.com: 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

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

2010-09-25 Thread Honza
2010/9/25 Bo Berglund bo.bergl...@gmail.com: 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

Re: [fpc-pascal] Questions regarding arrays

2010-09-23 Thread Honza
2010/9/23 Graeme Geldenhuys graemeg.li...@gmail.com: 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

Re: [fpc-pascal] Questions regarding arrays

2010-09-22 Thread Honza
2010/9/22 Graeme Geldenhuys graemeg.li...@gmail.com: 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

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

2010-09-12 Thread Honza
2010/9/12 Frank Church vfcli...@gmail.com: 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

[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

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 avoid

[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

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