Re: [fpc-pascal] procedure that accept generic types?

2013-09-04 Thread Sven Barth
Am 04.09.2013 08:18, schrieb Xiangrong Fang: Hi There, I try to write a procedure with generic parameters, but failed: type generic TArray = array of T; procedure ProcessArray(arr: TArray); begin end; The compiler said "Generics without specialization cannot be used..." But if I specializ

Re: [fpc-pascal] procedure that accept generic types?

2013-09-04 Thread Xiangrong Fang
Thanks. This is sort-of too verbose when use. I have no comments about how to define it, but when use it, can we just use: ProcessArray(someintarray); ? The complier should be able to "specialize" it implicitly because it knows someintarray is array of integer? alternatively, how about thi

Re: [fpc-pascal] procedure that accept generic types?

2013-09-04 Thread Sven Barth
Am 04.09.2013 09:13, schrieb Xiangrong Fang: Thanks. This is sort-of too verbose when use. I have no comments about how to define it, but when use it, can we just use: ProcessArray(someintarray); ? No. Generics are specialized with "", so not using it for procedures/functions/methods as wel

Re: [fpc-pascal] procedure that accept generic types?

2013-09-04 Thread Xiangrong Fang
Hi Sven, Not to "debate" the syntax, but just ask :-) 1) in my second example: proc_ints: specialize ProcessArray; it is "specialized". Why this is still not consistent ? 2) in delphi mode, "specialize" is not required anywhere, right? If so, can you write an example of your new proposal in d

Re: [fpc-pascal] procedure that accept generic types?

2013-09-04 Thread Sven Barth
Am 04.09.2013 09:41, schrieb Xiangrong Fang: Hi Sven, Not to "debate" the syntax, but just ask :-) 1) in my second example: proc_ints: specialize ProcessArray; it is "specialized". Why this is still not consistent ? You declared "proc_ints" as a variable and specialized a procedure. That is

Re: [fpc-pascal] IPC - Persistent Objects - Triplestore

2013-09-04 Thread Mattias Gaertner
On Thu, 29 Aug 2013 12:59:52 +0200 Peter Brooks wrote: > Does anybody know the best support in Pascal for an RDF triplestore? Me too. > Is there one written in Pascal? As far as I know: no. > I'm interested in Pascal's interprocess communication (IPC), in particular, > shared memory and sem

Re: [fpc-pascal] PostgreSQL: ERROR: operator does not exists: uuid = text

2013-09-04 Thread Alberto Narduzzi
I am not an expert of PostGres but maybe you are missing the doubled quotes? q.Params.ParamByName('id').AsString := ''71d6776e-1564-11e3-ad65-5349928f15b0''; Cheers, A. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepasc

[fpc-pascal] Runtime error 217 on array of Variant

2013-09-04 Thread Xiangrong Fang
Hi there, I would like to use TVarRec as Variants, after some googling I found this: http://stackoverflow.com/questions/3733640/how-to-convert-between-tvarrec-and-variant However, it generated Runtime error 217. My original code (runs OK) is: 1 program test; 2 {$mode objfpc}{$H+} 3 proce

[fpc-pascal] Re: Runtime error 217 on array of Variant

2013-09-04 Thread Xiangrong Fang
I found the problem myself. You have to add "uses Variants" to eliminate the problem. So now my questions are: 1) why the Variants unit is required? What does it do? 2) is there any performance penalty using Variant than TVarRec? Thanks! 2013/9/5 Xiangrong Fang > Hi there, > > I would lik

Re: [fpc-pascal] Re: Runtime error 217 on array of Variant

2013-09-04 Thread Sven Barth
Am 05.09.2013 06:21 schrieb "Xiangrong Fang" : > > I found the problem myself. You have to add "uses Variants" to eliminate the problem. So now my questions are: > > 1) why the Variants unit is required? What does it do? The Variants unit implements the conversion operators. Normally the unit is

Re: [fpc-pascal] PostgreSQL: ERROR: operator does not exists: uuid = text

2013-09-04 Thread Michael Van Canneyt
On Wed, 4 Sep 2013, silvioprog wrote: Hello, I can't understand how to open a query filtering by a field of type GUID. The error message is below (translated from BR to US): TPQConnection: Preparation of query failed. (PostgreSQL: ERROR: operator does not exist: uuid = text LINE 3: where t1