[fpc-pascal]Interface-only units (was: shared libraries interface)
memsom at post.interalpha.co.uk
Fri Aug 2 17:39:57 CEST 2002
Quoting Florian Klaempfl <Florian.Klaempfl at gmx.de>:
> Of course, but see my other mail which decribes the problems with the
> indizies and this problem comes from the binary DCU/TPU concept.
Surely the pureint is just a workaround. A hacky one at that. Maybe a better
solution could be found by looking at the way other compilers do things, I'm no
expert so I can't say. I don't feel happy with this idea as a solution. It
just 'papers over the cracks' imo. The concept of the compiled unit is at
fault. You're basically using a concept introduced to Turbo Pascal circa V2
(iirc) in the early part of the 1980's. Maybe Modula or some later language
based on Pascal has a better idea? Having struggles with Delphis woefully
inadiquate component streaming mechanism all afternoon, I would like to see
something like the package concept in java, and the dynamic class loading.
(just try getting Delphi to open a DFM without having to explicitly registed
all of the components on the form - even if you don't know what they will be
> While the pureint concept would allow to recompile the interface and
> everything would be fine.
Unless there is some way of verifying that the interface in untampered with (a
third file? a checksum?) and the compiler either will not compile the source or
at the very least issue a compiler warning, I'll not be using the feature
personally. There are some many better ways of doing this I think (another
idea, ADA uses 'specification/header' and 'body' to split the code.) Moving
away from the concept of a 'Unit' would make the usage clearer/cleaner and less
prone to problems with understanding.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids,
we'd all be running around in darkened rooms, munching magic pills and
listening to repetitive electronic music."
Nintendo, Inc, 1989
-----BEGIN GEEK CODE BLOCK-----
GCS d? s+++:+ a- C++ UL+ P L++ E---- W- N+ o+ K- w
O- M V PS PE-- Y PGP- t- 5-- X- R- tv+ b+ DI++ D+
G e++ h--- r+++ y+++
------END GEEK CODE BLOCK------
More information about the fpc-pascal