Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Jürgen Hestermann
Timothy Groves schrieb: Can anyone think of a situation in which you would *have* to use forward declared functions? I'm trying to come up with an example for such for my book, and I am drawing a blank. Well, maybe this one: ---

[fpc-pascal] Darwin i386 socket polling

2011-12-22 Thread Andrew Brunner
I'm needing to figure out how socket signaling mechanisms work under darwin. Windows and Linux work, Darwin however does not support ePoll. Anyone have any experience with Sockets events under OSX i386? Thanks. ___ fpc-pascal maillist - fpc-pascal@li

Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Rich Saunders
On 12/22/11 5:21 PM, Tony Whyman wrote: > [explanation snipped] Why do you need a deeper explanation? He is not asking for an explanation. (I think he knows what it is and can see why it might be useful.) He is asking for a compelling example as a use case that illustrates the need for this langua

Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Tony Whyman
You could apply the same logic to the Pascal "label" statement. You can (and should) always use a different construct and you could therefore claim that the "label" statement is unnecessary because you cannot think of a situation where there is no alternative - but it exists. And sometimes it is c

Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Rainer Stratmann
Am Thursday 22 December 2011 22:04:34 schrieb Anton Shepelev: >Fward  decla- >rations  are  necessary to allow mutually recur- >sive procedures and functions that are not nest- >ed. Forward declarations are the only option in special situations: If your program is huge and you only have this optio

Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Timothy Groves
On 11-12-22 04:04 PM, Anton Shepelev wrote: But are "mutually recursive procedures and functions" necessary? Not at all. But there is no other reason to use forward-declared procedures that I can think of, and I need *something* to demonstrate why you might need them.

Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Timothy Groves
On 11-12-22 04:15 PM, Mark Morgan Lloyd wrote: However, there's probably still a way round that in a unit, by moving the first mention of one of those into the definition part. Or similarly you might be able to avoid it by using object definitions. Absolutely. Because in both of those cases,

Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Mark Morgan Lloyd
Timothy Groves wrote: Can anyone think of a situation in which you would *have* to use forward declared functions? I'm trying to come up with an example for such for my book, and I am drawing a blank. Classic recursive-descent parser? An expression is a sequence of terms, a term is a sequenc

Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Anton Shepelev
Timothy Groves: > Can anyone think of a situation in which you would > *have* to use forward declared functions? I'm > trying to come up with an example for such for my > book, and I am drawing a blank. Pascal User Manual and Report says: Procecure (function) identifiers may be used be

Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Mattias Gaertner
On Thu, 22 Dec 2011 15:33:13 -0500 Timothy Groves wrote: > Can anyone think of a situation in which you would *have* to use forward > declared functions? I'm trying to come up with an example for such for > my book, and I am drawing a blank. Traverse a html tree. For example with div and p no

Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Michael Fuchs
Am 22.12.2011 21:37, schrieb Rainer Stratmann: > procedure fwproc; forward; > > procedure myprocedure; > begin > fwproc; > end; > > procedure fwproc; > begin > > end; Bad example, in this case there is no need for implementing fwproc after myprocedure. g Michael __

Re: [fpc-pascal] Forward declarations

2011-12-22 Thread Rainer Stratmann
Am Thursday 22 December 2011 21:33:13 schrieb Timothy Groves: > Can anyone think of a situation in which you would *have* to use forward > declared functions? I'm trying to come up with an example for such for > my book, and I am drawing a blank. > ___ >

[fpc-pascal] Forward declarations

2011-12-22 Thread Timothy Groves
Can anyone think of a situation in which you would *have* to use forward declared functions? I'm trying to come up with an example for such for my book, and I am drawing a blank. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists

Re: [fpc-pascal] using exceptions

2011-12-22 Thread Marcos Douglas
On Thu, Dec 22, 2011 at 4:17 PM, Anton Shepelev wrote: > Marcos Douglas: > >> It's  not  difficult,  but is boring have always a >> parameter or function return to return  an  error, >> and  have  to  verify  if error then... if not er- >> ror...  if error and error then... etc > > If you mean hav

Re: [fpc-pascal] using exceptions

2011-12-22 Thread Anton Shepelev
Marcos Douglas: > It's not difficult, but is boring have always a > parameter or function return to return an error, > and have to verify if error then... if not er- > ror... if error and error then... etc If you mean having to write nested IFs to check all the errors, then there are

Re: [fpc-pascal] using exceptions

2011-12-22 Thread Bart
On 12/22/11, nore...@z505.com wrote: > You don't see as much Try Except, it's more Try Finally. People ignore the > exceptions because it's an accepted thing to do. Then the end user of the > application gets a strange exception message instead of a user friendly > one. For example, if a file is

Re: [fpc-pascal] FPC for ARM

2011-12-22 Thread Marco van de Voort
In our previous episode, Juha Manninen said: > I ran "apt-get install binutils" in the already installed Ubuntu and it > worked. > I have understood ARM also supports many instruction sets like Thumb and > Thumb-2. > I have no idea which one is running now, but it is not important because it > work

Re: [fpc-pascal] FPC for ARM

2011-12-22 Thread Juha Manninen
2011/12/19 Marco van de Voort > FreeBSD and Linux x86 and x86_64 have internal assembler, but not linker. > Though the FreeBSD/x86_64 internal assembler is only enable in trunk afaik. > > Be careful with binutils on ARM though, there are multiple ABIs, and the > installed ones must match the devi

Re: [fpc-pascal] Contributed units on freepascal site

2011-12-22 Thread Graeme Geldenhuys
On 22 December 2011 16:00, Marco van de Voort wrote: > > It worked fine for me in Mozilla, but after I saw your user-agent, I tried > MSIE (9.0) and while I don't get any error messages, nothing shows. I can confirm that it works with Opera, Firefox and Chrome browsers. -- Regards,   - Graem

Re: [fpc-pascal] Contributed units on freepascal site

2011-12-22 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: > > The location of the page changed, and there's an "alternative" link > > available on the front page of http://www.freepascal.org under "Contributed > > units". > > While we are there. The "Toolbox" sponsor logo on the right. The > Toolbox Magazi

Re: [fpc-pascal] Contributed units on freepascal site

2011-12-22 Thread Marco van de Voort
In our previous episode, dhkblas...@zeelandnet.nl said: > > > > The > location of the page changed, and there's an "alternative" link > available on the front page of http://www.freepascal.org [2] under > "Contributed units". > > Well, that is exactly the link I'm talking about. > Clicking on thi

Re: [fpc-pascal] Contributed units on freepascal site

2011-12-22 Thread Graeme Geldenhuys
On 22 December 2011 15:40, Jonas Maebe wrote: > > The location of the page changed, and there's an "alternative" link > available on the front page of http://www.freepascal.org under "Contributed > units". Something else. The new page looks nice, but you can't select text and do copy-and-paste? A

Re: [fpc-pascal] Contributed units on freepascal site

2011-12-22 Thread dhkblaszyk
On 22 dec '11, Jonas Maebe wrote: > On 22 Dec 2011, at 14:37, dhkblas...@zeelandnet.nl [1]wrote: > >> The contributed unit section on the freepascal site does not work anymore. Can someone please have a look and fix this? Is there an alternative link available? > > The location of the page

Re: [fpc-pascal] Contributed units on freepascal site

2011-12-22 Thread Graeme Geldenhuys
On 22 December 2011 15:40, Jonas Maebe wrote: > > The location of the page changed, and there's an "alternative" link > available on the front page of http://www.freepascal.org under "Contributed > units". While we are there. The "Toolbox" sponsor logo on the right. The Toolbox Magazine has been s

Re: [fpc-pascal] Contributed units on freepascal site

2011-12-22 Thread Jonas Maebe
On 22 Dec 2011, at 14:37, dhkblas...@zeelandnet.nl wrote: The contributed unit section on the freepascal site does not work anymore. Can someone please have a look and fix this? Is there an alternative link available? The location of the page changed, and there's an "alternative" link avail

[fpc-pascal] Contributed units on freepascal site

2011-12-22 Thread dhkblaszyk
The contributed unit section on the freepascal site does not work anymore. Can someone please have a look and fix this? Is there an alternative link available? Regards, Darius ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread Felipe Monteiro de Carvalho
On Thu, Dec 22, 2011 at 11:04 AM, zeljko wrote: > I would try with it before reinventing wheel, because it works on all X11 > platforms (even on OS/2 and BeOS) and I'm pretty sure that it's installed by > default. Interresting, but I don't think it will be necessary ... in rev 34359 I commited su

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread Graeme Geldenhuys
On 22 December 2011 11:50, Henry Vermaak wrote: > > Perhaps you should try powertop. Thanks for this. I never knew about powertop. I just ran it for a few minutes. A fpGUI base app in idle rates 6th in the "top causes for wakeups" on my system - rated at 4% of total processes running. I have no

Re: [fpc-pascal] using exceptions

2011-12-22 Thread Marcos Douglas
On Wed, Dec 21, 2011 at 10:29 PM, wrote: > Marcos wrote: >> I use Exceptions to check the integrity of classes. I have one >> Exception for each class (E), most of the time. > > > Another problem with errors is that sometimes it is hard for a class to > return errors. In procedural programming yo

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread Jonas Maebe
On 22 Dec 2011, at 10:39, Graeme Geldenhuys wrote: On 21 December 2011 18:26, Felipe Monteiro de Carvalho <...> wrote: I tested with top and it doesn't even show my application in the top 20 users of CPU. I was just about to mention that, and would have been very surprised if it did show CPU

Re: [fpc-pascal] inline and other modifiers

2011-12-22 Thread Jonas Maebe
On 22 Dec 2011, at 02:27, nore...@z505.com wrote: Another thing freepascal allows is for OVERLOAD to be declared one place but not the other. Delphi is more strict in this regard. That's fixed in svn trunk. Also delphi is more strict when it comes to PROGRAM name parsing. In freepascal th

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread zeljko
On Thursday 22 of December 2011 09:43:28 Felipe Monteiro de Carvalho wrote: > On Thu, Dec 22, 2011 at 9:15 AM, wrote: > > As I understand it, Delphi and Lazarus implement the former, and don't > > need a timeout for it. > > Ops, you are correct, it is a one shot event: > > http://docs.embarcade

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread Henry Vermaak
On 22/12/11 09:15, Felipe Monteiro de Carvalho wrote: It is not about select working or not, it is about how many file descriptors X uses to communicate: http://fixunix.com/xwindows/91558-xconnectionnumber-select.html#post301681 I don't have time in the foreseeable future to find in which wier

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread Graeme Geldenhuys
On 21 December 2011 18:26, Felipe Monteiro de Carvalho <...> wrote: >> just spinning around a loop, so even if your app isn't active, it's still >> waking up every 50ms.  I don't consider this very good programming practice. > > I tested with top and it doesn't even show my application in the top >

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread Felipe Monteiro de Carvalho
On Thu, Dec 22, 2011 at 9:51 AM, wrote: > Strange statement. > > If select() didn't do its job correctly, neither Qt or Gtk could do their > job, or any network related program, for that matter. It is not about select working or not, it is about how many file descriptors X uses to communicate:

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread michael . vancanneyt
On Thu, 22 Dec 2011, Graeme Geldenhuys wrote: On 22 December 2011 10:15, wrote: I think it depends on what you mean with 'OnIdle'. - An event which occurs once when an application falls Idle. - An event which is triggered repeatedly when the application is idle. fpGUI's OnIdle event used

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread Graeme Geldenhuys
On 21 December 2011 16:53, Felipe Monteiro de Carvalho wrote: > not alone here using FPC, so I shamelessly stole code from fpgui, The joys of open-source software. :-) -- Regards,   - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit htt

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread michael . vancanneyt
On Thu, 22 Dec 2011, Felipe Monteiro de Carvalho wrote: On Thu, Dec 22, 2011 at 9:15 AM, wrote: As I understand it, Delphi and Lazarus implement the former, and don't need a timeout for it. Ops, you are correct, it is a one shot event: http://docs.embarcadero.com/products/rad_studio/delp

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread Graeme Geldenhuys
On 22 December 2011 10:15, wrote: > > I think it depends on what you mean with 'OnIdle'. > - An event which occurs once when an application falls Idle. > - An event which is triggered repeatedly when the application is idle. fpGUI's OnIdle event used to fired only once, when the application goes

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread Felipe Monteiro de Carvalho
On Thu, Dec 22, 2011 at 9:15 AM, wrote: > As I understand it, Delphi and Lazarus implement the former, and don't need > a timeout for it. Ops, you are correct, it is a one shot event: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Forms_TAppl

Re: [fpc-pascal] Timer in X11

2011-12-22 Thread michael . vancanneyt
On Thu, 22 Dec 2011, Graeme Geldenhuys wrote: On 21 December 2011 18:06, Henry Vermaak wrote: embedded devices, laptops have batteries, too.  You're wasting CPU and power just spinning around a loop, so even if your app isn't active, it's still waking up every 50ms.  I don't consider this ver