Re: [fpc-pascal] Double specialization of generic class

2014-04-15 Thread Xiangrong Fang
Hi Sven,

I am using fpc 2.6.2.  I am very sorry that I don't have time to compile
and install 2.7.1 at this time.

It's good to know that it works, at least in 2.7.1.   I will report the
problem again while I start using 2.7.1 or when it is released as 2.8 :-)

For now, another suggestion regarding this error is the error message it
gave out, which is not understandable (error -139), I only find out the
cause of this by comparing my source code in git.

I hope this is also improved in 2.7 or later.

Thanks!
Shannon


2014-04-15 13:34 GMT+08:00 Sven Barth pascaldra...@googlemail.com:

 On 15.04.2014 03:51, Xiangrong Fang wrote:

 Hi,

 I got strange ppcx64 error: -139, which I found is caused by this:

 type
TNodeStack = specialize TVectorTNodeHash;

 where TNodeHash itself is a specialization:

 type
PNode = ^TNode; //TNode is a plain record
TNodeHash = specialize TTreapInteger, PNode;

 Is it true that specialization of a generic class using another
 specialized generic class is not allowed?


 No, that should work. Maybe some bug. Is there any error message? Could
 you present the full compiler output, please? You are using 2.7.1, right?

 Regards,
 Sven

 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Double specialization of generic class

2014-04-15 Thread Sven Barth
Am 15.04.2014 08:47 schrieb Xiangrong Fang xrf...@gmail.com:
 It's good to know that it works, at least in 2.7.1.   I will report the
problem again while I start using 2.7.1 or when it is released as 2.8 :-)

That's the point: I don't know wether it compiles in 2.7.1 as I did not
test it. If you could provide a minimal sample (which fails in 2.6.2) and
report that as a bug I could ensure that 2.7.1 works correctly there.


 For now, another suggestion regarding this error is the error message it
gave out, which is not understandable (error -139), I only find out the
cause of this by comparing my source code in git.

No other message? Did you check the -v options that errors are really
printed? Do you compile using Lazarus or on command line? If the former
then try the latter please or do a right click on the message window and
select copy all visible and hidden messages to clipboard (or so) and
paste that somewhere else to see wether Lazarus hid any messages.


 I hope this is also improved in 2.7 or later.

Normally there should either be an error message (at least compilation
aborted) or if it's a crash a stackstrace...

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Double specialization of generic class

2014-04-15 Thread Xiangrong Fang
2014-04-15 17:21 GMT+08:00 Sven Barth pascaldra...@googlemail.com:

 Am 15.04.2014 08:47 schrieb Xiangrong Fang xrf...@gmail.com:
   It's good to know that it works, at least in 2.7.1.   I will report the
 problem again while I start using 2.7.1 or when it is released as 2.8 :-)

 That's the point: I don't know wether it compiles in 2.7.1 as I did not
 test it. If you could provide a minimal sample (which fails in 2.6.2) and
 report that as a bug I could ensure that 2.7.1 works correctly there.


​I cannot replicate the problem using a minimal program, because it gives
out different error message.  The following minimal program compiles OK:

program vectr;
type
  generic TGeneric1T = class

  end;
  generic TGeneric2T = class

  end;
  TSpec1 = specialize TGeneric1Integer;
  TSpec2 = specialize TGeneric2TSpec1;
begin
end.

While the following program generate different error:

program vectr;
uses
  treap, vector;
type
  TNodeHash = specialize TTreapInteger, string;
  TNodeVector = class(specialize TVectorTNodeHash)
  protected
function OnSort(v1, v2: T): Integer; override;
  end;

operator (nh1, nh2: TNodeHash): Boolean;
begin
  Result := nh1.Count  nh2.Count;
end;
operator (nh1, nh2: TNodeHash): Boolean;
begin
  Result := nh1.Count  nh2.Count;
end;

function TNodeVector.OnSort(v1, v2: T): Integer;
begin
  Result := 0;
end;

begin
end.​

gives error message:

vector.pas(149,9) Error: Operator is not overloaded:
TTreap$LongInt$AnsiString  TTreap$LongInt$AnsiString
vector.pas(151,14) Error: Operator is not overloaded:
TTreap$LongInt$AnsiString  TTreap$LongInt$AnsiString
vectr.lpr(28) Fatal: There were 2 errors compiling module, stopping

The two used units can be downloaded here:

https://github.com/xrfang/fpcollection/

While in my real program, I have this:

type
  TCmhWaves = specialize TVectorTCmhWave;

The thing is, even if I do NOT use this definition at all, it still crashes
the compiler.  By crash I mean I get this from lazarus:

Compiling wmodel.lError: /usr/bin/ppcx64 can't be executed, error message:
Failed to execute /usr/bin/ppcx64, error code: -139

TCmhWave is a specialized subclass of My TTreap class (also on github), it
does NOT overload the  and  operators either.

So my question is:

1) why my simplified example still require overloaded operator, although I
have already done so?

2) If this is the cause of error (TCmhWave does not have these operators
defined), why the compiler returns error code: -139 instead of more
detailed errors?

BTW, on my first attempt to debug this problem in lazbuild (command line) I
get some error related to VMA, but unfortunately I forgot what it is and
cannot get it shown again. Is there any way to customize the lazbuild by
some switches to let it output more messages?

Thanks.
xrfang@OP380:~/Sync/wmodel$ lazbuild wmodel.lpi
primary config path: /home/xrfang/.lazarus
TPkgManager.CheckCompileNeedDueToDependencies  State file of LCL 1.2.0.3 is 
newer than state file of Package: cairocanvas_pkg 0.0
TLazPackageGraph.CheckIfPackageNeedsCompilation normal output dir is not 
writable: /usr/share/lazarus/1.2.0/components/cairocanvas/lib/x86_64-linux/gtk2/
TLazPackageGraph.GetFallbackOutputDir  cairocanvas_pkg: 
/home/xrfang/.lazarus/lib/cairocanvas_pkg/lib/x86_64-linux/gtk2
TParsedCompilerOptions.SetOutputDirectoryOverride 
New=/home/xrfang/.lazarus/lib/cairocanvas_pkg/lib/x86_64-linux/gtk2
TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile  Compiler params changed for 
Printer4Lazarus 0.5
  Old= -MObjFPC -Scgi -O1 -g -gl -vewnhi 
-Fi/usr/share/lazarus/1.2.0/components/printers/unix 
-Fi/usr/share/lazarus/1.2.0/components/printers/win32 
-Fi/usr/share/lazarus/1.2.0/components/printers/carbon 
-Fi/usr/share/lazarus/1.2.0/components/printers/qt 
-Fu/usr/share/lazarus/1.2.0/components/printers/unix 
-Fu/usr/share/lazarus/1.2.0/components/printers/win32 
-Fu/usr/share/lazarus/1.2.0/components/printers/carbon 
-Fu/usr/share/lazarus/1.2.0/components/printers/qt 
-Fu/usr/share/lazarus/1.2.0/packager/units/x86_64-linux 
-Fu/usr/share/lazarus/1.2.0/components/lazutils/lib/x86_64-linux 
-Fu/usr/share/lazarus/1.2.0/lcl/units/x86_64-linux 
-Fu/usr/share/lazarus/1.2.0/lcl/units/x86_64-linux/gtk2 
-Fu/usr/share/lazarus/1.2.0/components/cairocanvas/lib/x86_64-linux/gtk2 
-Fu/usr/share/lazarus/1.2.0/components/printers/ 
-FU/usr/share/lazarus/1.2.0/components/printers/lib/x86_64-linux/gtk2/ -l -dLCL 
-dLCLgtk2 -dUseCache -dNativePrint -dUSEUNICODE printer4lazarus.pas
  Now= -MObjFPC -Scgi -O1 -g -gl -vewnhi 
-Fi/usr/share/lazarus/1.2.0/components/printers/unix 
-Fi/usr/share/lazarus/1.2.0/components/printers/win32 
-Fi/usr/share/lazarus/1.2.0/components/printers/carbon 
-Fi/usr/share/lazarus/1.2.0/components/printers/qt 
-Fu/usr/share/lazarus/1.2.0/components/printers/unix 
-Fu/usr/share/lazarus/1.2.0/components/printers/win32 
-Fu/usr/share/lazarus/1.2.0/components/printers/carbon 
-Fu/usr/share/lazarus/1.2.0/components/printers/qt 

Re: [fpc-pascal] Double specialization of generic class

2014-04-15 Thread Sven Barth
Am 15.04.2014 11:52 schrieb Xiangrong Fang xrf...@gmail.com:
 While the following program generate different error:

 program vectr;
 uses
   treap, vector;
 type
   TNodeHash = specialize TTreapInteger, string;
   TNodeVector = class(specialize TVectorTNodeHash)
   protected
 function OnSort(v1, v2: T): Integer; override;
   end;

 operator (nh1, nh2: TNodeHash): Boolean;
 begin
   Result := nh1.Count  nh2.Count;
 end;
 operator (nh1, nh2: TNodeHash): Boolean;
 begin
   Result := nh1.Count  nh2.Count;
 end;

 function TNodeVector.OnSort(v1, v2: T): Integer;
 begin
   Result := 0;
 end;

 begin
 end.​

 gives error message:

 vector.pas(149,9) Error: Operator is not overloaded:
TTreap$LongInt$AnsiString  TTreap$LongInt$AnsiString
 vector.pas(151,14) Error: Operator is not overloaded:
TTreap$LongInt$AnsiString  TTreap$LongInt$AnsiString
 vectr.lpr(28) Fatal: There were 2 errors compiling module, stopping

Operator overloads must be available in the scope the generic type was
*declared* in, not the scope it is *specialized* in. Currently this is only
possible by using records that contain operator overloads (class
operator) and using those to specialize the generic. So you'll need to
create a container record that contains your TTreap specialization
TNodeHash and the operator overloads for  and  and specialize TVector
with that.

I have an idea to improve this situation for non-Delphi mode generics, but
that wouldn't help you with 2.6.x ;)

 While in my real program, I have this:

 type
   TCmhWaves = specialize TVectorTCmhWave;

 The thing is, even if I do NOT use this definition at all, it still
crashes the compiler.  By crash I mean I get this from lazarus:

 Compiling wmodel.lError: /usr/bin/ppcx64 can't be executed, error
message: Failed to execute /usr/bin/ppcx64, error code: -139

Is there really a ppcx64 in /usr/bin? And is it really executable? (try
/usr/bin/ppcx64 -i in a shell) Also check you Lazarus settings that
you've setup the correct fpc binary and that you project's target
settings are set to the correct platform (maybe you are trying to compile
for x86_64 without having a x84_64 compiler installed).

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] SourceForge April 2014 Project of the Month: Free Pascal

2014-04-15 Thread João Marcelo Vaz
Congratulations, FreePascal!

http://sourceforge.net/blog/april-2014-project-of-the-month-free-pascal

-- 
João Marcelo
http://blog.caixadepandora.com/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] SourceForge April 2014 Project of the Month: Free Pascal

2014-04-15 Thread Marcos Douglas
On Tue, Apr 15, 2014 at 9:43 AM, João Marcelo Vaz jms...@gmail.com wrote:

 Congratulations, FreePascal!

 http://sourceforge.net/blog/april-2014-project-of-the-month-free-pascal

Congratulations!

Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Double specialization of generic class

2014-04-15 Thread Xiangrong Fang
2014-04-15 20:26 GMT+08:00 Sven Barth pascaldra...@googlemail.com:

  Compiling wmodel.lError: /usr/bin/ppcx64 can't be executed, error
 message: Failed to execute /usr/bin/ppcx64, error code: -139

 Is there really a ppcx64 in /usr/bin? And is it really executable? (try
 /usr/bin/ppcx64 -i in a shell) Also check you Lazarus settings that
 you've setup the correct fpc binary and that you project's target
 settings are set to the correct platform (maybe you are trying to compile
 for x86_64 without having a x84_64 compiler installed).

​No problem with the executable. I run it from command line, which is ok.
i.e. ppcx64 is not corrupted, nor there is any authorization problem.
Also, if I remove the unused declaration, the error is gone.​

Doesn't -139 have any meaning to you?

Regards,
Xiangrong
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] SourceForge April 2014 Project of the Month: Free Pascal

2014-04-15 Thread Andreas Schneider

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 15.04.2014 14:43, João Marcelo Vaz wrote:
 Congratulations, FreePascal!

 http://sourceforge.net/blog/april-2014-project-of-the-month-free-pascal
I just saw that news too in the SourceForge newsletter :-) That's really
awesome!

Hopefully this pushes FreePascal further. It's such a great compiler and
platform to work with.

Thanks to all developers and contributors for offering us such a
fantastic toolset (especially Lazarus is outstanding in regards to RAD
GUI development).

Thanks!!

- -- 
Best Regards,
Andreas
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlNNb6YACgkQIxziJkiYZxEcXgD/R9urZy/M04idzZ5nzewBJpEb
/dg6GbsewX08RVZ6IdUA/0Ql3j36hUnxk809cWLXZuwV3e0pv7WwjH7l4IR3wAbH
=kj/y
-END PGP SIGNATURE-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] SourceForge April 2014 Project of the Month: Free Pascal

2014-04-15 Thread duilio foschi
congratulations!


2014-04-15 19:43 GMT+02:00 Andreas Schneider ak...@gmx.de:


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 On 15.04.2014 14:43, João Marcelo Vaz wrote:
  Congratulations, FreePascal!
 
  http://sourceforge.net/blog/april-2014-project-of-the-month-free-pascal
 I just saw that news too in the SourceForge newsletter :-) That's really
 awesome!

 Hopefully this pushes FreePascal further. It's such a great compiler and
 platform to work with.

 Thanks to all developers and contributors for offering us such a
 fantastic toolset (especially Lazarus is outstanding in regards to RAD
 GUI development).

 Thanks!!

 - --
 Best Regards,
 Andreas
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2.0.22 (GNU/Linux)
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iF4EAREIAAYFAlNNb6YACgkQIxziJkiYZxEcXgD/R9urZy/M04idzZ5nzewBJpEb
 /dg6GbsewX08RVZ6IdUA/0Ql3j36hUnxk809cWLXZuwV3e0pv7WwjH7l4IR3wAbH
 =kj/y
 -END PGP SIGNATURE-

 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Just a question about OAuth 2.0 implementation

2014-04-15 Thread Dariusz Mazur

On 2014-04-14 23:27, silvioprog wrote:
2014-04-14 17:52 GMT-03:00 Dariusz Mazur dar...@emadar.com 
mailto:dar...@emadar.com:

[...]

I does one.
If You interested I public it on github.


I'm interested! :)


https://github.com/darekm/openid4fpc

Darek

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal