Rick C. Hodgin:
> I don't want to support namespaces. I'm trying to figure
> out a more elegant way to handle that feature.
To handle name collistions, that is?
I mentioned also import aliases like in Modula, e.g.:
import GetFiles from FileSystem AS FS_GetFiles;
which would make the function GetFiles() from the module
FileSystem available in the current module as FS_GetFiles().
Another method would be to assign a prefix for a whole
module:
import FileSystem as FS_
so that all the public functions from FileSystem should be
available with the 'FS_' prefix, whereas the simple
declarations
import GetFiles from FileSystem;
import FilesSystem
would make the functions available under their real names.
> The software I plan to write for LibSF will be an
> integrated unit.
Do you mean a single source file?
> I do not want to choose global names which will occupy the
> name space of other things. By using classes, all issues
> should be resolvable without the need to enter into a
> namespace.
That seems merely to substitute classes for namespaces, and
thereby move the problem to class level. The classes
themselves will share a single global namespace, will they
not? If so, does your solution rely on the lower number of
classes in a typical program compared to the number of
functions?
How is one supposed to use first-class functions, that is
normal procedures rather than the methods of a dynamic
class? Will you introduce static classes, such as C# has?
> CAlive is also a compiler that does not require tokens to
> be defined before they're referenced, which is why the
> #needs keyword was added. It is enough to indicate your
> application needs a particular library, and then
> everything within it is available to the rest of the
> program.
I fear it may muddle the design, for the dependencies of a
unit or file will no longer be visible at single glance at
the top. I think that the dependecies of every file should
be explicitly declared at least for the reader's sake, to
make the code clear. Good modular design is impossible
without rigid and explicitly specified inter-module
dependencies, which you seem to avoid.
Why do you keep to types of code file: .h and .c, whereas
true units with an "interface" and an "implemenation" secton
are eaisier to maintain and more cohesive. The addition of
a new public function, for example, does not require
modification of two files. Modules are self-contained and
thefore beautiful.
> This changes some of the things about how C-like source
> code is compiled, in that everything is not completely
> sequentially compiled, but it does make it easier for
> human beings to deal with ... which is my goal.
A most commendable goad, so best of luck with that and may
God help thee.