Hi There,
I try to write a procedure with generic parameters, but failed:
type
generic TArrayT = array of T;
procedure ProcessArray(arr: TArrayT);
begin
end;
The compiler said Generics without specialization cannot be used...
But if I specialize the parameter then this procedure is
Am 04.09.2013 08:18, schrieb Xiangrong Fang:
Hi There,
I try to write a procedure with generic parameters, but failed:
type
generic TArrayT = array of T;
procedure ProcessArray(arr: TArrayT);
begin
end;
The compiler said Generics without specialization cannot be used...
But if I
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
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 SomeType, so not using it for
procedures/functions/methods
Hi Sven,
Not to debate the syntax, but just ask :-)
1) in my second example: proc_ints: specialize ProcessArrayLongInt; 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
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 ProcessArrayLongInt;
it is specialized. Why this is still not consistent ?
You declared proc_ints as a variable and specialized a procedure. That
On Thu, 29 Aug 2013 12:59:52 +0200
Peter Brooks peter.h.m.bro...@gmail.com 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,
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
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
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 xrf...@gmail.com
Hi there,
Am 05.09.2013 06:21 schrieb Xiangrong Fang xrf...@gmail.com:
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
11 matches
Mail list logo