<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head>
<body>
<p style="margin: 0;">
<span>
<span></span>
</span>
</p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px 5px 0px;">
<br/>
"Christian-W. Budde" <Christian@savioursofsoul.de> hat am 4. November 2011 um 13:04 geschrieben:
<br/>
<br/>
> Hello,
<br/>
>
<br/>
> > This is the explanation for using unitname.identifier, which worked
<br/>
> > since many years.
<br/>
> >
<br/>
> > Dotted unit name means dots in the unit name itself. For example
<br/>
> > an.example.pas. I don't know a good example.
<br/>
>
<br/>
> For me, this makes perfect sense, because of many reasons. Here are a
<br/>
> couple.
<br/>
>
<br/>
> I work on several open source projects, which have in common that all
<br/>
> these projects are marked with the abbreviation before the actual unit
<br/>
> name. For example with Graphics32 it is 'GR32_'. Replacing the
<br/>
> underscore with a '.' would make it appear more logical from a pascal
<br/>
> point of view (underscores shall be avoided in favor of CamelCase) and
<br/>
> the handling of units look more like records then.
<br/>
>
<br/>
> In my second project I have another example where it makes sense from a
<br/>
> hierarchical point of view. There I have implemented dozens of filters,
<br/>
> with lots of optimizations resulting in a vast amount of code. When I
<br/>
> wanted to split this code into several units I thought, that it should
<br/>
> have the name Filters first. But, to give an example, this would result
<br/>
> in 'FiltersButterworth', 'FiltersChebyshev' and 'FiltersBasic'. It just
<br/>
> seems to be odd in the english language, where it would rather be
<br/>
> 'ButterworthFilters', 'ChebyshevFilters' and so on.
<br/>
>
<br/>
> Separating the names by something like a '.' would make much sense in my
<br/>
> opinion.
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">If I understand you correct: it looks nicer.</p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Dotted unit names gives no technical advantage. It does not even allow to write much shorter code like the recent enumerators. </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">About "more pascal":</p>
<p style="margin: 0px;">The dotted unit names break the pascal rule that the last scope wins. For example "uses unita.unitb, unita;" makes no sense, because the namespace unita hides the unit unita, even though the unit comes after the namespace.</p>
<p>I doubt that this namespace concept makes Delphi/ObjectPascal easier to learn/use. At the moment I guess the opposite is true. Has someone experience with namespaces and newbies? </p>
<p> </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px 5px 0px;">
>
<br/>
> I have never used .NET, nor am I a Delphi fan-boy, but I think this
<br/>
> scoping is useful and I hope it will be supported by FPC. It is
<br/>
> discussable, whether it shall be used in Lazarus, but it should be
<br/>
> supported.
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">It is supported by FPC and I implemented a few things in the IDE. "Find declaration" does not yet support it. </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Mattias</p>
<p style="margin: 0px;"> </p>
</body>
</html>