Re: [fpc-pascal] fpdoc HTML class hierarchy output contains duplicates

2015-07-26 Thread Michael Van Canneyt



On Tue, 21 Jul 2015, Michael Van Canneyt wrote:




On Tue, 21 Jul 2015, Graeme Geldenhuys wrote:


Hi,

Last night I came across something, which I think is a bug in fpdoc's
HTML output. In recent times, fpdoc added a new output feature to the
HTML generated - a class hierarchy page.

Here is recent HTML output I generated for the tiOPF project. Note all
the duplicates in the Class Hierarchy page. For example TtiSleepThread
appears 4 times in the same tree node, or TtiBaseObject which appears
60+ times in various nodes.

 http://geldenhuys.co.uk/tiopf/index-9.html

Is this a known issue?


No, it is not. Please report it in the bugtracker, so I do not forget it.


Fixed it as part of the 3.0 release process.

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


Re: [fpc-pascal] Basic Sockets in FreePascal

2015-07-26 Thread Ewald
On 07/26/2015 04:49 PM, Coyo wrote:
 I have read on the wiki and documentation that FreePascal does not have any 
 native support for socket handling, and that you need an external third party 
 library to have any support for it.

How about `uses sockets;` [1]? Basically it's the same as you would have
in C, but all functions are prefixed `fp` (as are most other low level
functions on *nix BTW).

[1] http://www.freepascal.org/docs-html/rtl/sockets/index-5.html

-- 
Ewald

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


[fpc-pascal] Basic Sockets in FreePascal

2015-07-26 Thread Coyo
I have read on the wiki and documentation that FreePascal does not have any 
native support for socket handling, and that you need an external third party 
library to have any support for it.

I want to write an IRC bot in FreePascal, but I need the ability to both make 
outgoing connections to IRC servers or other bots of the same kind, as well as 
accept incoming connections from other bots.

I'd prefer as straightforward TCP sockets support as I can get. Any advice 
would be greatly appreciated. Thank you in advance for your time and patience.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Basic Sockets in FreePascal

2015-07-26 Thread Mark Morgan Lloyd

Michael Van Canneyt wrote:

On Sun, 26 Jul 2015, Coyo wrote:

I have read on the wiki and documentation that FreePascal does not 
have any native support for socket handling, and that you need an 
external third party library to have any support for it.


This is not correct. Of course Free Pascal has native support for socket 
handling ?


Knowing the URL of that wiki page would be useful, so that we can fix it 
if it really is broken. What version of FPC is the documentation for?


I want to write an IRC bot in FreePascal, but I need the ability to 
both make outgoing connections to IRC servers or other bots of the 
same kind, as well as accept incoming connections from other bots.


I'd prefer as straightforward TCP sockets support as I can get. Any 
advice would be greatly appreciated. Thank you in advance for your 
time and patience.


Just use the sockets or ssockets units. The first is plain pascal and a 
straightforward interface as you encounter it in any C implementation, 
the second is using classes.


Seconded, it's something I do on a regular basis when I have to do 
something with a non-standard protocol. However I think there's a couple 
of points worth considering.


The first is that the Pascal /language/ doesn't have implicit support 
for sockets, you need to import an appropriate unit/library. That's 
going to be the case for almost all general-purpose languages, with the 
exception of things like Perl and Python which try to build in 
everything a programmer might need including the kitchen sink.


The second is that for standard protocols like FTP and HTTP it might be 
better to use a third-party library to avoid reinventing the wheel when 
it comes to security etc., some of these- for example Synapse- are 
routinely used by almost everybody but aren't packaged with FPC because 
their developers prefer to stay independent.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Basic Sockets in FreePascal

2015-07-26 Thread Coyo
On Sun, 26 Jul 2015 15:47:52 +
Mark Morgan Lloyd markmll.fpc-pas...@telemetry.co.uk wrote:

 Michael Van Canneyt wrote:
  On Sun, 26 Jul 2015, Coyo wrote:
  
  I have read on the wiki and documentation that FreePascal does not 
  have any native support for socket handling, and that you need an 
  external third party library to have any support for it.
  
  This is not correct. Of course Free Pascal has native support for socket 
  handling ?

I will link the wiki articles later to demonstrate the difficulty of using
sockets in FPC. However, I do appreciate the advice.

How do you import a unit/library in FPC? Is there a .deb package or something
that I install?

When compiling or distributing compiled FPC codebases that use external units 
or libraries in FPC, how do you go about doing that? I failed to find 
documentation
illuminating how one goes about doing this. Any enlightenment would be
greatly appreciated.

 Knowing the URL of that wiki page would be useful, so that we can fix it 
 if it really is broken. What version of FPC is the documentation for?
 
  I want to write an IRC bot in FreePascal, but I need the ability to 
  both make outgoing connections to IRC servers or other bots of the 
  same kind, as well as accept incoming connections from other bots.
 
  I'd prefer as straightforward TCP sockets support as I can get. Any 
  advice would be greatly appreciated. Thank you in advance for your 
  time and patience.
  
  Just use the sockets or ssockets units. The first is plain pascal and a 
  straightforward interface as you encounter it in any C implementation, 
  the second is using classes.

I dislike object oriented programming, it makes something that should be
very simple, compact and portable to something more complex than it really
has to be. But that's just a personal preference. Thankfully, FPC lets me
use purely functional programming if I prefer to do so. Java and new Perl
force object oriented programming down my throat, and is part of the reason
I have a deep interest in FPC. I want to keep it stupid simple.

I prefer, when possible, to avoid using external dependencies, and to keep
all code in a single file. While I am not a supergenius coder or anything, 
I CAN appreciate elegantly-written code. Compact source code and compact
binaries are something I can appreciate. Overuse or gratuitous use of 
external libraries and dependencies disturbs me.

I do not know how to use external libraries in C, as it seems more complex
than it's really worth. All functions I ever use are in a single C file.
Reinventing the wheel? I don't want to seem ungrateful, and my mother
taught me that if you can't say something nice, don't say anything at
all. 

Well, that's something a mother would say if I actually had one.
I think. Anyway, I will not remark on what I think of this aversion to
multiple implementations of things others have written questionably
usable code to do. I don't want to be mean about this, after all, any
advice you give here is free. Don't look a gift horse in the mouth, right?

I don't mean to be irritable, but I've heard don't reinvent the wheel
far too many times, especially when defending centralized or dangerously
homogenous networks and systems, rather than multiple implementations
and diversity in network components and systems.

One can argue over-reliance on a single implementation of a cryptographic
library, namely OpenSSL, is actually a security RISK rather than a benefit.
See: Heartbleed. ONLY OpenSSL-dependent applications, systems, and services
were affected by that programming failure.

Anyway, that's another topic entirely, and not something I want to get into
on this list, as it is off-topic, and I want definitive answers on how to do
sockets in pure FPC, rather than using netcat or some external program via
shell scripting.

The IRC bot I have now uses a shell script to invoke it, and establishes
the connection using netcat and standard input/output. I want to eliminate
netcat from being a dependency. I can worry about TLS and whatnot later.

 Seconded, it's something I do on a regular basis when I have to do 
 something with a non-standard protocol. However I think there's a couple 
 of points worth considering.
 
 The first is that the Pascal /language/ doesn't have implicit support 
 for sockets, you need to import an appropriate unit/library. That's 
 going to be the case for almost all general-purpose languages, with the 
 exception of things like Perl and Python which try to build in 
 everything a programmer might need including the kitchen sink.

I'm used to Perl, Python and Ruby, which all have systems of making using
standard libraries trivial. C doesn't really have anything like that.

 The second is that for standard protocols like FTP and HTTP it might be 
 better to use a third-party library to avoid reinventing the wheel when 
 it comes to security etc., some of these- for example Synapse- are 
 routinely used by almost everybody but aren't 

Re: [fpc-pascal] Basic Sockets in FreePascal

2015-07-26 Thread Coyo
On Sun, 26 Jul 2015 17:29:27 +0200
Ewald ew...@yellowcouch.org wrote:

 On 07/26/2015 04:49 PM, Coyo wrote:
  I have read on the wiki and documentation that FreePascal does not have any 
  native support for socket handling, and that you need an external third 
  party library to have any support for it.
 
 How about `uses sockets;` [1]? Basically it's the same as you would have
 in C, but all functions are prefixed `fp` (as are most other low level
 functions on *nix BTW).
 
 [1] http://www.freepascal.org/docs-html/rtl/sockets/index-5.html
 
 -- 
 Ewald

Thank you very much! I'll be sure to read all of that!

-- 
Coyo c...@darkdna.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Basic Sockets in FreePascal

2015-07-26 Thread waldo kitty

On 07/26/2015 09:14 PM, Coyo wrote:

How do you import a unit/library in FPC? Is there a .deb package or something
that I install?


hunh?? is there something wrong with the standard uses foo, bar; clause??

--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal