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

2011-10-20 Thread Sven Barth
Am 19.10.2011 23:28, schrieb Andrew Pennebaker: From what I gather, procedure variables can indeed be referenced and passed around, etc. However, procedures do not return anything, so it's hard to chain them. In functional languages, it's handy to do several nested map(map(map f ... calls.

Re: [fpc-pascal] How can I implement thrice in Free Pascal?

2011-10-20 Thread Sven Barth
Am 19.10.2011 20:08, schrieb Andrew Pennebaker: Right, I tried just {$mode delphi} and just generic, and when both failed I tried them at the same time. Maybe I'm not using a recent enough version? Free Pascal Compiler version 2.4.4 [2011/05/01] for i386 That's why I said trunk. Trunk is the

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

2011-10-20 Thread Felipe Monteiro de Carvalho
On Wed, Oct 19, 2011 at 11:28 PM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: However, procedures do not return anything, so it's hard to chain them. In functional languages, it's handy to do several nested map(map(map f ... calls. So just make a function instead of a procedure? --

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

2011-10-20 Thread Florian Klaempfl
Am 19.10.2011 23:28, schrieb Andrew Pennebaker: From what I gather, procedure variables can indeed be referenced and passed around, etc. However, procedures do not return anything, so it's hard to chain them. They are called procedure variables but can also contain functions. In functional

[fpc-pascal] Unicode function names

2011-10-20 Thread Mark Morgan Lloyd
Out of curiosity, I've just tried creating a function named ⍳ (Unicode character 2373, i.e. the APL iota function). FPC trunk complains Fatal: illegal character '�' ($E2) What is the rule here- functions must be entirely ANSI or functions must start with ANSI? -- Mark Morgan Lloyd markMLl

Re: [fpc-pascal] Unicode function names

2011-10-20 Thread michael . vancanneyt
On Thu, 20 Oct 2011, Mark Morgan Lloyd wrote: Out of curiosity, I've just tried creating a function named ⍳ (Unicode character 2373, i.e. the APL iota function). FPC trunk complains Fatal: illegal character '???' ($E2) What is the rule here- functions must be entirely ANSI or functions

Re: [fpc-pascal] Unicode function names

2011-10-20 Thread Sven Barth
Am 20.10.2011 10:04, schrieb michael.vancann...@wisa.be: On Thu, 20 Oct 2011, Mark Morgan Lloyd wrote: Out of curiosity, I've just tried creating a function named ⍳ (Unicode character 2373, i.e. the APL iota function). FPC trunk complains Fatal: illegal character '???' ($E2) What is the

Re: [fpc-pascal] Unicode function names

2011-10-20 Thread Mark Morgan Lloyd
Sven Barth wrote: Am 20.10.2011 10:04, schrieb michael.vancann...@wisa.be: On Thu, 20 Oct 2011, Mark Morgan Lloyd wrote: Out of curiosity, I've just tried creating a function named ⍳ (Unicode character 2373, i.e. the APL iota function). FPC trunk complains Fatal: illegal character '???'

Re: [fpc-pascal] How can I implement thrice in Free Pascal?

2011-10-20 Thread Andrew Pennebaker
2.6, eh? Awesome. I'm using the SVN trunk, but it's not working for me for some reason. I'll just wait for v2.6 then. Cheers, Andrew Pennebaker www.yellosoft.us On Thu, Oct 20, 2011 at 2:19 AM, Sven Barth pascaldra...@googlemail.comwrote: Am 19.10.2011 20:08, schrieb Andrew Pennebaker:

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

2011-10-20 Thread Gregory M. Turner
- Original Message - Am 19.10.2011 20:23, schrieb Andrew Pennebaker: Practical uses for referencable anonymous functions: For such applications one uses procedure variables in pascal. (map (lambda (x) (+ x 1)) '(1 2 3)) - (2 3 4) [snip!] I still don't see why this cannot

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

2011-10-20 Thread Florian Klämpfl
Am 20.10.2011 21:09, schrieb Gregory M. Turner: Interesting discussion -- at least for me, I didn't know Delphi had this feature. In case anyone really doesn't see the point, consider that this thing: http://www.youtube.com/watch?v=cYw2ewoO6c4 has all the capabilities of Object

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

2011-10-20 Thread Gregory M. Turner
- Original Message - Am 20.10.2011 21:09, schrieb Gregory M. Turner: In case anyone really doesn't see the point, consider that this thing: http://www.youtube.com/watch?v=cYw2ewoO6c4 If anybody does not see why increasing complexity without a good reason should be

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

2011-10-20 Thread Juha Manninen
2011/10/20 Florian Klämpfl flor...@freepascal.org If anybody does not see why increasing complexity without a good reason should be avoided, I recommend: http://www.youtube.com/watch?v=kYUrqdUyEpI :-) There is lots of confusion about anonymous functions. The name is misleading, they are

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

2011-10-20 Thread Florian Klämpfl
Am 20.10.2011 22:31, schrieb Juha Manninen: They have some very important uses, like making multithreading easier. I copy text from Delphi help page again here because it looks so cool: The same can be done with fpc (nested if needed) procedure variables and it will be more readable (imo)?

Re: [fpc-pascal] Why do string indices start at 1, but array indices start at 0?

2011-10-20 Thread Andrew Haines
On 10/20/11 17:43, Andrew Pennebaker wrote: It's inconsistent and ripe for bugs. Cheers, Andrew Pennebaker www.yellosoft.us http://www.yellosoft.us ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Why do string indices start at 1, but array indices start at 0?

2011-10-20 Thread Tomas Hajny
On 20 Oct 11, at 17:43, Andrew Pennebaker wrote: It's inconsistent and ripe for bugs. Array indices may start at any ordinal value (including e.g. characters, values of enumerated types, etc.), not just 0. Only dynamic arrays always start at 0 because that is how they have been imported from

Re: [fpc-pascal] How can I implement thrice in Free Pascal?

2011-10-20 Thread waldo kitty
On 10/20/2011 11:08, Andrew Pennebaker wrote: 2.6, eh? Awesome. I'm using the SVN trunk, but it's not working for me for some reason. this is why the latest version of the compiler, 2.4.4 is the one supported ;) I'll just wait for v2.6 then. always another possibility... depending on the

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

2011-10-20 Thread waldo kitty
On 10/20/2011 15:17, Florian Klämpfl wrote: Am 20.10.2011 21:09, schrieb Gregory M. Turner: Interesting discussion -- at least for me, I didn't know Delphi had this feature. In case anyone really doesn't see the point, consider that this thing: http://www.youtube.com/watch?v=cYw2ewoO6c4

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

2011-10-20 Thread waldo kitty
On 10/20/2011 16:35, Juha Manninen wrote: 2011/10/20 Gregory M. Turner g...@malth.us mailto:g...@malth.us Good point. I guess nothing's O(free lunch). Yes, the downside here is that the concept is very different from any syntax in OP. It will be difficult to learn properly. i still

Re: [fpc-pascal] Why do string indices start at 1, but array indices start at 0?

2011-10-20 Thread waldo kitty
On 10/20/2011 17:43, Andrew Pennebaker wrote: It's inconsistent and ripe for bugs. funny thing, that... i thought the same thing when looking at the proposals and requests :LOL: ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Format() directives

2011-10-20 Thread waldo kitty
On 10/20/2011 17:47, Andrew Pennebaker wrote: In the future, could Format respect the difference between '%x' and '%X'? It's useful to use the former for lowercase hexadecimal. please forgive the stoopid question but, is there any real difference? in hex, f00 is the same as F00, isn't it??

Re: [fpc-pascal] Format() directives

2011-10-20 Thread Andrew Pennebaker
Correct. But some systems expect hex input in lowercase, and some expect it in uppercase. It would be nice if Format('%x', [s]) and Format('%X', [s]) allowed this kind of customization. For now, AnsiLowerCase(Format('%X', [s]) is a workaround. Cheers, Andrew Pennebaker www.yellosoft.us On Thu,

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

2011-10-20 Thread Andrew Pennebaker
If anybody does not see why increasing complexity without a good reason should be avoided, I recommend: http://www.youtube.com/watch?v=kYUrqdUyEpI Lisp used for nuclear fail-safe

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

2011-10-20 Thread Jürgen Hestermann
Florian Klämpfl schrieb: If anybody does not see why increasing complexity without a good reason should be avoided, I recommend: I agree wholeheartly. In the past Pascal was a simple still powerfull language but meanwhile it has become a catchment tank for all features of all other