[Lazarus] FPReport file names

Michael Van Canneyt michael at freepascal.org
Wed Sep 13 10:44:23 CEST 2017



On Wed, 13 Sep 2017, Graeme Geldenhuys via Lazarus wrote:

> On 2017-09-12 19:01, Alexey via Lazarus wrote:
>> It is new. Please rename (it's easy for new component) all files:
>> usually its good with one prefix. E.g. fprep_*.*.
>
> hahaha... I had the units like that, using underscores. eg: 
> fpreport_export_aggpas.pas, fpreport_export_fpimage.pas etc.  Michael 
> didn't like it, so it got renamed before it went into FPC Trunk. :)
>
> The LCL related units could be prefixed though, as Michael mentioned.

They should be, since some of the names used in the designer are indeed too
generic.

> Then again, maybe it's time FPC starts making use of namespaces and 
> dotted unit names? Just a thought. In Delphi it is actually pretty 
> useful and also stops unit name conflicts. FPC does need a bit more work 
> though to fully support namespaces - at least the way Delphi uses it.

As long as there are no command-line switch and directive for setting 
namespaces, they are completely useless. And even with them, the benefit is
doubtful.

The benefit of writing fpreport.exporthtml versus fpreportexporthtml is zero.

And even with the command-line switch, the 'namespaces stop unit name conflicts' 
argument is of course complete nonsense.

Whoever originally tossed that argument into the world needs to be ridiculed for
either being stupid or not thinking his argument through.

because 
a) I could equally easy decide to use the same namespace as someone else.
    (Yes, I have a notoriously bad character)

b) If you use the namespace param too much, you are in trouble anyway.

Imagine:

web.utils.pas
os.utils.pas

and in my project I have (I love to use the namespace param)

uses utils;

And now I compile with a (hypothetical) /NSweb /NSos -> problem.

I tested in Delphi:

c:\Temp>dcc32 /NSos /NSweb testns.dpr
Embarcadero Delphi for Win32 compiler version 30.0
Copyright (c) 1983,2015 Embarcadero Technologies, Inc.
os.utils.pas(14)
testns.dpr(6) Error: E2003 Undeclared identifier: 'webfunction'
testns.dpr(7)

webfunction is in the web.utils.pas unit.

So, to disambiguate, that forces me to write

uses web.utils;

in which case I can just as well have written

uses webutils;

So we're back to square 1.

Michael.


More information about the Lazarus mailing list