[fpc-pascal] Is it just me or... trunk cross compile failure on arm-linux

2014-01-08 Thread Reinier Olislagers
Working on my arm-linux cross compiler (which used to at least build a
compiler etc), I currently hit this with fpc trunk:
C:/development/fpctrunk/compiler/ppcrossarm.exe -Tlinux -Parm
-XParm-linux- -Xr -Ur -Xs -O2 -n -Fuarm -Fusystems
-FuC:/development/fpctrunk/rtl/units/arm-linux -Fiarm
-FDC:\development\cross\bin\arm-linux -FE. -FUarm/units/arm-linux
-dRELEASE -XParm-linux- -fPIC -CpARMV6 -CaEABI -CfVFPV2 -dFPC_ARMHF -Xd
-FlC:\development\cross\lib\arm-linux -darm -dGDB -dBROWSERLOG  -Sew
-XParm-linux- -fPIC -CpARMV6 -CaEABI -CfVFPV2 -dFPC_ARMHF   -darm -dGDB
-dBROWSERLOG  -Sew pp.pas
...
C:\development\cross\bin\arm-linux\arm-linux-ld.exe: cannot find
arm\units\arm-linux\pexpr.o
pp.pas(238,36) Error: Error while linking
pp.pas(238,36) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make.exe[3]: *** [ppcarm] Error 1
make.exe[3]: Leaving directory `C:/development/fpctrunk/compiler'

c:\development\fpctrunk\compiler\arm\units\arm-linux\pexpr.o is indeed
missing; pexpr.ppu does exist there.

Am I doing something wrong or is it FPC ;)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] gtree - Freeing a nil Root without error

2014-01-08 Thread Daniel Gaspary
On Wed, Jan 8, 2014 at 3:31 AM, leledumbo leledumbo_c...@yahoo.co.id wrote:
 As in the data structure theory, a tree is just a graph without cycle.
 So I guess it should be made that way. There are a lot of graph and tree
 variations though, so I think I need to take some time to design before
 implementing.

I don't know if the edges information can not be irrelevant and even
an obstacle to better performance in trees.

Anyway, good to know these plans.

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


[fpc-pascal] UTF8 codepage for file in trunk: codepage constant names?

2014-01-08 Thread Reinier Olislagers
First, thanks to all involved in documenting the existing FPC trunk
Unicode situation on the wiki. Exactly the kind of docs I was looking for!

I'm trying to avoid ambiguity for an UTF8 (without BOM) encoded file and
tried this:
{$ifdef fpc}
  //Explicitly specify this is an UTF8 encoded file.
  //Alternative would be UTF8 with BOM but writing UTF8 BOM is bad practice.
  //See
http://wiki.lazarus.freepascal.org/FPC_Unicode_support#String_constants
  {$codepage 65001} //utf8
{$endif fpc}

However, I get
stringtests.pas(5,4) Error: Unknown codepage 65001

Replacing the {$codepage 65001} with
{$codepage UTF8}
does seem to work.

http://wiki.lazarus.freepascal.org/FPC_Unicode_support#Code_page_identifiers
mentions identifiers follow the Windows numbers but obviously you have
to spell out UTF8 at least rather than specifying the number.
Is there a list of these constants somewhere?

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


Re: [fpc-pascal] Is it just me or... trunk cross compile failure on arm-linux

2014-01-08 Thread Pierre Free Pascal


 -Message d'origine-
 De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-
 boun...@lists.freepascal.org] De la part de Reinier Olislagers
 Envoyé : mercredi 8 janvier 2014 13:58
 À : FPC Mailing list
 Objet : [fpc-pascal] Is it just me or... trunk cross compile failure on
 arm-linux
 
 Working on my arm-linux cross compiler (which used to at least build a
 compiler etc), I currently hit this with fpc trunk:
 C:/development/fpctrunk/compiler/ppcrossarm.exe -Tlinux -Parm
 -XParm-linux- -Xr -Ur -Xs -O2 -n -Fuarm -Fusystems
 -FuC:/development/fpctrunk/rtl/units/arm-linux -Fiarm
 -FDC:\development\cross\bin\arm-linux -FE. -FUarm/units/arm-linux
 -dRELEASE -XParm-linux- -fPIC -CpARMV6 -CaEABI -CfVFPV2 -dFPC_ARMHF -Xd
 -FlC:\development\cross\lib\arm-linux -darm -dGDB -dBROWSERLOG  -Sew
 -XParm-linux- -fPIC -CpARMV6 -CaEABI -CfVFPV2 -dFPC_ARMHF   -darm -dGDB
 -dBROWSERLOG  -Sew pp.pas
 ...
 C:\development\cross\bin\arm-linux\arm-linux-ld.exe: cannot find
 arm\units\arm-linux\pexpr.o
 pp.pas(238,36) Error: Error while linking
 pp.pas(238,36) Fatal: There were 1 errors compiling module, stopping
 Fatal: Compilation aborted
 make.exe[3]: *** [ppcarm] Error 1
 make.exe[3]: Leaving directory `C:/development/fpctrunk/compiler'
I just completed a cycle on a native arm linux
using just:
make cycle OPT=-n -gl 
starting with installed 2.6.0 ppcarm for raspberrypi (armhf)
The cycle completed successfully.

-CaEABI fails for me,
now the correct option is -CaEABIHF


I was also able to cycle successfully this:
make distclean cycle OPT=-n -gl -CpARMV6 -CaEABIHF -CfVFPV2 -dFPC_ARMHF

Did you check the obvious, like free disk space?
Try to do 
make distclean 
and restart...

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


Re: [fpc-pascal] Is it just me or... trunk cross compile failure on arm-linux

2014-01-08 Thread Reinier Olislagers
On 08/01/2014 16:40, Pierre Free Pascal wrote:
 -Message d'origine-
 Objet : [fpc-pascal] Is it just me or... trunk cross compile failure on
 arm-linux
 C:\development\cross\bin\arm-linux\arm-linux-ld.exe: cannot find
 arm\units\arm-linux\pexpr.o
 pp.pas(238,36) Error: Error while linking
 I just completed a cycle on a native arm linux
 using just:
 make cycle OPT=-n -gl 
 starting with installed 2.6.0 ppcarm for raspberrypi (armhf)
 The cycle completed successfully.
 
Good to know, thanks.

 -CaEABI fails for me,
 now the correct option dis -CaEABIHF
Mmm, interesting. Seems opposite on trunk. -CaEABI works; -CaEABIHF
fails (I'm using current trunk as a starting compiler)

 I was also able to cycle successfully this:
 make distclean cycle OPT=-n -gl -CpARMV6 -CaEABIHF -CfVFPV2 -dFPC_ARMHF
 
 Did you check the obvious, like free disk space?
More than enough.
Also noticed a lot of other .o files in the arm-linux directory, just
not the pexpr one

 Try to do 
 make distclean 
1. Had previously removed all .ppu, .a, .o, recursively, then did an svn
revert --recursive/svn up
2. make distclean doesn't make a difference

 and restart...
The compiler I hope you mean - not the machine. I mean, I know I'm on
Windows but  ;)

 Pierre Muller

I'll probably try tomorrow with FPC 2.6.2 as a bootstrap compiler...
Will squeak again if needed.

Thanks,
Reinier

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


Re: [fpc-pascal] UTF8 codepage for file in trunk: codepage constant names?

2014-01-08 Thread Jonas Maebe


On 08 Jan 2014, at 15:58, Reinier Olislagers wrote:

I'm trying to avoid ambiguity for an UTF8 (without BOM) encoded file  
and

tried this:
{$ifdef fpc}
 //Explicitly specify this is an UTF8 encoded file.
 //Alternative would be UTF8 with BOM but writing UTF8 BOM is bad  
practice.

 //See
http://wiki.lazarus.freepascal.org/ 
FPC_Unicode_support#String_constants

 {$codepage 65001} //utf8
{$endif fpc}

However, I get
stringtests.pas(5,4) Error: Unknown codepage 65001


The codepage names used by the codepage directive are (unfortunately,  
I guess) unrelated to the code page numbers: http://www.freepascal.org/docs-html/prog/progsu88.html


They are the names of individual codepage units exposed by the charset  
unit, which have names such as cp866 and cp1251. In fact, in general I  
think you can just prefix the code page number with cp (other than  
for utf8, which is built into the compiler and can be accessed via  
utf8 or utf-8).


Note that this codepage functionality has been in FPC since 2.4.x  
already (or maybe 2.6.0). It's not new in any way.



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


Re: [fpc-pascal] Is it just me or... trunk cross compile failure on arm-linux

2014-01-08 Thread Pierre Free Pascal


 -Message d'origine-
 De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-
 boun...@lists.freepascal.org] De la part de Reinier Olislagers
 Envoyé : mercredi 8 janvier 2014 17:05
 À : FPC Mailing list
 Objet : Re: [fpc-pascal] Is it just me or... trunk cross compile
 failure on arm-linux
 
 On 08/01/2014 16:40, Pierre Free Pascal wrote:
  -Message d'origine-
  Objet : [fpc-pascal] Is it just me or... trunk cross compile failure
 on
  arm-linux
  C:\development\cross\bin\arm-linux\arm-linux-ld.exe: cannot find
  arm\units\arm-linux\pexpr.o
  pp.pas(238,36) Error: Error while linking
  I just completed a cycle on a native arm linux
  using just:
  make cycle OPT=-n -gl
  starting with installed 2.6.0 ppcarm for raspberrypi (armhf)
  The cycle completed successfully.
 
 Good to know, thanks.
 
  -CaEABI fails for me,
  now the correct option dis -CaEABIHF
 Mmm, interesting. Seems opposite on trunk. -CaEABI works; -CaEABIHF
 fails (I'm using current trunk as a starting compiler)

 Sorry, in fact, you need to compile the cross-compiler with -dFPC_ARMHF for
this...
without this only -CaEABI works indeed...
 I suppose that this restriction was added to reduce the risks 
of changing ABI and getting failure down the row...

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


Re: [fpc-pascal] Is it just me or... trunk cross compile failure on arm-linux

2014-01-08 Thread Sven Barth
Am 08.01.2014 17:08 schrieb Reinier Olislagers 
reinierolislag...@gmail.com:
 Mmm, interesting. Seems opposite on trunk. -CaEABI works; -CaEABIHF
 fails (I'm using current trunk as a starting compiler)

*sigh* I thought you were one of those who already knows this, but it seems
not: *ALWAYS* compile using the last release as starting compiler. We won't
provide support if a trunk version (be it a non-released fixes or the main
dev one) is used. The only exception is the compilation of a cross compiler
using the exact same revision.
(and yes that even includes if compiling with the last release results in
the same error AMD thus might point to a different problem)

 I'll probably try tomorrow with FPC 2.6.2 as a bootstrap compiler...

You better do that.

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

[fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Jürgen Hestermann

  
  


  
  
  
  

  Today I found
  this type definition in some FreePascal sources:

   
  Type  
Real  =   type Double;

   
  I wondered
  what the second “type” keyword means here (I have never
  seen this before).
  
   
  So I looked
  at 
http://www.freepascal.org/docs-html/ref/refch3.html#refse17.html
   
  where it
  says:
   
  _
  Type declaration
  

___
   
  Although type
  declarations are very fundamental and I am using them 
  since 30 years I can’t find out what this diagram is
  trying to tell me.
  For example, I am missing the
keyword “TYPE” in this syntax diagramm.
   
  I don’t know
  whether the first “type” is the standard type definition
  entry keyword
  but if so it should be typed in bold font.

  It can also
  be part of a text “type declaration” (which is obviously
  not a keyword).
  But then why
  does 
 “type declaration” appear twice (in the heading
  *and* the syntax diagramm)?
  Following the line should generate a valid path to a
  (syntactical) correct type declaration.
  But why is then "type declaration" part of a type
  declaration?
  Makes no sense to me.
  It would generate an endless recursive loop.

   
  Another
  problem is “hint directives”.
  What is it?
  There is no link nor text that explains it.
  So I started
  another google search for “hint directives”
  but I only
  found this: 
http://www.freepascal.org/docs-html/ref/refse5.html
  where it says
  that hint directives are for variable declarations but not
  for type declarations
  (and again "hint directives" are part of hint directives
  which is not correct IMO).
   
  Can someone
  clarify this documentation please?
  Where can I
  find the documentation for my original question about the
  double TYPE keyword?
   

  

  

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

Re: [fpc-pascal] UTF8 codepage for file in trunk: codepage constant names?

2014-01-08 Thread Reinier Olislagers
On 08/01/2014 17:17, Jonas Maebe wrote:
 
 On 08 Jan 2014, at 15:58, Reinier Olislagers wrote:
 
 I'm trying to avoid ambiguity for an UTF8 (without BOM) encoded file and
 tried this:
 {$ifdef fpc}
  //Explicitly specify this is an UTF8 encoded file.
  //Alternative would be UTF8 with BOM but writing UTF8 BOM is bad
 practice.
  //See
 http://wiki.lazarus.freepascal.org/FPC_Unicode_support#String_constants
  {$codepage 65001} //utf8
 {$endif fpc}

 However, I get
 stringtests.pas(5,4) Error: Unknown codepage 65001
 
 The codepage names used by the codepage directive are (unfortunately, I
 guess) unrelated to the code page numbers:
 http://www.freepascal.org/docs-html/prog/progsu88.html
 
 They are the names of individual codepage units exposed by the charset
 unit, which have names such as cp866 and cp1251. In fact, in general I
 think you can just prefix the code page number with cp (other than for
 utf8, which is built into the compiler and can be accessed via utf8 or
 utf-8).
 
 Note that this codepage functionality has been in FPC since 2.4.x
 already (or maybe 2.6.0). It's not new in any way.

Thanks a lot, Jonas.

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


Re: [fpc-pascal] Is it just me or... trunk cross compile failure on arm-linux

2014-01-08 Thread Reinier Olislagers
On 08/01/2014 18:01, Pierre Free Pascal wrote:
 
 
 -Message d'origine-
 De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-
 boun...@lists.freepascal.org] De la part de Reinier Olislagers
 Envoyé : mercredi 8 janvier 2014 17:05
 À : FPC Mailing list
 Objet : Re: [fpc-pascal] Is it just me or... trunk cross compile
 failure on arm-linux

 On 08/01/2014 16:40, Pierre Free Pascal wrote:
 -CaEABI fails for me,
 now the correct option dis -CaEABIHF
 Mmm, interesting. Seems opposite on trunk. -CaEABI works; -CaEABIHF
 fails (I'm using current trunk as a starting compiler)
 
  Sorry, in fact, you need to compile the cross-compiler with -dFPC_ARMHF for
 this...
 without this only -CaEABI works indeed...

Yes, I'm passing -dFPC_ARMHF in crossopt; see my original mail.

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


Re: [fpc-pascal] Is it just me or... trunk cross compile failure on arm-linux

2014-01-08 Thread Reinier Olislagers
On 08/01/2014 19:00, Sven Barth wrote:
 *sigh* I thought you were one of those who already knows this, but it
 seems not: *ALWAYS* compile using the last release as starting compiler.
I do know this and...

 We won't provide support if a trunk version (be it a non-released fixes
 or the main dev one) is used. The only exception is the compilation of a
 cross compiler using the exact same revision.
... I know this, too. That's why I exclude the svn update step for FPC
in my fpcup cross compile settings.

 (and yes that even includes if compiling with the last release results
 in the same error AMD thus might point to a different problem)
Which is one of the reasons I posted this: even with my limited
understanding of the build process, linking etc, I sometimes manage to
bring build problems to light.
Also, often more knowledgeable people are able to immediately pinpoint
my mistakes which is a great help.

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


Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Howard Page-Clark

On 08/01/2014 18:16, Jürgen Hestermann wrote:


Today I found this type definition in some FreePascal sources:

TypeReal =type Double;

I wondered what the second “type” keyword means here (I have never seen
this before).


You are being rather obtuse.
Ignore the diagrams in the docs if they don't help you.

The double use of type here simply means that the Real type is being 
defined as an alias for double. The two type identifiers now mean 
exactly the same thing as the = indicates.


The documentation for hint directives gives three clear and explicit 
examples of different hint directives showing how to declare them and 
the compiler-generated hints that result from their use.


What more do you want?

Howard



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


Re: [fpc-pascal] Is it just me or... trunk cross compile failure on arm-linux

2014-01-08 Thread Florian Klämpfl




Reinier Olislagers reinierolislag...@gmail.com schrieb:
On 08/01/2014 18:01, Pierre Free Pascal wrote:
 
 
 -Message d'origine-
 De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-
 boun...@lists.freepascal.org] De la part de Reinier Olislagers
 Envoyé : mercredi 8 janvier 2014 17:05
 À : FPC Mailing list
 Objet : Re: [fpc-pascal] Is it just me or... trunk cross compile
 failure on arm-linux

 On 08/01/2014 16:40, Pierre Free Pascal wrote:
 -CaEABI fails for me,
 now the correct option dis -CaEABIHF
 Mmm, interesting. Seems opposite on trunk. -CaEABI works; -CaEABIHF
 fails (I'm using current trunk as a starting compiler)
 
  Sorry, in fact, you need to compile the cross-compiler with
-dFPC_ARMHF for
 this...
 without this only -CaEABI works indeed...

Yes, I'm passing -dFPC_ARMHF in crossopt; see my original mail.

This is wrong. You have to pass FPC_ARMHF when the ARM compiler is built 
because armhf is considered as separate architecture. - Cparmv6 must be passed 
to  CROSSOPT though. Nothing else is needed except when you have some strange 
setup. 


___
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] Documentation, syntax diagrams

2014-01-08 Thread Sven Barth

On 08.01.2014 19:40, Howard Page-Clark wrote:

On 08/01/2014 18:16, Jürgen Hestermann wrote:


Today I found this type definition in some FreePascal sources:

TypeReal =type Double;

I wondered what the second “type” keyword means here (I have never seen
this before).


You are being rather obtuse.
Ignore the diagrams in the docs if they don't help you.

The double use of type here simply means that the Real type is being
defined as an alias for double. The two type identifiers now mean
exactly the same thing as the = indicates.


No, an alias would be

=== code begin ===

type
  Real = Double;

=== code end ===

Using the type behind the = tells the compiler to declare a new type 
based on the right side. So a Double and a Real are not assignment 
compatible and can have different sets of operator overloads.


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


Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Sven Barth

On 08.01.2014 19:16, Jürgen Hestermann wrote:


Today I found this type definition in some FreePascal sources:

TypeReal =type Double;

I wondered what the second “type” keyword means here (I have never seen
this before).


So I looked at
http://www.freepascal.org/docs-html/ref/refch3.html#refse17.html

where it says:

_
Type declaration

-- - - - -|-- --- type declaration identifier =
type |- --|; hint directives
___

Although type declarations are very fundamental and I am using them
since 30 years I can’t find out what this diagram is trying to tell me.

For example, I am missing the keyword “TYPE” in this syntax diagramm.


You are right. That seems to be missing.



I don’t know whether the first “type” is the standard type definition
entry keyword
but if so it should be typed in bold font.


No, it's not the keyword, it's a reference to the syntax diagram named 
type directly below it (though I have to admit that this is not 
necessarily clear...).




It can also be part of a text “type declaration” (which is obviously not
a keyword).

But then why does “type declaration” appear twice (in the heading
**and** the syntax diagramm)?
Following the line should generate a valid path to a (syntactical)
correct type declaration.
But why is then type declaration part of a type declaration?
Makes no sense to me.
It would generate an endless recursive loop.

Another problem is “hint directives”.

What is it? There is no link nor text that explains it.

So I started another google search for “hint directives”

but I only found this:
http://www.freepascal.org/docs-html/ref/refse5.html
http://www.freepascal.org/docs-html/ref/refse5.html

where it says that hint directives are for variable declarations but not
for type declarations


Yes, this is indeed the correct documentation and maybe this should be 
linked better...



(and again hint directives are part of hint directives which is not
correct IMO).


The hint directives is again the name of the syntax diagram.



Can someone clarify this documentation please?

Where can I find the documentation for my original question about the
double TYPE keyword?


This link explains it a bit: 
http://docwiki.embarcadero.com/RADStudio/XE5/en/Type_Compatibility_and_Identity


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


Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Howard Page-Clark

On 08/01/2014 20:01, Sven Barth wrote:

On 08.01.2014 19:40, Howard Page-Clark wrote:

On 08/01/2014 18:16, Jürgen Hestermann wrote:


Today I found this type definition in some FreePascal sources:

TypeReal =type Double;

I wondered what the second “type” keyword means here (I have never seen
this before).


You are being rather obtuse.
Ignore the diagrams in the docs if they don't help you.

The double use of type here simply means that the Real type is being
defined as an alias for double. The two type identifiers now mean
exactly the same thing as the = indicates.


No, an alias would be

=== code begin ===

type
   Real = Double;

=== code end ===

Using the type behind the = tells the compiler to declare a new type
based on the right side. So a Double and a Real are not assignment
compatible and can have different sets of operator overloads.


Thanks for the clarification. That is a distinction worth drawing 
attention to in the documentation, and its relevance when writing 
overloaded routines.

Looks like the obtuseness is at this end, as well as at Jürgen's.

Howard

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


Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Michael Van Canneyt



On Wed, 8 Jan 2014, Jürgen Hestermann wrote:



Today I found this type definition in some FreePascal sources:

TypeReal =type Double;

I wondered what the second “type” keyword means here (I have never seen this 
before).



So I looked at 
http://www.freepascal.org/docs-html/ref/refch3.html#refse17.html


where it says:

_
Type declaration

-- - - - -|-- --- type declaration identifier = type 
|- --|; hint directives

___

Although type declarations are very fundamental and I am using them
since 30 years I can’t find out what this diagram is trying to tell me.

For example, I am missing the keyword “TYPE” in this syntax diagramm.


That is right, since it is not the diagram for the type declaration block, 
which appears later in the manual.


However, following your remark I have done some reworking of this part. 
I have referred to the diagram of the type declaration block, and I have 
moved the type alias description to a separate section which explains the 
difference between the 2 concepts:


Type
  MyInteger = Integer;

and
  MyInteger = Type Integer;

You can preview the result at

http://www.freepascal.org/~michael/ref/refch3.html

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

Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Michael Van Canneyt



On Wed, 8 Jan 2014, Howard Page-Clark wrote:


On 08/01/2014 20:01, Sven Barth wrote:

On 08.01.2014 19:40, Howard Page-Clark wrote:

On 08/01/2014 18:16, Jürgen Hestermann wrote:


Today I found this type definition in some FreePascal sources:

TypeReal =type Double;

I wondered what the second “type” keyword means here (I have never seen
this before).


You are being rather obtuse.
Ignore the diagrams in the docs if they don't help you.

The double use of type here simply means that the Real type is being
defined as an alias for double. The two type identifiers now mean
exactly the same thing as the = indicates.


No, an alias would be

=== code begin ===

type
   Real = Double;

=== code end ===

Using the type behind the = tells the compiler to declare a new type
based on the right side. So a Double and a Real are not assignment
compatible and can have different sets of operator overloads.


That is not quite correct.

They ARE assignment compatible, but can indeed have different sets of overloads.

As in the following example:

home: ./ta
Different types
home: cat ta.pp

Type
  TA = Integer;
  TB = Type TA;

Var
  A : TA;
  B : TB;

begin
  B:=1;
  A:=B;
  if TypeInfo(TA)TypeInfo(TB) then
Writeln('Different types');
end.

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

Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Jürgen Hestermann

Am 08.01.2014 21:01, schrieb Sven Barth:
 No, an alias would be
 === code begin ===
 type
   Real = Double;
 === code end ===
 Using the type behind the = tells the compiler to declare a new 
type based on the right side.
 So a Double and a Real are not assignment compatible and can have 
different sets of operator overloads.


Thanks for the answer.
I already suspected such a definition.

But why is it not part of the documentation?
If nobody takes care of the documentation anymore
then it should better be removed at all.
IMO the current documentation is very bad and outdated.
Not very inviting for potentially interested programmers.
Without a reliable documentation all programming is just guessing
and hoping and trial and error.

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


Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Michael Van Canneyt



On Wed, 8 Jan 2014, Jürgen Hestermann wrote:


Am 08.01.2014 21:01, schrieb Sven Barth:

No, an alias would be
=== code begin ===
type
  Real = Double;
=== code end ===
Using the type behind the = tells the compiler to declare a new type 

based on the right side.
So a Double and a Real are not assignment compatible and can have 

different sets of operator overloads.

Thanks for the answer.
I already suspected such a definition.

But why is it not part of the documentation?
If nobody takes care of the documentation anymore
then it should better be removed at all.


I am well aware that documentation needs updating. 
The SVN logs will convince you that it is updated on a regular basis.


I usually respond positively to all requests for updates, as my other reply 
proves.

That is, provided they are put in a positive form, and not with a dosis of 
poison as you just provided.

If you insist on being negative, please find another mailing list to do so.

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

Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Sven Barth
Am 08.01.2014 22:11 schrieb Jürgen Hestermann juergen.hesterm...@gmx.de:
 But why is it not part of the documentation?

We are all just human beings that make mistakes. Nobody is perfect and so
is the documentation.

 If nobody takes care of the documentation anymore
 then it should better be removed at all.

It's actively maintained on Subversion...

 IMO the current documentation is very bad and outdated.

... but only publicly updated on each release.

 Without a reliable documentation all programming is just guessing
 and hoping and trial and error.

Then please continue to point out inconsistencies and unclear parts so that
the documentation can be improved. But please do so - as Michael suggested
as well - without this bah, there's a problem, so it's crap-attitude. We
are all working on this during our free time afterall...

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

[fpc-pascal] OT Turbo Pascal REAL type WAS: Documentation, syntax diagrams

2014-01-08 Thread johanns

On Wed, Jan 08, 2014 at 09:01:34PM +0100, Sven Barth wrote:

On 08.01.2014 19:40, Howard Page-Clark wrote:

On 08/01/2014 18:16, Jürgen Hestermann wrote:


Today I found this type definition in some FreePascal sources:

TypeReal =type Double;

I wondered what the second “type” keyword means here (I have never seen
this before).


You are being rather obtuse.
Ignore the diagrams in the docs if they don't help you.

The double use of type here simply means that the Real type is being
defined as an alias for double. The two type identifiers now mean
exactly the same thing as the = indicates.


No, an alias would be

=== code begin ===
type
 Real = Double;
=== code end ===

Using the type behind the = tells the compiler to declare a new 
type based on the right side. So a Double and a Real are not 
assignment compatible and can have different sets of operator 
overloads.


Is there any way to get support in Free Pascal for the 
old six byte REAL type that was provided by the old 
Borland DOS Turbo Pascal compilers?  There was support for 
the six byte REAL in the old Virtual Pascal compiler, so I 
wondered if there is some obscure unit that can be enabled 
to turn on legacy support for it.


I do understand that a DOUBLE is larger than a six byte 
REAL, so support for the old type is only meaningful when 
reading a typed file of records that include this outdated 
data type.  Some old code here uses the old type REAL 
extensively, even for large whole number values to avoid 
using the signed 32-bit integer type, LONGINT.


I know the documentation does not mention the six byte 
REAL type.  I wondered if there is any support for it.


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

Re: [fpc-pascal] OT Turbo Pascal REAL type WAS: Documentation, syntax diagrams

2014-01-08 Thread Jonas Maebe

On 09 Jan 2014, at 00:17, joha...@nacs.net wrote:

 Is there any way to get support in Free Pascal for the old six byte REAL type 
 that was provided by the old Borland DOS Turbo Pascal compilers?

The only support we have is a routine to convert a TP-style real to double: 
http://www.freepascal.org/docs-html/rtl/system/real2double.html


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


Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Sven Barth

On 09.01.2014 07:22, Jürgen Hestermann wrote:

  Where can I find the documentation for my original question about
the double TYPE keyword?
  This link explains it a bit:
http://docwiki.embarcadero.com/RADStudio/XE5/en/Type_Compatibility_and_Identity


But that's not part of the Free Pascal documentation.
So it's not available in the documentation of Free Pascal?


Didn't I just write that it is indeed still missing?! (though Michael 
seems to have fixed it in the SVN sources, so this fix will (maybe?) be 
part of the 2.6.4 documentation)



Who can know when he has to look at the Delphi
documentation (which version?) and when this differs from Free Pascal?


You shouldn't need to look at the Delphi documentation. It's just that I 
wanted to answer your question with a source. If I the feature would 
have been available in TP and the syntax would be available I would have 
linked that. Or the ISO specification or whatever. This has nothing to 
do with this is found in FPC's documentation so you need to look 
somewhere else, but I simply digged out a link were this feature is 
described.


And to come back to the first sentence of the paragraph: and this is 
where you come into play: by raising such questions you can help improve 
the documentation.


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


Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Michael Van Canneyt



On Thu, 9 Jan 2014, Jürgen Hestermann wrote:


Am 2014-01-08 21:12, schrieb Sven Barth:

I don’t know whether the first 'type' is the standard type definition
entry keyword but if so it should be typed in bold font.

No, it's not the keyword, it's a reference to the syntax diagram named
type directly below it (though I have to admit that this is not 

necessarily clear...).

It seems that all syntax diagrams have the same issue:

That what should be declared is repeated in the declaration
itself which makes no sense to me.
A syntax diagram for 'type declaration' (which is written in the heading 
already)


The heading is a caption.

In typesetting, normally that is not considered part of the diagram itself, 
just like a table or figure caption is not considered part of the table or 
figure.


Where can I find the documentation for my original question about the 

double TYPE keyword?
This link explains it a bit: 

http://docwiki.embarcadero.com/RADStudio/XE5/en/Type_Compatibility_and_Identity

But that's not part of the Free Pascal documentation.
So it's not available in the documentation of Free Pascal?


As Sven surmised, it will be in the next version. 
I posted a preview for your benefit, please see my initial answer.


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

Re: [fpc-pascal] Documentation, syntax diagrams

2014-01-08 Thread Sven Barth

Am 08.01.2014 22:01, schrieb Michael Van Canneyt:

You can preview the result at

http://www.freepascal.org/~michael/ref/refch3.html
You might additionally mention that these type aliases also allow 
different operator and (AFAIK also) function overloads.


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