On 3 Mar 2003 at 1:28, Frank Heckenbach wrote:
Peter N Lewis wrote:
Perhaps this would be a useful thought experiment. Say I wrote a unit "WonderSound" to handle all sorts of Sound stuff, and it became wildly popular and was used by lots of folks, and so I decide to update it and add lots more functionality, and so I break the unit up in to more manageably parts, like WonderSoundInput and WonderSoundOutput and WonderSoundFilters and WonderSoundFiles etc. With Uses Propagation, I can include a unit like:
unit WonderSound;
interface
uses WonderSoundInput, WonderSoundOutput, WonderSoundFilters, WonderSoundFiles;
end.
and then all existing code works unmodified and future users can choose either to use only the unit they need, or just use WonderSound and get all the stuff.
This would be close to something I have in mind as "libraries" (not implemented yet, maybe BP or Delphi compatible, don't remember exactly), i.e. basically one unit/library as a "container" for several units.
You can have that in BP/Delphi, with regard to "libraries" (i.e., DLLs). As you all know, a DLL is simply a self-contained executable that exports routines. So the analogy is not the same with units. If we are going to use the reserved word "library", I suggest that we keep it BP-compatible and restrict to dynamically linked libraries. You can still do what you suggest above of course, but I would suggest a different name for it (e.g., "propagate" or "library_unit" or whatever).
(Whether there may be additional declarations in a library, if it's Borland compatible, I don't know -- but at least in your example this wouldn't seem crucial.)
In BP/Delphi, I believe you can have additional declarations in a library (DLL).
[...]
An alternative could be the use of some symbols instead of new keywords (but I don't have a good idea for this yet), or a combination of keywords, such as `uses external ...' or `uses export ...' or `export uses' etc. (just playing around with words ... ;-).
"propagates"?
e.g.
unit foo; interface
propagates Bar, Baz, Fooz, Trook, Trog;
implementation end.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/