Re: [fpc-devel] revision.inc
In our previous episode, Dimitrios Chr. Ioannidis said: > But i'm in windows at i > have to export the tree before the build effectively loosing all the > svn's info. http://www.stack.nl/~marcov/buildfaq/#toc-Section-2.4 and then specially http://www.stack.nl/~marcov/buildfaq/#toc-Subsection-2.4.2 ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] Free Pascal 2.4.2 released!
Hello, we have placed a new major release of the Free Pascal Compiler, version 2.4.2 on our ftp-servers. Changes that may break backwards compatibility are documented at: http://wiki.freepascal.org/User_Changes_2.4.2 Downloads are available at: the main FTP server at ftp://ftp.freepascal.org/pub/fpc/dist/2.4.2/ and mirrors like ftp://freepascal.stack.nl/pub/fpc/dist/2.4.2/ ftp://ftp.hu.freepascal.org/pub/fpc/dist/2.4.2/ and sourceforge. Enjoy! The Free Pascal Compiler Team Free Pascal Compiler Version 2.4.2 ** What's New in 2.4.2 ** Free Pascal 2.4.2 contains many fixes and a few new features. Most bugfixes in the RTL and packages before june 2010 have been merged. Please also see http://wiki.freepascal.org/User_Changes_2.4.2 for a list of changes which may affect the behaviour of previously working code, and how to cope with these changes. Some highlights are: Compiler: * Support D2006+ FOR..IN, with some FPC specific enhancements. Refer to http://wiki.freepascal.org/for-in_loop for more information * Support for sealed and abstract classes. Packages: * Many improvements to the XML units * Many improvements to the database units * Many improvemnets to the chm units Platforms: * Long term bug in OS/2 implementation of unit Video finally fixed which among others allows inclusion of the text-mode IDE (without debugger) for this platform as part of the distribution again. See http://bugs.freepascal.org/changelog_page.php for the list of reported bugs which have been fixed in this release. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] revision.inc
Στις 13/11/2010 11:30 πμ, ο/η Marco van de Voort έγραψε: In our previous episode, Dimitrios Chr. Ioannidis said: But i'm in windows at i have to export the tree before the build effectively loosing all the svn's info. http://www.stack.nl/~marcov/buildfaq/#toc-Section-2.4 and then specially http://www.stack.nl/~marcov/buildfaq/#toc-Subsection-2.4.2 Thx, but this wasn't the problem. The problem was that it doesn't exists a svnversion executable in TortoiseSVN. I had to look at the makefile in compiler dir to find out that i needed a svnversion executable for this to work. So i downloaded the CollabNet command line tools. So, i updated my tree. Got inside the compiler dir and run 'make revision FPC={some path}\ppc386.exe'. Unfortunattely the revision.inc is still has 'exported' in it and the 'ppc386.exe -iW' gives me '2.5.1-rexported'. Running 'svnversion' i got '16332'. In the {fpc svn dir}\compiler\Makefile at the 363, there is : 'SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))' As i'm not familiar with the Makefile files, any help is much appreciated ... regards, -- Dimitrios Chr. Ioannidis ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] revision.inc
In our previous episode, Dimitrios Chr. Ioannidis said: > > http://www.stack.nl/~marcov/buildfaq/#toc-Section-2.4 > > > > and then specially > > > > http://www.stack.nl/~marcov/buildfaq/#toc-Subsection-2.4.2 > > Thx, but this wasn't the problem. (it is about avoid exporting all together) > The problem was that it doesn't exists a svnversion executable in > TortoiseSVN. I had to look at the makefile in compiler dir to find out > that i needed a svnversion executable for this to work. So i downloaded > the CollabNet command line tools. That require registration, I use these: https://sourceforge.net/projects/win32svn/ > So, i updated my tree. Got inside the compiler dir and run 'make > revision FPC={some path}\ppc386.exe'. > Unfortunattely the revision.inc is still has 'exported' in it and the > 'ppc386.exe -iW' gives me '2.5.1-rexported'. > Running 'svnversion' i got '16332'. > > In the {fpc svn dir}\compiler\Makefile at the 363, there is : > 'SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH)))' > > As i'm not familiar with the Makefile files, any help is much > appreciated ... Is that binary in the path? If not you have to pass it: make revision SVNVERSION="c:\Program Files (x86)\Subversion\bin\svnversion.exe" I'll see if I can add some about this in the next buildfaq. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] revision.inc
On Sat, 13 Nov 2010 13:17:49 +0100 (CET), mar...@stack.nl (Marco van de Voort) wrote: >> that i needed a svnversion executable for this to work. So i downloaded >> the CollabNet command line tools. > > That require registration, I use these: > > https://sourceforge.net/projects/win32svn/ Thx, for the tip.But IMHO the majority of the windows users are using TortoiseSVN, so a solution which include the TortoiseSVN's SubWCRev alternative for the svn's 'svnversion' will be better. >> Running 'svnversion' i got '16332'. > > Is that binary in the path? If not you have to pass it: I run 'svnversion' at the compiler dir from the command line, so yes it's in the path.AFAIU, the Makefile failed to find the 'svnversion' executable in my Windows 7 64 bit machine. That's why i posted the line from the Makefile. > make revision SVNVERSION="c:\Program Files > (x86)\Subversion\bin\svnversion.exe" Thx, didn't know that i could do it that way.Much appreciated ... regards, -- Dimitrios Chr. Ioannidis ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] revision.inc
In our previous episode, Dimitrios Chr. Ioannidis said: For the record: I'm only writing as I discover this functionality. I knew Lazarus did something like this, but not the details and hows. > >> the CollabNet command line tools. > > > > That require registration, I use these: > > > > https://sourceforge.net/projects/win32svn/ > > Thx, for the tip.But IMHO the majority of the windows users are using > TortoiseSVN, so a solution which include the TortoiseSVN's SubWCRev > alternative for the svn's 'svnversion' will be better. I put $WCREV$ in a file revision.inc.template and then ran subwcrev . revision.inc.template revision.inc in the compiler/ dir. This is doable to do in batch or makefile I'll look into it later. > > Is that binary in the path? If not you have to pass it: > > I run 'svnversion' at the compiler dir from the command line, so yes it's > in the path. > AFAIU, the Makefile failed to find the 'svnversion' executable > in my Windows 7 64 bit machine. That's why i posted the line from the > Makefile. I think it is a functionality that doesn't auto engage, since it could possibly slow building or put useless suffixes like "exported" in binaries when not properly used. Setting SVNVERSION makefile param activates it. It should be easy to make something similar for subwcrev, I'll have a look at that later. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Free Pascal 2.4.2 released!
On Sat, Nov 13, 2010 at 7:49 AM, Marco van de Voort wrote: > Hello, > > we have placed a new major release of the Free Pascal > Compiler, version 2.4.2 on our ftp-servers. > > Changes that may break backwards compatibility are documented at: > http://wiki.freepascal.org/User_Changes_2.4.2 > > Downloads are available at: > > the main FTP server at > > ftp://ftp.freepascal.org/pub/fpc/dist/2.4.2/ > > and mirrors like > > ftp://freepascal.stack.nl/pub/fpc/dist/2.4.2/ > ftp://ftp.hu.freepascal.org/pub/fpc/dist/2.4.2/ > > and sourceforge. > > Enjoy! > > The Free Pascal Compiler Team > > > Free Pascal Compiler > > Version 2.4.2 > > ** > What's New in 2.4.2 > ** > > Free Pascal 2.4.2 contains many fixes and a few new features. Most bugfixes > in the RTL and packages before june 2010 have been merged. > > Please also see http://wiki.freepascal.org/User_Changes_2.4.2 for a list > of changes which may affect the behaviour of previously working code, and > how to cope with these changes. > > Some highlights are: > > Compiler: > * Support D2006+ FOR..IN, with some FPC specific enhancements. Refer to > http://wiki.freepascal.org/for-in_loop for more information > * Support for sealed and abstract classes. > > Packages: > * Many improvements to the XML units > * Many improvements to the database units > * Many improvemnets to the chm units > > Platforms: > * Long term bug in OS/2 implementation of unit Video finally fixed which > among others allows inclusion of the text-mode IDE (without debugger) > for this platform as part of the distribution again. > > See http://bugs.freepascal.org/changelog_page.php for the list of reported > bugs which have been fixed in this release. Congratulations! It was a hard work. Marcos Douglas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] very misleading error msg...
(using the -Se 10 switch) Compiling C:\Users\martin\AppData\Local\Temp\syn\project1.lpr project1.lpr(9,5) Error: Illegal expression project1.lpr(9,5) Fatal: Syntax error, "EXCEPT" expected but "identifier WRITELN" found The illegal expression is ok. But why saying that "Except" was expected? Imho that is misleading, since the source can continue with anything else here Is that something that would be worth a report in mantis, in order to improve error msgs? program Project1; {$mode objfpc}{$H+} var a: Integer; begin try writeln(); a writeln(); finally end; end. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] very misleading error msg...
On 13.11.2010 14:59, Martin wrote: The illegal expression is ok. But why saying that "Except" was expected? Imho that is misleading, since the source can continue with anything else here I can only assume the following: Before an "except" or a "finally" the ";" is optional (like in every(?) block). Thus after a statement without a ";" either a "finally" or an "except" is expected and the compiler simply assumes that it's in a "try...except" block first. Or it's just because "except" is declared before "finally" in the token array which is kept ordered by token length first and lexicographically second. Regards, Sven ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] very misleading error msg...
On 13/11/2010 17:40, Sven Barth wrote: On 13.11.2010 14:59, Martin wrote: The illegal expression is ok. But why saying that "Except" was expected? Imho that is misleading, since the source can continue with anything else here I can only assume the following: Before an "except" or a "finally" the ";" is optional (like in every(?) block). Thus after a statement without a ";" either a "finally" or an "except" is expected and the compiler simply assumes that it's in a "try...except" block first. Or it's just because "except" is declared before "finally" in the token array which is kept ordered by token length first and lexicographically second. Ah that makes sense (the semicolon part). indeed I was not bothered if it is except or finally... Thanks ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] Re: enumerators (was: Free Pascal 2.4.2 released!)
Marco van de Voort schrieb: we have placed a new major release of the Free Pascal Compiler, version 2.4.2 on our ftp-servers. Great :-) Some highlights are: Compiler: * Support D2006+ FOR..IN, with some FPC specific enhancements. Refer to http://wiki.freepascal.org/for-in_loop for more information A few notes on enumerators: What restrictions apply to enumerators in general? IMO the loop variable should be treated as "const", any change to an enumerated structure (tree...) may result in obscure bugs. Like traversing strings seems not to allow to change the string, by e.g. replacing '/' by '\'. In the array enumerator, is it possible to use an pointer into the array, instead of a copy of the element? This would allow to use arrays of Class, Record and Object types in the same way (by reference). The comparison in the UTF-8 string example is very questionable. First ch(i) is not equivalent to ch, not even closely related, and the claim of O(N^2) operations deserves an proof - IMO it's simply wrong. In general, what's the benefit of using enumerators? IMO a for loop executes faster on (linear) string and array types, where enumerator calls occur in for-in (see also my note on the UTF-8 string example). Thus enumerators are useful in detail with non-linear data structures, like trees, linked lists, datasets(?) or collections. DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Re: enumerators
On 13.11.2010 20:56, Hans-Peter Diettrich wrote: In general, what's the benefit of using enumerators? IMO a for loop executes faster on (linear) string and array types, where enumerator calls occur in for-in (see also my note on the UTF-8 string example). I'd say they simplify the code. They might not make the code faster (or even make it slower), but they make it easier to read/understand. Consider the following: without for-in: procedure DoSomethingWithSet(aSet: TSetOfEnum); var e: TEnum; begin for e := Low(TEnum) to High(TEnum) do if e in aSet then // do something end; with for-in: procedure DoSomethingWithSet(aSet: TSetOfEnum); var e: TEnum; begin for e in aSet do // do something end; The second one is a bit easier to understand. Basically for-in is syntactic sugar (like "case of string"), nothing more, nothing less. Regards, Sven ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] revision.inc
In our previous episode, Dimitrios Chr. Ioannidis said: > > > > https://sourceforge.net/projects/win32svn/ > > Thx, for the tip.But IMHO the majority of the windows users are using > TortoiseSVN, so a solution which include the TortoiseSVN's SubWCRev > alternative for the svn's 'svnversion' will be better. I've played with both systems a bit. The problem seems to be that "make" can't properly resolve exes in directories with spaces. With the below patch, "make revision" does something if I copy subwcrev.exe to a dir without spaces in the PATH (don't forget to run fpcmake -Tall -w after applying this patch) Index: Makefile.fpc === --- Makefile.fpc(revision 16341) +++ Makefile.fpc(working copy) @@ -162,7 +162,7 @@ # Default message file MSGFILE=msg/error$(FPCLANG).msg - +SUBWCREV:=$(wildcard $(addsuffix /subwcrev$(SRCEXEEXT),$(SEARCHPATH))) SVNVERSION:=$(wildcard $(addsuffix /svnversion$(SRCEXEEXT),$(SEARCHPATH))) # Check if revision.inc is present REVINC:=$(wildcard revision.inc) @@ -412,13 +412,24 @@ # revision.inc rule revision.inc : + $(ECHO) $(SUBWCREV) + $(ECHO) $(REVSTR) + $(ECHO) $(SVNVERSION) + $(ECHO) $(SRCEXEEXT) + $(ECHO) $(SEARCHPATH))) ifneq ($(REVSTR),) ifdef USEZIPWRAPPER +ifeq ($(REVSTR),exported) +ifneq ($(SUBWCREV),) + $(SUBWCREV) .. revision.inc.template revision.inc +else ifneq ($(ECHOREDIR),echo) $(ECHOREDIR) "'$(REVSTR)'" > revision.inc else $(ECHOREDIR) '$(REVSTR)' > revision.inc endif +endif +endif else $(ECHOREDIR) "'$(REVSTR)'" > revision.inc endif ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
Re: [fpc-devel] Re: enumerators
On 13 November 2010 23:32, Sven Barth wrote: > On 13.11.2010 20:56, Hans-Peter Diettrich wrote: >> >> In general, what's the benefit of using enumerators? IMO a for loop >> executes faster on (linear) string and array types, where enumerator >> calls occur in for-in (see also my note on the UTF-8 string example). > > I'd say they simplify the code. They might not make the code faster (or even > make it slower), but they make it easier to read/understand. I never saw the first post, but I'll reply from here.. If you use full-blown Iterator classes (instead of just for-in style) you get a lot more too: * full control over iteration - move forward - move back - reset iteration - peek forward/back - skip, etc... * you can extent it with regular expressions to only iterate what is applicable, and what matches the regex. * you completely hide the container implementation (TList, TObjectList, TFPList, etc) and simply supply the developer with a consistent iteration interface. So even if the container implementation changes, the higher level iteration code will not. I have implemented such Iterator classes for all the most used container classes in the RTL, and they work a treat! -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net:8080/fpgui/ ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel
[fpc-devel] Free Pascal 2.4.2 minimal distros for fpGUI available
This web page has i386 Win32 and ARM WinCE cross-compiler zips that include everything needed (no install necessary) to test FPC 2.4.2 with the fpGUI 0.7 release (Aug 2010): http://www.turbocontrol.com/easyfpgui.htm The i386 Linux version is almost ready. Email me if you want to test a private copy of that distro. -- Regards, Paul Breneman www.dbReplication.com - VCL database replication components www.TurboControl.com - Hardware and software development services - Educational programming project for environment monitoring - Information on using FreePascal for embedded systems - Support information for the TurboPower open source libraries ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel