[fpc-pascal] How to have smaller units
Hairy Pixels
genericptr at gmail.com
Sat Nov 29 14:09:21 CET 2025
On Nov 29, 2025 at 4:58:38 AM, Amir via fpc-pascal <
fpc-pascal at lists.freepascal.org> wrote:
> In C++, the concept of header files vs c++ files is helpful. In
> Golang, one could implement the functions for a class in several files,
> as long as they are in the same directory (namespace).
>
I see your point, if there is a "file private" restriction then that
constrains you to one file by definition and now you must use includes to
break code apart. Personally I don't like them either because they break
Pascals unit design and I've long wanted a way to include a unit so it
behaves like an include.
Honestly though it's not an unsolvable problem it just means you need to
make interface/implementation IFDEFs in the units and then join them
together yourself. I think this pattern is widely used but it is hacking
around a feature the compiler should have in my opinion.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20251129/4b172002/attachment.htm>
More information about the fpc-pascal
mailing list