<p>Am 14.10.2017 00:03 schrieb "Marcos Douglas B. Santos via Lazarus" <<a href="mailto:lazarus@lists.lazarus-ide.org">lazarus@lists.lazarus-ide.org</a>>:<br>
><br>
> On Fri, Oct 13, 2017 at 6:40 PM, Sven Barth via Lazarus<br>
> <<a href="mailto:lazarus@lists.lazarus-ide.org">lazarus@lists.lazarus-ide.org</a>> wrote:<br>
> > On 13.10.2017 21:32, Marcos Douglas B. Santos via Lazarus wrote:<br>
> >> [...]<br>
> >><br>
> >> IMHO, would be better if packages may have just some "exported units".<br>
> >> What do you think?<br>
> ><br>
> > It doesn't matter. Any symbols in a unit are mangled only locally to the<br>
> > unit and there *can not* be two or more symbols with the same name in<br>
> > one program. What you ask for is simply not possible.<br>
><br>
> Is it not possible *today* or never?<br>
> I don't know how the compiler works, but try to understand me:<br>
> I would like to modularize a big program in small packages — because<br>
> it's better than to use dll/so.<br>
> Each one these packages will work in a bounded context. Each one may<br>
> have a "Facade" to the main program, exposing its "interface" (classes<br>
> and interfaces, most).<br>
> So, the main program shouldn't know nothing about "private units" that<br>
> belongs only for the package.<br>
> That is encapsulation too.</p>
<p>I can very reasonably say that this will never be possible. It's simply how things work on the binary level. And as I said that's also true for dynamic packages (which are a different beast than Lazarus' packages): even if a unit becomes part of a package it won't be touched as it can be used as part of the package as well as directly in the application binary without any changes.<br>
Unit names *must* be unique inside a program (with or without packages). So better use prefixes or dotted unit names to reduce the chance for conflicts.</p>
<p>Regards <br>
Sven</p>