[fpc-pascal] Extending an enumeration

2012-12-28 Thread Mark Morgan Lloyd
Is it possible to extend an enumeration, while preserving strong type checking? In other words, given existing code like typeTUpstreamServerCapabilitiesBase= (uscConnected, uscCanIssueGUID); TLocalServerCapabilitiesBase= (lscConnected, lscCanIssueGUID, lscIsFirebird); TUps

Re: [fpc-pascal] Extending an enumeration

2012-12-28 Thread JC Chu
It is not possible to extend an enumeration type. If you are not willing to use separate sets to hold common and extended elements, you can use a generic (not parametric) set type, say SET OF 0..31, that can hold all possible elements, and define the possible elements as constants. On Fri, Dec 28

Re: [fpc-pascal] Basically on the right track?

2012-12-28 Thread Sven Barth
On 27.12.2012 17:11, Patrick wrote: > >> This is exactly what I thought. You are trying to use the GTK1 unit. >> The unit for GTK+ is called "gtk2". Take a look into "packages/gtk" >> and "packages/gtk2" of a Free Pascal source folder to see the >> differences in the units (just look at the *.pas/

Re: [fpc-pascal] Basically on the right track?

2012-12-28 Thread Sven Barth
On 28.12.2012 05:47, Patrick wrote: Free Pascal Compiler version 2.6.0 [2011/12/23] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling helloworld.pas helloworld.pas(28,11) Error: Incompatible types: got "Boolean32" expected "LongInt" helloworld

Re: [fpc-pascal] Extending an enumeration

2012-12-28 Thread Ludo Brands
On 28/12/2012 11:42, Mark Morgan Lloyd wrote: Is it possible to extend an enumeration, while preserving strong type checking? In other words, given existing code like typeTUpstreamServerCapabilitiesBase= (uscConnected, uscCanIssueGUID); TLocalServerCapabilitiesBase= (lscConnected, l

Re: [fpc-pascal] Extending an enumeration

2012-12-28 Thread Mark Morgan Lloyd
JC Chu wrote: It is not possible to extend an enumeration type. If you are not willing to use separate sets to hold common and extended elements, you can use a generic (not parametric) set type, say SET OF 0..31, that can hold all possible elements, and define the possible elements as constants.

Re: [fpc-pascal] Extending an enumeration

2012-12-28 Thread Mark Morgan Lloyd
Ludo Brands wrote: On 28/12/2012 11:42, Mark Morgan Lloyd wrote: Is it possible to extend an enumeration, while preserving strong type checking? In other words, given existing code like typeTUpstreamServerCapabilitiesBase= (uscConnected, uscCanIssueGUID); TLocalServerCapabilitiesBa

Re: [fpc-pascal] Extending an enumeration

2012-12-28 Thread Ludo Brands
On 28/12/2012 12:48, Mark Morgan Lloyd wrote: Ludo Brands wrote: type TAllServerCapabilitiesBase=(uscConnected, uscCanIssueGUID,lscConnected, lscCanIssueGUID, lscIsFirebird); TUpstreamServerCapabilitiesBase= uscConnected .. uscCanIssueGUID; TLocalServerCapabilitiesBase= lscConnected..

Re: [fpc-pascal] Extending an enumeration

2012-12-28 Thread Ludo Brands
On 28/12/2012 12:59, Ludo Brands wrote: On 28/12/2012 12:48, Mark Morgan Lloyd wrote: Ludo Brands wrote: type TAllServerCapabilitiesBase=(uscConnected, uscCanIssueGUID,lscConnected, lscCanIssueGUID, lscIsFirebird); TUpstreamServerCapabilitiesBase= uscConnected .. uscCanIssueGUID; TLo

Re: [fpc-pascal] Basically on the right track?

2012-12-28 Thread Marco van de Voort
In our previous episode, Sven Barth said: > > Fatal: Compilation aborted > > Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not > > specify a source file to be compiled) > > How does your helloworld.pas look like? It's hard to guess what's wrong > without seeing the code...

Re: [fpc-pascal] Extending an enumeration

2012-12-28 Thread JC Chu
If you do not allow clients of your unit to define new elements or change the set values, and what you want to do is prevent, say, accidentally adding an extended element to the set in the base class, you can declare extended elements as class-local constants. Otherwise you will need to add checks

Re: [fpc-pascal] Basically on the right track?

2012-12-28 Thread Mark Morgan Lloyd
Sven Barth wrote: On 28.12.2012 05:47, Patrick wrote: Free Pascal Compiler version 2.6.0 [2011/12/23] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling helloworld.pas helloworld.pas(28,11) Error: Incompatible types: got "Boolean32" expected "

Re: [fpc-pascal] Basically on the right track?

2012-12-28 Thread Juha Manninen
On Fri, Dec 28, 2012 at 6:47 AM, Patrick wrote: > I am also finding the site confusing. If I click on AMD64/x86_64 on the > binary download page and then choose sourceforge, I end up being offered a > package that says fpc-2.6.0.i386-linux.tar. > > I did find another link and installed the compi

Re: [fpc-pascal] Extending an enumeration

2012-12-28 Thread Mark Morgan Lloyd
Ludo Brands wrote: On 28/12/2012 12:59, Ludo Brands wrote: On 28/12/2012 12:48, Mark Morgan Lloyd wrote: Ludo Brands wrote: type TAllServerCapabilitiesBase=(uscConnected, uscCanIssueGUID,lscConnected, lscCanIssueGUID, lscIsFirebird); TUpstreamServerCapabilitiesBase= uscConnected .. usc

Re: [fpc-pascal] Basically on the right track?

2012-12-28 Thread Patrick
On 12/28/2012 08:39 AM, Juha Manninen wrote: On Fri, Dec 28, 2012 at 6:47 AM, Patrick wrote: I am also finding the site confusing. If I click on AMD64/x86_64 on the binary download page and then choose sourceforge, I end up being offered a package that says fpc-2.6.0.i386-linux.tar. I di

Re: [fpc-pascal] Basically on the right track?

2012-12-28 Thread Patrick
Hope I am not wearing out the warm welcome I have received I installed the 64 bit .deb package from the website. I am still getting a lot of errors. I am starting to wonder if I have borked my install. I am on Debian stable right now. I can move to Mint Mate desktop... At the end of the e

Re: [fpc-pascal] Basically on the right track?

2012-12-28 Thread Sven Barth
On 28.12.2012 19:04, Patrick wrote: However I am delighted to see a lua package in there. I have more experience with lua. Make is running without errors but I expected to see a liblua.a archive file after and did not see it, there were more warnings. (I have them at the end of the email) You w

Re: [fpc-pascal] Basically on the right track?

2012-12-28 Thread Patrick
Could you try to compile the example using "-st" and then run the generated ppas.sh script and report it's output here? I hope to get more error information from the linker this way... Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freep

Re: [fpc-pascal] Basically on the right track?

2012-12-28 Thread Sven Barth
On 28.12.2012 22:53, Patrick wrote: Ah ! the liblua.a file was there at the start and then after make clean, make it was not. Thanks ! The liblua.a file is not necessarily what you think it is. On *nix platforms the .a files are used for smartlinking, not for linking against something. I