Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Florian Klaempfl
Am 08.11.2011 07:35, schrieb Graeme Geldenhuys:
> On 7 November 2011 20:41, Marco van de Voort wrote:
>>
>> That "current" is added by you. FPC strives to do that of course, but never
>> had the illusion it was near enough to claim something like that. Not now,
>> and not in the past.
> 
> So what exactly is the goals of FPC then? And please don't tell me
> "delphi compatible" because then you need to tell me which version of
> Delphi - and I doubt you can.
> 
> As a core developer of FPC can yo please summarize in one or two
> sentences the actual goal of FPC - that way we are all on the same
> page.

Let me answer:
Writing an (L)GPL'ed pascal (*) compiler being self hosting.

(*) pascal might be replaced by 'wirthian languages' if someone with a
lot of commitment over years pops up and works on this.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Florian Klaempfl
Am 08.11.2011 07:20, schrieb Jürgen Hestermann:
> Jonas Maebe schrieb:
 That's exactly what he said: you are free to create a fork
>>> This argument is pulled out each time someone suggest things that the
> main developers don't like.
>> The reason that this argument is always used is simply because that is
> simply how it is.
> 
> I know that. But still: Why is this argument used like a knee-jerk
> reaction as soon as someone writes unliked opinions? 

The opinion is not unliked but just useless and wastes the time of
people who try to use this mailing list to support others using fpc. If
you want to express opinions again and again without any consequences
like coming up with code just write a blog. You know, "talk is cheap,
show me the code" (Thorvalds).
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Graeme Geldenhuys
On 7 November 2011 20:41, Marco van de Voort wrote:
>
> That "current" is added by you. FPC strives to do that of course, but never
> had the illusion it was near enough to claim something like that. Not now,
> and not in the past.

So what exactly is the goals of FPC then? And please don't tell me
"delphi compatible" because then you need to tell me which version of
Delphi - and I doubt you can.

As a core developer of FPC can yo please summarize in one or two
sentences the actual goal of FPC - that way we are all on the same
page.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Jürgen Hestermann

Jonas Maebe schrieb:
>>> That's exactly what he said: you are free to create a fork
>> This argument is pulled out each time someone suggest things that 
the main developers don't like.
> The reason that this argument is always used is simply because that 
is simply how it is.


I know that. But still: Why is this argument used like a knee-jerk 
reaction as soon as someone writes unliked opinions? That's like saying: 
"Stop critisizing me. I don't like this. I am the boss!". If you don't 
like to write facts/reasons then don't say anything but using your 
thought-terminating cliché over and over again just makes you sound 
arrogant.



> It's not that longtime developers won't listen to other opinions,

But that's what you do when using your standard argument.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-07 Thread Flávio Etrusco
Yes, RolByte/Word/Dword/QWord are implemented in 2.6.0rc1.


On Mon, Nov 7, 2011 at 8:27 PM, Peter  wrote:
> HI,
>
> Does this release include intrinsic ROL & ROR?
> 'Bug' 6300 is shown as fixed, but I can find no mention in the new features
> list.
>
> http://bugs.freepascal.org/view.php?id=6300
>
>
>
>
>
> On 05/11/11 23:27, Marco van de Voort wrote:
>>
>> Hello,
>>
>> We have placed the first release-candidate of the Free Pascal Compiler
>> version 2.6.0 on our ftp-servers.
>>
>> You can help improve the upcoming 2.6.0 release by downloading and
>> testing this release. If you want you can report what you have done here:
>> http://wiki.freepascal.org/Testers_2.6.0
>> http://bugs.freepascal.org/view.php?id=6300
>> Changes that may break backwards compatibility are documented at:
>> http://wiki.freepascal.org/User_Changes_2.6.0
>>
>> Downloads are available at the FTP server at:
>>
>> ftp://freepascal.stack.nl/pub/fpc/beta/2.6.0-rc1/
>>
>> Enjoy!
>>
>> The Free Pascal Compiler Team
>>
>>
>>                             Free Pascal Compiler
>>
>>                                 Version 2.6.0rc1
>>
>>
>> **
>>                               What's New in 2.6.0rc1
>>
>> **
>>
>> Free Pascal 2.6.0 is a new major version of the Free Pascal compiler.
>>
>> Please also see http://wiki.freepascal.org/User_Changes_2.6.0 for a list
>> of changes that may affect the behaviour of previously working code, and
>> how to cope with these changes.
>>
>> Some highlights are:
>>
>> Platforms:
>>   * iPhoneSimulator target
>>
>> Compiler:
>>   * Many new language features:
>>      * Objective-Pascal dialect, supported on all Mac OS X and iOS targets
>>      * constref parameter modifier for "const by reference"
>>      * Pascal boolean types with multiple sizes (boolean16/32/64)
>>      * ISO 7185 language mode (except for I/O). Features amongst others:
>>         * nested procedure variables
>>         * non-local goto's
>>      * Mac Pascal mode improvements
>>         * nested procedure variables
>>         * univ modifier
>>      * Intrinsics
>>         * sar (shift arithmetic right)
>>         * bsf/bsr (bitscan forward/reverse)
>>      * Delphi compatibility mode improvements
>>         * Nested types, class variables and class local constants
>>         * Advanced records syntax (no constructors yet)
>>         * (for..in) Enumerators in records
>>         * Class and record helpers
>>         * Generic records, arrays and procedural types
>>         * Delphi-compatibility of generics improved
>>         * Scoped enumerations
>>         * Custom messages for "deprecated" directive
>>         * Ability to use "&" for escaping keywords
>>   * New ARM code generator features
>>      * ARM VFPv2 and VFPv3 floating point unit support
>>      * Thumb-2 support
>>
>> Packages:
>>   * Many improvements to the rtl
>>   * Many improvements to the database units (fcl-db)
>>   * Objective-Pascal interfaces to Foundation, AppKit, CoreData and
>> WebCore
>>   * OpenGL headers updated to OpenGL 4.0
>>
>> Details about these new features can be found at
>> http://wiki.freepascal.org/FPC_New_Features_2.6.0
>>
>> See http://bugs.freepascal.org/changelog_page.php for the list of reported
>> bugs that have been fixed in this release.
>> ___
>> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
>>
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-07 Thread Peter

HI,

Does this release include intrinsic ROL & ROR?
'Bug' 6300 is shown as fixed, but I can find no mention in the new 
features list.


http://bugs.freepascal.org/view.php?id=6300





On 05/11/11 23:27, Marco van de Voort wrote:

Hello,

We have placed the first release-candidate of the Free Pascal Compiler
version 2.6.0 on our ftp-servers.

You can help improve the upcoming 2.6.0 release by downloading and
testing this release. If you want you can report what you have done here:
http://wiki.freepascal.org/Testers_2.6.0
http://bugs.freepascal.org/view.php?id=6300
Changes that may break backwards compatibility are documented at:
http://wiki.freepascal.org/User_Changes_2.6.0

Downloads are available at the FTP server at:

ftp://freepascal.stack.nl/pub/fpc/beta/2.6.0-rc1/

Enjoy!

The Free Pascal Compiler Team


 Free Pascal Compiler

 Version 2.6.0rc1

**
   What's New in 2.6.0rc1
**

Free Pascal 2.6.0 is a new major version of the Free Pascal compiler.

Please also see http://wiki.freepascal.org/User_Changes_2.6.0 for a list
of changes that may affect the behaviour of previously working code, and
how to cope with these changes.

Some highlights are:

Platforms:
   * iPhoneSimulator target

Compiler:
   * Many new language features:
  * Objective-Pascal dialect, supported on all Mac OS X and iOS targets
  * constref parameter modifier for "const by reference"
  * Pascal boolean types with multiple sizes (boolean16/32/64)
  * ISO 7185 language mode (except for I/O). Features amongst others:
 * nested procedure variables
 * non-local goto's
  * Mac Pascal mode improvements
 * nested procedure variables
 * univ modifier
  * Intrinsics
 * sar (shift arithmetic right)
 * bsf/bsr (bitscan forward/reverse)
  * Delphi compatibility mode improvements
 * Nested types, class variables and class local constants
 * Advanced records syntax (no constructors yet)
 * (for..in) Enumerators in records
 * Class and record helpers
 * Generic records, arrays and procedural types
 * Delphi-compatibility of generics improved
 * Scoped enumerations
 * Custom messages for "deprecated" directive
 * Ability to use "&" for escaping keywords
   * New ARM code generator features
  * ARM VFPv2 and VFPv3 floating point unit support
  * Thumb-2 support

Packages:
   * Many improvements to the rtl
   * Many improvements to the database units (fcl-db)
   * Objective-Pascal interfaces to Foundation, AppKit, CoreData and WebCore
   * OpenGL headers updated to OpenGL 4.0

Details about these new features can be found at
http://wiki.freepascal.org/FPC_New_Features_2.6.0

See http://bugs.freepascal.org/changelog_page.php for the list of reported
bugs that have been fixed in this release.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

   


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


Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Jonas Maebe

On 07 Nov 2011, at 18:45, Jürgen Hestermann wrote:

> Jonas Maebe schrieb:
>> That's exactly what he said: you are free to create a fork (= take the FPC 
>> source code and do whatever you want with it), and then the currently active 
>> FPC developers are also free to take whichever of your patches they consider 
>> useful. What's not possible is that other people dictate what you must do 
>> with the FPC source code, just like you can't dictate what other people must 
>> do.
>> 
> This argument is pulled out each time someone suggest things that the main 
> developers don't like. But despite from the work this requires it would 
> result in my own island solution. It cannot be the goal that thousands of 
> people spawn their own Pascal dialect. I don't think that anybody is wanting 
> this. I thought this open source project is about having a *public* Pascal 
> language which can be discussed and argued about. I know that there will be 
> no common sense about each and every topic but it should be possible to say 
> opinions which possibly make others change their mind (or not).

The problem is that the work needs to be done. And once it is done, it needs to 
be maintained, and must impact other potential work as little as possible. 
Because of these reasons
a) people who implement stuff have way more influence than people who only 
voice their opinion about what/how something should be implemented
b) people who have already implemented lots of stuff have more influence than 
people who have not done that

It's not that longtime developers won't listen to other opinions, but they do 
have the final say. Without such a dynamic, the project simply cease to exist. 
After all, without the people who do the work there is nothing at all, not even 
a project going into a direction that you don't like.

The reason that this argument is always used is simply because that is simply 
how it is. You can argue that it should be different, but really the only way 
to do that is to do the work yourself. That may well be an uphill battle if you 
wish to fundamentally change some things or the development direction of an 
entire project, in which case starting your own project may be the best option. 
After all, that would give you the opportunity to demonstrate that your way is 
actually better and will attract more/better/whatever developers and users, or 
otherwise will result in something more useful, rather than just arguing that 
this will be the case and that people should understand that.


Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Marco van de Voort
In our previous episode, Martin Schreiber said:
> So probably there are at least two different expectations into FPC which 
> can't 
> be fulfilled both: "best general purpose software development environment 
> ever" and "100% current Delphi compatibility".

That "current" is added by you. FPC strives to do that of course, but never
had the illusion it was near enough to claim something like that. Not now,
and not in the past.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Jürgen Hestermann

Jonas Maebe schrieb:
> That's exactly what he said: you are free to create a fork (= take 
the FPC source code and do whatever you want with it), and then the 
currently active FPC developers are also free to take whichever of your 
patches they consider useful. What's not possible is that other people 
dictate what you must do with the FPC source code, just like you can't 
dictate what other people must do.


This argument is pulled out each time someone suggest things that the 
main developers don't like. But despite from the work this requires it 
would result in my own island solution. It cannot be the goal that 
thousands of people spawn their own Pascal dialect. I don't think that 
anybody is wanting this. I thought this open source project is about 
having a *public* Pascal language which can be discussed and argued 
about. I know that there will be no common sense about each and every 
topic but it should be possible to say opinions which possibly make 
others change their mind (or not).


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


Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Martin Schreiber
On Monday 07 November 2011 17.02:59 Luiz Americo Pereira Camara wrote:
> > Is there a big demand? Examples?
> 
> I speak only for myself.
> 
> This is a component that i'd like to see compiled with fpc
> 
> http://code.google.com/p/emballo/
> 
> The problems
>   - generic support: bugs.freepascal.org/view.php?id=20503 . Can be
> workaround by type casting
>   - reflection/rtti support to call constructor of a given TClass. Can
> be work around by registering a function that returns an instance or
> using AfterConstruction to setup object instead of the constructor directly
> 
> BTW: i will take the old version version of emballo and rewrite it in an
> "FPC compatible way" to get things done in the meantime.
> 
> Looking also to http://code.google.com/p/delphi-spring-framework/ and
> http://code.google.com/p/delphi-orm/
> 
So probably there are at least two different expectations into FPC which can't 
be fulfilled both: "best general purpose software development environment 
ever" and "100% current Delphi compatibility".

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

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Luiz Americo Pereira Camara

On 7/11/2011 07:28, Martin Schreiber wrote:


> One reason is to make it easy for FPC users to reuse existing Delphi

> code that is out there without having to rewrite it in an "FPC-

> compatible way".

>

Is there a big demand? Examples?



I speak only for myself.

This is a component that i'd like to see compiled with fpc

http://code.google.com/p/emballo/

The problems
 - generic support: bugs.freepascal.org/view.php?id=20503 . Can be 
workaround by type casting
 - reflection/rtti support to call constructor of a given TClass. Can 
be work around by registering a function that returns an instance or 
using AfterConstruction to setup object instead of the constructor directly


BTW: i will take the old version version of emballo and rewrite it in an 
"FPC compatible way" to get things done in the meantime.


Looking also to http://code.google.com/p/delphi-spring-framework/ and 
http://code.google.com/p/delphi-orm/


Luiz



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


Re: [fpc-pascal] Numbers longer than double-precision

2011-11-07 Thread Henry Vermaak

On 07/11/11 11:49, Ko Hashiguchi wrote:

Sirs,

Does Free Pascal have any options for operating on numbers longer than
double-precision? If quad-precision is available, how can it be had? Can
one find-obtain-buy libraries that can extend this ability to the Pascal
language? Any info. you can post would be appreciated.


You can use libgmp (LGPL licence).  Freepascal has bindings for it and 
there are even some examples in packages/gmp.


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


Re: [fpc-pascal] Numbers longer than double-precision

2011-11-07 Thread Sven Barth

Am 07.11.2011 12:49, schrieb Ko Hashiguchi:

Sirs,

Does Free Pascal have any options for operating on numbers longer than
double-precision? If quad-precision is available, how can it be had? Can
one find-obtain-buy libraries that can extend this ability to the Pascal
language? Any info. you can post would be appreciated.


Once the softfpu unit ($fpcdir/rtl/inc/softfpu.pp) is finished this will 
be possible. But AFAIK no one is currently working on that.


On x86 platforms you can also use the type "Extended" which is a 80-bit 
floating point type (it maps to "Double" on other platforms).


Regards,
Sven

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


[fpc-pascal] The best approaching for templating

2011-11-07 Thread luciano de souza
Hello listers,

I would like to create some templates. Suppose the following example:



%s


%s 
%s 
%s 



I can certainly use format to link %s to the respective variables.
However, if the number of %s is big, probabily, the reading would be
less clearer.

But, suppose I have $title in stead of %s and $p1 in stead of %s. In
Lua, I have a module called Cosmo taht perform it.

my question is: is there something similar in Pascal?

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


[fpc-pascal] Numbers longer than double-precision

2011-11-07 Thread Ko Hashiguchi
Sirs,

Does Free Pascal have any options for operating on numbers longer than
double-precision? If quad-precision is available, how can it be had? Can
one find-obtain-buy libraries that can extend this ability to the Pascal
language? Any info. you can post would be appreciated.

Thank you,

Ko Hashiguchi
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Jonas Maebe


On 07 Nov 2011, at 11:28, Martin Schreiber wrote:


On Monday 07 November 2011 10.55:41 Jonas Maebe wrote:

On 07 Nov 2011, at 08:10, Martin Schreiber wrote:
One reason is to make it easy for FPC users to reuse existing Delphi
code that is out there without having to rewrite it in an "FPC-
compatible way".


Is there a big demand? Examples?


Indy and Synapse are two I know of, but there are probably many more.  
I also used FPC/Lazarus to port an architectural simulator developed  
in our group at the university a long time ago (using Delphi 5 or so)  
to Mac and Linux. I was relatively easy, even though I had no prior  
experience with developing GUI applications in Lazarus (and still  
don't really have, actually, since most things just compiled and  
worked barring some widgetset bugs).



Maybe if FPC clearly states that it will not follow Delphi blindly


We will not do that. Just like we won't say that we will follow them  
blindly. What happens depends on what code people write, which patches  
are submitted and what the quality and impact of those patches is. A  
lot of Delphi-compatibility features have been added to the compiler  
in the past year simply because Paul Ishenin cares about that and he  
generally writes good code and tests. And non-Delphi compatible  
features such as Objective-Pascal and a JVM backend have been added  
because I cared about that.



and defines
what Delphi devels must do to be FPC compatible and to have the free  
multi

platform alternative there will be more FPC/Delphi compatible code?


In general that means limiting themselves to features of Delphi  
versions from a couple of years back, and not using Windows-specific  
code.


Now where Embarcadero uses FPC for iOS development is probably a  
good moment

to do so.


I doubt it, because
a) Embarcadero are working on their own ARM compiler and won't ship  
FPC anymore with future Delphi versions
b) all example code posted by FPC contains every single line of  
implementation code between {$ifdef FPC} to make it clear that you may  
have to rewrite that code in the future (although strangely enough  
they use {$mode objfpc} instead of {$mode delphi} everywhere in that  
code)



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


Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Martin Schreiber
On Monday 07 November 2011 10.55:41 Jonas Maebe wrote:
> On 07 Nov 2011, at 08:10, Martin Schreiber wrote:
> > I don't understand why FPC should become a 100% Delphi clone instead
> > the "best
> > general software development environment ever" for the only purpose
> > that
> > Delphi users have a free cross platform alternative without to care
> > about FPC
> > compatibility while writing their Delphi code.
> 
> One reason is to make it easy for FPC users to reuse existing Delphi
> code that is out there without having to rewrite it in an "FPC-
> compatible way".
> 
Is there a big demand? Examples? Because I write most of the code myself I 
don't know the market well.
Maybe if FPC clearly states that it will not follow Delphi blindly and defines 
what Delphi devels must do to be FPC compatible and to have the free multi 
platform alternative there will be more FPC/Delphi compatible code?
Now where Embarcadero uses FPC for iOS development is probably a good moment 
to do so.

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

[fpc-pascal] Re: [fpc-devel] Free Pascal 2.6.0rc1 released

2011-11-07 Thread Skybuck Flying

So FPC can now compile to java byte code.

I don't even have Java installed on Windows because on Windows it's a 
security risk.


Nice to see some more virtual instruction set support though.

I'd like to see compile to redcode or compile to cuda/ptx ;)

Also let me ask one question about "Delphi" mode:

If free pascal is put in Delphi mode does this prevent any "free pascal 
specific language extensions" so that the programmer can be sure that the 
program written in free pascal will compile in Delphi as well ?


Bye,
 Skybuck.

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


Re: [fpc-pascal] SQLite Load_extension seems to be working

2011-11-07 Thread Reinier Olislagers
On 7-11-2011 10:49, michael.vancann...@wisa.be wrote:
> On Mon, 7 Nov 2011, Reinier Olislagers wrote:
>> On 7-11-2011 8:23, Reinier Olislagers wrote:
>> Attached diff (against fixes_2_6) seems to work for letting SQLite load
>> the libspatialite extension

>> I'll upload the diff as a patch unless somebody has objections/a better
>> implementation...
> 
> Uploading the diff should be fine.
> 
> Michael.

Thanks, Michael, issue 20640.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Jonas Maebe


On 07 Nov 2011, at 08:10, Martin Schreiber wrote:

I don't understand why FPC should become a 100% Delphi clone instead  
the "best
general software development environment ever" for the only purpose  
that
Delphi users have a free cross platform alternative without to care  
about FPC

compatibility while writing their Delphi code.


One reason is to make it easy for FPC users to reuse existing Delphi  
code that is out there without having to rewrite it in an "FPC- 
compatible way".



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


Re: [fpc-pascal] SQLite Load_extension seems to be working

2011-11-07 Thread michael . vancanneyt



On Mon, 7 Nov 2011, Reinier Olislagers wrote:


On 7-11-2011 8:23, Reinier Olislagers wrote:

2. You can apparently load the spatialite (and dependencies) dll/so as
an extension to SQLite, with a statement like [3]
select load_extension('libspatialite-4.dll');
However, it seems you have to enable the extension load mechanism first
using the C API [2]:
int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
(onoff==1 to turn extension loading on)


Attached diff (against fixes_2_6) seems to work for letting SQLite load
the libspatialite extension, e.g. using this in my Lazarus FormCreate event:
// Try to load extensions
DBConnection.DatabaseName:='osm.sqlite';
DBConnection.Open;
DBConnection.LoadExtension('libspatialite-4.dll');
//Note: we need an open db before doing this

Now I'm getting an error message saying that libfreexl-1.dll can't be
found, apparently an Excel reader library required by spatialite...
I'm going to ask the spatialite guys for clarification on this...

I'll upload the diff as a patch unless somebody has objections/a better
implementation...


Uploading the diff should be fine.

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


[fpc-pascal] SQLite Load_extension seems to be working

2011-11-07 Thread Reinier Olislagers
On 7-11-2011 8:23, Reinier Olislagers wrote:
> 2. You can apparently load the spatialite (and dependencies) dll/so as
> an extension to SQLite, with a statement like [3]
> select load_extension('libspatialite-4.dll');
> However, it seems you have to enable the extension load mechanism first
> using the C API [2]:
> int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
> (onoff==1 to turn extension loading on)

Attached diff (against fixes_2_6) seems to work for letting SQLite load
the libspatialite extension, e.g. using this in my Lazarus FormCreate event:
// Try to load extensions
DBConnection.DatabaseName:='osm.sqlite';
DBConnection.Open;
DBConnection.LoadExtension('libspatialite-4.dll');
//Note: we need an open db before doing this

Now I'm getting an error message saying that libfreexl-1.dll can't be
found, apparently an Excel reader library required by spatialite...
I'm going to ask the spatialite guys for clarification on this...

I'll upload the diff as a patch unless somebody has objections/a better
implementation...

Thanks,

Reinier
Index: packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp
===
--- packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp (revision 19599)
+++ packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp (working copy)
@@ -89,6 +89,7 @@
 constructor Create(AOwner : TComponent); override;
 function GetInsertID: int64;
 procedure GetFieldNames(const TableName : string; List :  TStrings); 
override;
+procedure LoadExtension(LibraryFile: string);
   published
 property Options: TSqliteOptions read FOptions write SetOptions;
   end;
@@ -883,6 +884,24 @@
   GetDBInfo(stColumns,TableName,'name',List);
 end;
 
+procedure Tsqlite3connection.LoadExtension(Libraryfile: String);
+var
+  LoadResult: integer;
+begin
+  CheckConnected; //Apparently we need a connection before we can load 
extensions.
+  try
+LoadResult:=SQLITE_ERROR; //Default to failed
+sqlite3_enable_load_extension(fhandle, 1); //Make sure we are allowed to 
load
+LoadResult:=sqlite3_load_extension(fhandle, PChar(LibraryFile), nil, nil); 
//Actually load extension
+if LoadResult=SQLITE_ERROR then
+  begin
+  DatabaseError('LoadExtension: failed to load SQLite extension (SQLite 
returned an error while loading).',Self);
+  end;
+  except
+DatabaseError('LoadExtension: failed to load SQLite extension.',Self);
+  end;
+end;
+
 procedure TSQLite3Connection.setoptions(const avalue: tsqliteoptions);
 begin
  if avalue <> foptions then 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Spatialite (a GIS extension to Sqlite) & SQLite Load_extension

2011-11-07 Thread Reinier Olislagers
Hi all,

I'm looking into getting road, vegetation, building etc. data from
OpenStreetmap and generating a map for the Rigs of Rods
truck/driving/flight/boat simulator using FPC/Lazarus if possible.

I've found Spatialite [1], an extension to the SQLite database engine,
that allows e.g. easy import of Openstreetmap data, routing, and
coordinate conversion (I intend to convert the WGS 84 coordinates into a
flat coordinate system).

1. Has anybody used spatialite within FreePascal/Lazarus? Any
hints/tips/example programs I can stea... use?

2. You can apparently load the spatialite (and dependencies) dll/so as
an extension to SQLite, with a statement like [3]
select load_extension('libspatialite-4.dll');
However, it seems you have to enable the extension load mechanism first
using the C API [2]:
int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
(onoff==1 to turn extension loading on)
Is there support for this within FPC?
I found sqlite3_enable_load_extension within
packages/sqlite/src/sqlite3.inc, but it doesn't seem to be used...
Would I need to edit sqlite3conn.pp to add support for loading extensions?


Thanks,
Reinier

[1] http://www.gaia-gis.it/spatialite/index.html
[2] http://www.sqlite.org/c3ref/enable_load_extension.html
[3] http://www.sqlite.org/lang_corefunc.html#load_extension
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-07 Thread Jürgen Hestermann

Marco van de Voort schrieb:
When I now try to compile a short test program with the IDE I get: 
"Error: Illegal parameter: -Cp386"

This was a setting I used before. Has this been changed?
When I remove this parameter and try again I get:
"Fatal: Unable to open file D:\vpascal\FreePascal\fp.cfg"
"Fatal: Compilation aborted"
The file exists and was used on the first compiler run but it seems it 
was not closed properly on error.


The problem here might be some old configuration file.
  
Yes, that is the case. Still there are problems: If I delete the 
parameter in the IDE and try again to compile it it should work. But 
when doing so I get the "unable to open file ...fp.cfg" error. It seems 
that the IDE does not close the config file properly on error so that it 
now has problems to reopen it. And although I have checked to save all 
configurations the deletion of the parameter is not stored. On next 
startup the same parameter reappears. But when I delete the parameter 
directly after startup and compile then everything works ok. In this 
case the IDE was able to save the changes into fp.cfg. But it fails 
doing so if the error "illegal parameter" has appeared first.




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


Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-11-07 Thread Martin Schreiber
On Sunday 06 November 2011 18.24:16 Jürgen Hestermann wrote:
> 
> Also, implementing all existing language constructs from all other
> languages into Pascal makes it a monster that no one can handle anymore.
> Supporting Delphi code sounds good in the first place but in the end it
> bloats the language to something completely different than was intended.
> The reasons for the success of Pascal were simplicity and clarity. But
> now it going into the opposite direction. Introducing new constructs
> over and over again does not make a language easier to use, just the
> opposite.
> 
Agreed 100%. If someone wants to write Delphi and FPC compatible code this is 
already possible.
I don't understand why FPC should become a 100% Delphi clone instead the "best 
general software development environment ever" for the only purpose that 
Delphi users have a free cross platform alternative without to care about FPC 
compatibility while writing their Delphi code.
I propose to make a review of current and future FPC language constructs and 
to classify the constructs into different groups (Pascal kernel, OOP kernel, 
convenience, syntax sugar, can be replaced by, code bloat, Delphi clone...).
Eh.., no, I can't do it my self because I don't know all the newer 
possibilities and there is another FPC related open source project which needs 
my attention. ;-)
People who want to write code which is understandable by every Pascal coder 
can limit their use of constructs to the basic groups. It even will be 
possible to make a streamlined FPC version later without the bloated elements.

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

Re: [fpc-pascal] What is the difference between the declarations at the beginning of a class and those declared in the public section?

2011-11-07 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said:
> Correct, but that is what Borland, CodeGear, Embarcadero and Lazarus
> call "RAD development".  I consider RAD just great for prototyping,
> not for real-world apps that need to be maintaing my many programmers
> over a decade or two. RAD promotes a lot of bad habbits: bad OOP
> design by making everything public, mixing business rules in the UI
> code via easy event handlers in a form etc etc.

Strangely, I would have agreed in my previous job. There we had a big
monolithical app that was maintained by a team for one big customer.

In my current job every project is a heavily customized variantion on a
basic framework, and the requirements and direction of the project are quite
often have hard to predict. If you have to write off a higher percentage of
the work you do on the current project only, one can be less principal in
these things.
 
> The major problems comes in due to the Form Designer in Delphi and
> Lazarus. The Form Designer solely works due to RTTI, and for RTTI to
> work you need Published properties - thus publicly visible to all.

Having to publish the form elements is not elegant or perfect, but I
understand the reasons and IMHO it is not really a problem.

But IMHO information hiding should just be a first order safeguard, not a
micromanaged contract. 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal