Delphi's anonymous functions in Free Pascal

classic Classic list List threaded Threaded
125 messages Options
1234567
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Bernd Kreuss
2011/11/6 Michael Van Canneyt <[hidden email]>:

> I am not against closure functionality, although I highly doubt it is *that*
> useful as some people make it out to be. Even so, I use it in my Javascript
> programming.

I'm also not entirely sure about the necessity of closures in OP, but
I must admit I am not totally against it. I am somewhat undecided.
Since we have objects we can easily port every algorithm that needs
closures 1:1 to OP without changing anything, we just have to put a
ton of type definition boilerplate in front of it but the algorithm
itself will look and work 100% the same. It will just pass objects
around instead of closures (and in some simple cases where we don't
need to enclose data we can take the shortcut and use a procedure
variable).

In Javascript there is no difference between 'object' and 'function',
they are the same thing, every function is an object, creating
functions and passing them around is a totally normal thing in JS,
just as normal as it is in OP to create Instances of classes and pass
them around.

But I cannot totally deny that closures in OP would be a cool feature.
They are not necessary to do what can already be done but they still
would be an extremely cool feature which can increase the
expression/noise ratio significantly in some cases if used
appropriately.

And I believe eventually they will be implemented in FPC. I have
absolutely no doubt.


BTW: Here is a post I found while googling for Delphi examples, he
explains the approach they took in Delphi:
http://compilers.iecc.com/comparch/article/09-04-067
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Florian Klämpfl
In reply to this post by Alexander Shishkin
Am 05.11.2011 22:58, schrieb Alexander Shishkin:

> 06.11.2011 1:46, Michael Van Canneyt пишет:
>>
>>
>> On Sat, 5 Nov 2011, Bernd wrote:
>>
>>> 2011/10/25 <[hidden email]>:
>>>
>>>>> targethread.queue(
>>>>>  procedure(targetobject:ttargetobject;a:integer;b:someobject;c:string)
>>>>>             begin
>>>>>               targetobject.destinationprocedure(a,b,c);
>>>>>             end;
>>>>>
>>>>> Note how common this looks compared to the original.
>>>>
>>>> One point is that you could do the above with a local (and named)
>>>> procedure
>>>> as well, and still have all the context. At the very least you would
>>>> not be
>>>> raping pascal's readability by putting a
>>>> complete procedure declaration inside a code block.
>>>
>>> How would you preserve the context without finding some place
>>> somewhere (on the heap) to store the current values of a, b, and c?
>>>
>>
>> Procedure SomeOuter;
>>
>> Var
>> d,e,f : SomeType;
>>
>> Procedure
>> SomeInner(targetobject:ttargetobject;a:integer;b:someobject;c:string)
>>    begin
>>      targetobject.destinationprocedure(a,b,c);
>>    end;
>>
>> begin
>> Targethread.queue(@SomeInner(aobject,d,e,f));
>> end;
>>
>> No difference with 'closure', except more readable.
>>
>
> Closures can be returned as a function result but nested procedure not
> (more strictly, this can be complied but will not work because of
> lifetime of nested procedure).

Of course, but what Michael means is: closure support does not require
necessarily anonymous proceudures/functions/methods.

It would be probably more clear to write and this more pascalish:

Procedure SomeOuter;

Var
  d,e,f : SomeType;

  Lambda Procedure
SomeInner(targetobject:ttargetobject;a:integer;b:someobject;c:string)
  begin
     targetobject.destinationprocedure(a,b,c);
  end;

begin
  Targethread.queue(@SomeInner(aobject,d,e,f));
end;

We don't need lambda expressions after all to implement controll
statements like e.g. smalltalk.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Alexander Shishkin
06.11.2011 15:53, Florian Klämpfl пишет:

> Am 05.11.2011 22:58, schrieb Alexander Shishkin:
>> 06.11.2011 1:46, Michael Van Canneyt пишет:
>>>
>>>
>>> On Sat, 5 Nov 2011, Bernd wrote:
>>>
>>>> 2011/10/25<[hidden email]>:
>>>>
>>>>>> targethread.queue(
>>>>>>   procedure(targetobject:ttargetobject;a:integer;b:someobject;c:string)
>>>>>>              begin
>>>>>>                targetobject.destinationprocedure(a,b,c);
>>>>>>              end;
>>>>>>
>>>>>> Note how common this looks compared to the original.
>>>>>
>>>>> One point is that you could do the above with a local (and named)
>>>>> procedure
>>>>> as well, and still have all the context. At the very least you would
>>>>> not be
>>>>> raping pascal's readability by putting a
>>>>> complete procedure declaration inside a code block.
>>>>
>>>> How would you preserve the context without finding some place
>>>> somewhere (on the heap) to store the current values of a, b, and c?
>>>>
>>>
>>> Procedure SomeOuter;
>>>
>>> Var
>>> d,e,f : SomeType;
>>>
>>> Procedure
>>> SomeInner(targetobject:ttargetobject;a:integer;b:someobject;c:string)
>>>     begin
>>>       targetobject.destinationprocedure(a,b,c);
>>>     end;
>>>
>>> begin
>>> Targethread.queue(@SomeInner(aobject,d,e,f));
>>> end;
>>>
>>> No difference with 'closure', except more readable.
>>>
>>
>> Closures can be returned as a function result but nested procedure not
>> (more strictly, this can be complied but will not work because of
>> lifetime of nested procedure).
>
> Of course, but what Michael means is: closure support does not require
> necessarily anonymous proceudures/functions/methods.
>
> It would be probably more clear to write and this more pascalish:
>
> Procedure SomeOuter;
>
> Var
>    d,e,f : SomeType;
>
>    Lambda Procedure
> SomeInner(targetobject:ttargetobject;a:integer;b:someobject;c:string)
>    begin
>       targetobject.destinationprocedure(a,b,c);
>    end;
>
> begin
>    Targethread.queue(@SomeInner(aobject,d,e,f));
> end;
>
> We don't need lambda expressions after all to implement controll
> statements like e.g. smalltalk.
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>
OK, agreed, this is more readable than Delphi syntax. But ...
1) If we implement lamdas is FPC we will have to support Delphi syntax.
2) lambda systax is usually as short as possible, but this is not
"pascalish".

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Bernd Kreuss
In reply to this post by Florian Klämpfl
2011/11/6 Florian Klämpfl <[hidden email]>:

> It would be probably more clear to write and this more pascalish:
>
> Procedure SomeOuter;
>
> Var
>  d,e,f : SomeType;
>
>  Lambda Procedure
> SomeInner(targetobject:ttargetobject;a:integer;b:someobject;c:string)
>  begin
>     targetobject.destinationprocedure(a,b,c);
>  end;
>
> begin
>  Targethread.queue(@SomeInner(aobject,d,e,f));
> end;

Why would this function have an argument list? How would the target
thread call it?
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

dmitry boyarintsev
In reply to this post by Alexander Shishkin
On Sun, Nov 6, 2011 at 8:00 AM, Alexander Shishkin <[hidden email]> wrote:
> OK, agreed, this is more readable than Delphi syntax. But ...
> 1) If we implement lamdas is FPC we will have to support Delphi syntax.

Hi-jacking, the thread, and again should FPC chase Delphi forever?
Their technical decisions are directed mostly by "marketing" needs.
Should Open Source mimic that?
Now, FPC has provided support for ObjC interface, and Delphi is using
that, so maybe it will (and should) be otherwise - Delphi is to
provide syntax support for FPC?

thanks,
Dmitry

P.S. a lot of syntax sugar might cause diabetes.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Jonas Maebe-2

On 06 Nov 2011, at 15:13, dmitry boyarintsev wrote:

> Hi-jacking, the thread, and again should FPC chase Delphi forever?

If we want to offer compatibility with source code written for Delphi, which does happen to be one of FPC's project goals, then yes, we do have to do that to some extent.

> Now, FPC has provided support for ObjC interface, and Delphi is using
> that,

Delphi is only using it for iOS (because they don't have their own ARM compiler yet). They are using a different way to interface with Objective-C that does not use the FPC syntax with their Mac OS X compiler. In fact, they reportedly do it without extending the language in any way, by basing it on dynamic dispatch similar to COM interfaces. That in itself is a good argument for not adopting FPC's syntax: if you can do something without extending the language, it's almost always the better option.

> so maybe it will (and should) be otherwise - Delphi is to
> provide syntax support for FPC?

What Delphi /should/ do is a useless discussion on the FPC lists. If you insist on doing it anyway, please move it to fpc-other.


Jonas_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Alexander Shishkin
In reply to this post by dmitry boyarintsev
06.11.2011 18:13, dmitry boyarintsev пишет:
> On Sun, Nov 6, 2011 at 8:00 AM, Alexander Shishkin<[hidden email]>  wrote:
>> OK, agreed, this is more readable than Delphi syntax. But ...
>> 1) If we implement lamdas is FPC we will have to support Delphi syntax.
>
> Hi-jacking, the thread, and again should FPC chase Delphi forever?
> Their technical decisions are directed mostly by "marketing" needs.
> Should Open Source mimic that?

FPC support not their decisions but existing Delphi code. This is the
propose of several syntax modes in FPC as I understand. Even if Delphi
will eventually  support FPC dialect it have to maintain compatibility
with current Delphi dialect and also FPC should do so.

> Now, FPC has provided support for ObjC interface, and Delphi is using
> that, so maybe it will (and should) be otherwise - Delphi is to
> provide syntax support for FPC?
>
> thanks,
> Dmitry
>


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Florian Klämpfl
In reply to this post by dmitry boyarintsev
Am 06.11.2011 15:13, schrieb dmitry boyarintsev:
> On Sun, Nov 6, 2011 at 8:00 AM, Alexander Shishkin <[hidden email]> wrote:
>> OK, agreed, this is more readable than Delphi syntax. But ...
>> 1) If we implement lamdas is FPC we will have to support Delphi syntax.
>
> Hi-jacking, the thread, and again should FPC chase Delphi forever?

You mix here result and goal. If FPC supports new Delphi constructs
depends on the fact if somebody provides a patch. No more, no less.

Just as an example: if somebody provides patches to support Extended
Pascal, FPC will support Extended Pascal, nobody did so in >15 years.
Result: FPC supports no Extended Pascal features.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Jürgen Hestermann
Florian Klämpfl schrieb:
 > Am 06.11.2011 15:13, schrieb dmitry boyarintsev:
 >> Hi-jacking, the thread, and again should FPC chase Delphi forever?
 > You mix here result and goal. If FPC supports new Delphi constructs
 > depends on the fact if somebody provides a patch. No more, no less.

I have the same feeling as Dmitry: There must be a time when FPC does
not run after Delphi. Why not now? Other changes were rejected too.


 > Just as an example: if somebody provides patches to support Extended
 > Pascal, FPC will support Extended Pascal, nobody did so in >15 years.
 > Result: FPC supports no Extended Pascal features.

Actually the question is: *If* someone is investing time into something
is this a useful investment? Or wouldn't it be be better to invest this
time into other things, i.e. bug fixes?

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.

Someone who starts programming in Pascal today has the same (or even
worse) learning curve than for all other languages. That is not good IMO.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Florian Klämpfl
Am 06.11.2011 18:24, schrieb Jürgen Hestermann:
> Florian Klämpfl schrieb:
>> Am 06.11.2011 15:13, schrieb dmitry boyarintsev:
>>> Hi-jacking, the thread, and again should FPC chase Delphi forever?
>> You mix here result and goal. If FPC supports new Delphi constructs
>> depends on the fact if somebody provides a patch. No more, no less.
>
> I have the same feeling as Dmitry: There must be a time when FPC does
> not run after Delphi. Why not now?

Feel free to start a fork and we will see what will make it into trunk.

> Other changes were rejected too.

Yes. We reject patches to turn FPC into an OS, a C compiler or a coffee
machine. No, wait, I think we would accept the last one.

>
>
>> Just as an example: if somebody provides patches to support Extended
>> Pascal, FPC will support Extended Pascal, nobody did so in >15 years.
>> Result: FPC supports no Extended Pascal features.
>
> Actually the question is: *If* someone is investing time into something
> is this a useful investment? Or wouldn't it be be better to invest this
> time into other things, i.e. bug fixes?

This is everybody's decision. You decided also to write a lengthy mail
instead of submitting a patch to a bug report as well while the patch
would be much more usefull in my eyes.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Jürgen Hestermann
Florian Klämpfl schrieb:
 >> I have the same feeling as Dmitry: There must be a time when FPC does
 >> not run after Delphi. Why not now?
 > Feel free to start a fork and we will see what will make it into trunk.

Sorry, but I don't know what you are talking about. Isn't it you (and a
few others) who decide what becomes part of FPC? It's not a democratic
vote, isn't it?


 >> Other changes were rejected too.
 > Yes. We reject patches to turn FPC into an OS, a C compiler or a coffee
 > machine. No, wait, I think we would accept the last one.

But *you* are deciding this, not?


 > This is everybody's decision. You decided also to write a lengthy mail
 > instead of submitting a patch to a bug report as well while the patch
 > would be much more usefull in my eyes.

Sorry, I don't know how to submit a patch. Forgive me if I am not on the
same knowledge level as you on FPC.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Jonas Maebe-2

On 06 Nov 2011, at 19:21, Jürgen Hestermann wrote:

> Florian Klämpfl schrieb:
> >> I have the same feeling as Dmitry: There must be a time when FPC does
> >> not run after Delphi. Why not now?
> > Feel free to start a fork and we will see what will make it into trunk.
>
> Sorry, but I don't know what you are talking about. Isn't it you (and a few others) who decide what becomes part of FPC? It's not a democratic vote, isn't it?

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.

> I don't know how to submit a patch.

http://wiki.freepascal.org/Creating_A_Patch (it was written for Lazarus, but it works pretty much the same with FPC)


Jonas_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Florian Klämpfl
In reply to this post by Jürgen Hestermann
Am 06.11.2011 19:21, schrieb Jürgen Hestermann:
> Florian Klämpfl schrieb:
>>> I have the same feeling as Dmitry: There must be a time when FPC does
>>> not run after Delphi. Why not now?
>> Feel free to start a fork and we will see what will make it into trunk.
>
> Sorry, but I don't know what you are talking about. Isn't it you (and a
> few others) who decide what becomes part of FPC? It's not a democratic
> vote, isn't it?

Will you organize democratic votes in the future on rejected patches?

Remember though, there is something like a consititution:
- FPC is a pascal compiler written in pascal.
- Patches may break old code as little as possible and cause no
regressions in the regression tests.

If you don't like this, you should fork FPC. Though we can discuss to
change the first sentence into
- FPC is a compiler  written in pascal for wirthian languages.
But to do so, somebody has really to prove it's commitment over years.

>
>
>>> Other changes were rejected too.
>> Yes. We reject patches to turn FPC into an OS, a C compiler or a coffee
>> machine. No, wait, I think we would accept the last one.
>
> But *you* are deciding this, not?

Yes, because nobody did yet volunteer to setup and maintain the
structure to organize votes on rejected patches. Probably also because
their number is too low.

>
>
>> This is everybody's decision. You decided also to write a lengthy mail
>> instead of submitting a patch to a bug report as well while the patch
>> would be much more usefull in my eyes.
>
> Sorry, I don't know how to submit a patch. Forgive me if I am not on the
> same knowledge level as you on FPC.

Read the handbook of your browser how to upload files if a website
contains such a field. Then go to the issue report in the bug tracker
and upload the patch.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Martin Schreiber-2
In reply to this post by Jürgen Hestermann

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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Jonas Maebe-2

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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Martin Schreiber-2

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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Jonas Maebe-2

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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Luiz Americo Pereira Camara
In reply to this post by Martin Schreiber-2
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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Martin Schreiber-2

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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Delphi's anonymous functions in Free Pascal

Jürgen Hestermann
In reply to this post by Jonas Maebe-2
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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
1234567