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

2012-08-30 Thread Marco van de Voort
In our previous episode, Sven Barth said: > > The closures (or anonymous functions as they are called in Delphi) are > missing, because none of the developers has them on the important slots > of the todo lists. So as long as nobody comes and implements them then > they are not going to be impl

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Graeme Geldenhuys
On 30/08/12 17:07, Jonas Maebe wrote: Turbo Pascal does not support the "result" alias for the function result. Yup, I can confirm that. I just tested with Turbo Pascal 5.5 :) Wow, that brought back memories. Graeme. ___ fpc-pascal maillist -

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

2012-08-30 Thread Jürgen Hestermann
Am 2012-08-30 18:29, schrieb Ralf A. Quint: > Pascal has evolved since Wirth's original design back in the 70s This is true. But there are two aspects of the Pascal extensions of the last years (decades) that contradict with what I would call the "spirit of Pascal": 1.) Many "extensions" add to

Re: [fpc-pascal] Re: Editing resource of executable

2012-08-30 Thread Krzysztof
Thanks to all! ___ 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

2012-08-30 Thread Sven Barth
On 30.08.2012 11:03, Arioch wrote: But afterall i am quitting on that. Since FPC are lacking closures i am sure here are mostly people who personally dislike them. I wanted to document why closures are good and do matter. Hopefully i did it to the extent i was able to. Surely i would not be able

[fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Reinier Olislagers
On 30-8-2012 18:44, Rainer Stratmann wrote: > Am Thursday 30 August 2012 18:28:41 schrieb Tomas Hajny: >> I >> do not say that it is wrong to be more helpful in error messages, but >> rather that your proposal tries to "fix" a very small fragment of >> something much more general and moreover that

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Mark Morgan Lloyd
Rainer Stratmann wrote: Am Thursday 30 August 2012 18:07:13 schrieb Jonas Maebe: On 30 Aug 2012, at 17:14, Rainer Stratmann wrote: TP for DOS at least supports a function result (as I remember) thus it is not Delphi only as you mention. Turbo Pascal does not support the "result" alias for the

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Rainer Stratmann
Am Thursday 30 August 2012 18:28:41 schrieb Tomas Hajny: > I > do not say that it is wrong to be more helpful in error messages, but > rather that your proposal tries to "fix" a very small fragment of > something much more general and moreover that the proposed message may be > very easily mislead

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

2012-08-30 Thread Jorge Aldo G. de F. Junior
I still fail to see where annonymous functions could succeed where functional types (part of pascal since last millenia) wouldnt... 2012/8/30 Ralf A. Quint : > At 01:18 AM 8/30/2012, Arioch wrote: > >> tcoq wrote >> > >> > a laziness to software design: what you can't name you actually don't >> >

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

2012-08-30 Thread Ralf A. Quint
At 01:18 AM 8/30/2012, Arioch wrote: tcoq wrote > > a laziness to software design: what you can't name you actually don't > design... > Guess you meant "don't want to" instead of "can't" And You mean all the non-named arrays, don't you. "var x: array[0..10] of integer; " is not only violating

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Tomas Hajny
On Thu, August 30, 2012 17:14, Rainer Stratmann wrote: > Am Thursday 30 August 2012 16:50:30 schrieb Tomas Hajny: >> > The scenario occures when someone starts freepascal as I already >> > documented in >> > my first E-Mail. >> > >> > When someone wants to compile a TurboPascal or Delphi program wi

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Rainer Stratmann
Am Thursday 30 August 2012 18:07:13 schrieb Jonas Maebe: > On 30 Aug 2012, at 17:14, Rainer Stratmann wrote: > > TP for DOS at > > least supports a function result (as I remember) thus it is not Delphi > > only as you mention. > > Turbo Pascal does not support the "result" alias for the function re

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Jonas Maebe
On 30 Aug 2012, at 17:14, Rainer Stratmann wrote: > TP for DOS at > least supports a function result (as I remember) thus it is not Delphi only > as you mention. Turbo Pascal does not support the "result" alias for the function result. > What's wrong with such a message that is easy to implem

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Mark Morgan Lloyd
Mark Morgan Lloyd wrote: Rainer Stratmann wrote: TP for DOS at least supports a function result (as I remember) thus it is not Delphi only as you mention. It supports a function result, but it doesn't IIRC treat 'result' as a special identifier. Delphi /has/ to have 'result', since otherwise

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Rainer Stratmann
Am Thursday 30 August 2012 17:46:09 schrieb Mark Morgan Lloyd: > Rainer Stratmann wrote: > > I am not familiar with the compilers soucecode. > > > > I don't think that it is that difficult to implement. > > Those two statements are contradictory. I've previously raised issues > related to command-l

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Mark Morgan Lloyd
Rainer Stratmann wrote: I am not familiar with the compilers soucecode. I don't think that it is that difficult to implement. Those two statements are contradictory. I've previously raised issues related to command-line options and error messages, and had the issues patiently explained to

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Mark Morgan Lloyd
Rainer Stratmann wrote: TP for DOS at least supports a function result (as I remember) thus it is not Delphi only as you mention. It supports a function result, but it doesn't IIRC treat 'result' as a special identifier. Delphi /has/ to have 'result', since otherwise redefining standard ope

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Rainer Stratmann
Am Thursday 30 August 2012 16:50:30 schrieb Tomas Hajny: > > The scenario occures when someone starts freepascal as I already > > documented in > > my first E-Mail. > > > > When someone wants to compile a TurboPascal or Delphi program with > > freepascal. > > Then he already knows that result is a

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Tomas Hajny
On Thu, August 30, 2012 15:08, Rainer Stratmann wrote: > Am Thursday 30 August 2012 14:39:06 schrieb leledumbo: >> Since this behavior is documented, one should read the documentation >> first: >> http://www.freepascal.org/docs-html/ref/refse76.html > > There is much documentation spread over many

[fpc-pascal] Re: Editing resource of executable

2012-08-30 Thread Reinier Olislagers
On 30-8-2012 16:27, Jonas Maebe wrote: > > Krzysztof wrote on Thu, 30 Aug 2012: > >> Hmm sounds good. So I can normally open another exec in for example >> TFileStream and write something at the end and this exec run without >> error? > > Yes. Do keep in mind that the original exe has to be able

Re: [fpc-pascal] Re: Editing resource of executable

2012-08-30 Thread Jonas Maebe
Krzysztof wrote on Thu, 30 Aug 2012: Hmm sounds good. So I can normally open another exec in for example TFileStream and write something at the end and this exec run without error? Yes. Do keep in mind that the original exe has to be able to find the length of the data you appended to it. S

Re: [fpc-pascal] Re: Editing resource of executable

2012-08-30 Thread Krzysztof
Hmm sounds good. So I can normally open another exec in for example TFileStream and write something at the end and this exec run without error? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pa

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Rainer Stratmann
Am Thursday 30 August 2012 15:59:12 schrieb Reinier Olislagers: > On 30-8-2012 15:49, Rainer Stratmann wrote: > > Am Thursday 30 August 2012 15:33:36 schrieb Reinier Olislagers: > >> On 30-8-2012 15:08, Rainer Stratmann wrote: > >>> Am Thursday 30 August 2012 14:39:06 schrieb leledumbo: > Sinc

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Reinier Olislagers
On 30-8-2012 15:49, Rainer Stratmann wrote: > Am Thursday 30 August 2012 15:33:36 schrieb Reinier Olislagers: >> On 30-8-2012 15:08, Rainer Stratmann wrote: >>> Am Thursday 30 August 2012 14:39:06 schrieb leledumbo: Since this behavior is documented, one should read the documentation firs

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Rainer Stratmann
Am Thursday 30 August 2012 15:33:36 schrieb Reinier Olislagers: > On 30-8-2012 15:08, Rainer Stratmann wrote: > > Am Thursday 30 August 2012 14:39:06 schrieb leledumbo: > >> Since this behavior is documented, one should read the documentation > >> first: http://www.freepascal.org/docs-html/ref/refs

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Rainer Stratmann
Am Thursday 30 August 2012 15:20:46 schrieb Mark Morgan Lloyd: > > When someone wants to compile a TurboPascal or Delphi program with > > freepascal. Then he already knows that result is a function result, but > > freepascal gives an error about this. > > I agree. However I don't know whether a bla

[fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Reinier Olislagers
On 30-8-2012 15:08, Rainer Stratmann wrote: > Am Thursday 30 August 2012 14:39:06 schrieb leledumbo: >> Since this behavior is documented, one should read the documentation first: >> http://www.freepascal.org/docs-html/ref/refse76.html > > There is much documentation spread over many servers. I do

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Mark Morgan Lloyd
Rainer Stratmann wrote: Am Thursday 30 August 2012 14:39:06 schrieb leledumbo: Since this behavior is documented, one should read the documentation first: http://www.freepascal.org/docs-html/ref/refse76.html There is much documentation spread over many servers. Anyway, how could one find tha

Re: [fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread Rainer Stratmann
Am Thursday 30 August 2012 14:39:06 schrieb leledumbo: > Since this behavior is documented, one should read the documentation first: > http://www.freepascal.org/docs-html/ref/refse76.html There is much documentation spread over many servers. > Anyway, how could one find that Result is used as fun

Re: [fpc-pascal] Re: Editing resource of executable

2012-08-30 Thread Jonas Maebe
Krzysztof wrote on Thu, 30 Aug 2012: Maybe I can write own commandline tool for server admins, which can edit resource of another (written in FPC too) executable? I think the easiest is to add the data at the end of the binary, as has been suggested earlier. It breaks signed applications, b

Re: [fpc-pascal] Re: Editing resource of executable

2012-08-30 Thread Krzysztof
Maybe I can write own commandline tool for server admins, which can edit resource of another (written in FPC too) executable? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: Identifier not found "result"

2012-08-30 Thread leledumbo
Since this behavior is documented, one should read the documentation first: http://www.freepascal.org/docs-html/ref/refse76.html Anyway, how could one find that Result is used as function result without reading the docs? -- View this message in context: http://free-pascal-general.1045716.n5.na

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

2012-08-30 Thread Marco van de Voort
In our previous episode, michael.vancann...@wisa.be said: > >> From personal experience, when i first time saw how pascalish is closures > > implementation in Delphi i just admired the ease in which that concept was > > fused into the language of very different style built upon very different > > i

[fpc-pascal] Re: Editing resource of executable

2012-08-30 Thread Reinier Olislagers
On 30-8-2012 10:07, Mark Morgan Lloyd wrote: > Krzysztof wrote: > everything is in one file (and must be). My question is, exists any >> commandline tool which can edit executable file for edit some resource >> (like ResEdit or Restorator for Windows) which can be used by http >> server? > > Let's

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

2012-08-30 Thread tcoq
Thank you but I am a professional trainer for C++, Java, Ada and other languages including Lisp. I am "used to" those languages. I consistently see young professionals stumble upon those constructs they are "used to". Furthermore, all the professional users of the developed software are not "use

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

2012-08-30 Thread michael . vancanneyt
On Thu, 30 Aug 2012, Arioch wrote: From personal experience, when i first time saw how pascalish is closures implementation in Delphi i just admired the ease in which that concept was fused into the language of very different style built upon very different ideas. It was so elegant when rea

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

2012-08-30 Thread Arioch
> Regarding this: I wish to stress that my views on lambdas or closures are my own; For what i understand, those are different things. Lambdas are runtime code generators and are out of question for natively compiled language. Closures are not. Maybe that is nitpicking today, since the names seems

Re: [fpc-pascal] GDB help needed please

2012-08-30 Thread Graeme Geldenhuys
On 29/08/12 23:23, Jonas Maebe wrote: The first thing you can try is to compile with -gh, hoping that it will abort in a place closer to the cause of the problem. -CRr is also a very useful debugging switch. Thanks for the detailed information. The bug is not fixed yet, but I did eventually

[fpc-pascal] Identifier not found "result"

2012-08-30 Thread Rainer Stratmann
This bevaviour is likely when someone starts with fpc, because the default mode is Free Pascal (-Mfpc). Wouldn't it be good to give an additional suggestion if the identifyer ist result and the mode is -Mfpc? For example: Identifier not found "result", may could be resolved with other syntax

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

2012-08-30 Thread michael . vancanneyt
On Thu, 30 Aug 2012, Arioch wrote: If the new features conform to the readability [snip] But afterall i am quitting on that. Since FPC are lacking closures i am sure here are mostly people who personally dislike them. I wanted to document why closures are good and do matter. Hopefully i

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

2012-08-30 Thread Arioch
Pascal never was a toy language. It always have too much required naming-and-declarations/boilerplate/obstacles/you-name-it Basic, Logo - let them be. But not the Pascal. It was educational language but it was damn serious educational language. However i believe that your "but pointer math" is

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

2012-08-30 Thread Arioch
>> "var x: array[0..10] of integer; " also is twice lazy. >> type >> SomeEnumSemanticName = 0..10; >> SomeEnumMapSemanticName = array[SomeEnumSemanticName] of integer; >> var x: SomeEnumMapSemanticName; > Except that not defining a distinct type emphasises that the array is > only bein

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

2012-08-30 Thread Lukasz Sokol
On 30/08/2012 09:04, Arioch wrote: > > Ralf A. Quint wrote >> >> At 12:09 AM 8/30/2012, michael.vancanneyt@ wrote: >>> They are IMHO a negation of what pascal stands for. If your >>> programming >> +1 >> > > Well, the same should be told about everything modern pascal is. > > Open and dynamic

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

2012-08-30 Thread Arioch
> If the new features conform to the readability That heavily depends upon which patterns are known to reader. We all are patterns recognizers. And today world is very different. In my example sketch, the calling like "Data.Filter( _.TotalSale > 20 )" is concise and easy to understand. Okay, gi

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

2012-08-30 Thread Mark Morgan Lloyd
Arioch wrote: tcoq wrote a laziness to software design: what you can't name you actually don't design... Guess you meant "don't want to" instead of "can't" And You mean all the non-named arrays, don't you. "var x: array[0..10] of integer; " is not only violating Pascal Report, but also is tw

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

2012-08-30 Thread tcoq
No, "can't" is the correct word. In Pascal, one should have the ability to name the constructs one uses. For example, i like very much the ability to name my own Event types: "type TOnMyEvent = procedure(aStr: string) of object;". Or my Exception types. Thinking about the event name usually helps

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

2012-08-30 Thread michael . vancanneyt
On Thu, 30 Aug 2012, Arioch wrote: Ralf A. Quint wrote At 12:09 AM 8/30/2012, michael.vancanneyt@ wrote: They are IMHO a negation of what pascal stands for. If your programming +1 Well, the same should be told about everything modern pascal is. Open and dynamic arrays, pointer math, o

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

2012-08-30 Thread Arioch
tcoq wrote > > a laziness to software design: what you can't name you actually don't > design... > Guess you meant "don't want to" instead of "can't" And You mean all the non-named arrays, don't you. "var x: array[0..10] of integer; " is not only violating Pascal Report, but also is twice lazy

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

2012-08-30 Thread tcoq
I beg to differ. Read Niklaus' work on why he created Pascal: two objectives stand out : readability and ease-of-compiling. He wrote explicitly he wanted a language he could easily write his compiler in... Sorry rigidity is not part of the original Pascal mandate. Look at Modula and the more re

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

2012-08-30 Thread Arioch
Sven Barth-2 wrote > > Am 29.08.2012 22:56 schrieb "Arioch" : > I don't know whether you tested recent versions of FPC, but since 2.6.0 > the > support for Delphi compatible generics improved, though generic > functions/methods and constraints are still missing. > Thanks. No, i just

Re: [fpc-pascal] Editing resource of executable

2012-08-30 Thread Mark Morgan Lloyd
Krzysztof wrote: Hi, I have some problem. Example: I created some exec using free pascal and lazarus. It is placed on http server. User in webbrowser click download, and server should attach link from where it is clicked into this exec. So when user run downloaded exec, this exec can read this

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

2012-08-30 Thread Arioch
Ralf A. Quint wrote > > At 12:09 AM 8/30/2012, michael.vancanneyt@ wrote: >>They are IMHO a negation of what pascal stands for. If your programming > +1 > Well, the same should be told about everything modern pascal is. Open and dynamic arrays, pointer math, objects, generics, even units. It w

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

2012-08-30 Thread tcoq
+1 - anonymous functions demonstrate a laziness to software design: what you can't name you actually don't design... - Mail original - De: "Ralf A. Quint" À: "FPC-Pascal users discussions" Envoyé: Jeudi 30 Août 2012 09:26:27 Objet: Re: [fpc-pascal] Re: Delphi's anonymous functions in Fr

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

2012-08-30 Thread Arioch
> I'm curious: where do you get this 1948 date from? I'm not even sure > that assemblers (as we know them) existed in 1949... > Mark Morgan Lloyd Damn! you're definitely right. At vwery very least Pascal could not be before Algol-68, which could not be before... ahem. But now I wonder myself

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

2012-08-30 Thread Ralf A. Quint
At 12:09 AM 8/30/2012, michael.vancann...@wisa.be wrote: I don't think anonymous functions should be added to the compiler at all. They are IMHO a negation of what pascal stands for. If your programming style is so strange that you need lamba functions or anonymous functions, then Pascal is simp

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

2012-08-30 Thread michael . vancanneyt
On Wed, 29 Aug 2012, Arioch wrote: Florian Klämpfl wrote This is the prototypical way to run a function over each element in a collection, returning the results. (map (lambda (x) (+ x 1)) '(1 2 3)) -> (2 3 4) I still don't see why this cannot be done by procedure variables: one can eas