Re: Bundling multiple objects into a single module?



On May 2, 10:27 am, "Michael Metcalf" <michaelmetc...@xxxxxxxxxxxxxx>
wrote:
"Gus Gassmann" <Horand.Gassm...@xxxxxx> wrote in message

news:1178111009.733808.151530@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I have a number of fairly complicated objects. Each object is
contained in its own module, but they are very similar. All the
methods are the same, and the code is identical except for type
declarations. I have two questions concerning this: First, is there a
way to reuse the code?

Others will reply about how to peform some form of generic programming in
f95, but suffice it to point out that if the code is really common you can
keep it in one place and insert it by means of an INCLUDE line wherever it's
needed.

Second, is there a way now to
bundle the objects together in a single module, so that instead of

use object001
use object002
...
use objectnnn

I can simply say

use objects

Put all the USEs into a module called objects and use objects, just as
you've written.

Regards,

Mike Metcalf

I tried that first, but the linker gave me a raft of "unresolved
external symbol" errors. I attributed this to the compiler realizing
that the wrapper module objects does nothing and optimizing everything
away. It looks like I am barking up the wrong tree, but I don't know
where else to start.

.



Relevant Pages

  • Re: Bundling multiple objects into a single module?
    ... declarations. ... but suffice it to point out that if the code is really common you can ... bundle the objects together in a single module, ...
    (comp.lang.fortran)
  • Re: use module to pass data between procedures
    ... it is equally true of common that you can't declare the ... those declarations elsewhere in the same scope. ... All the attributes come from the module and the compiler ... will bitch if you try to redeclare them. ...
    (comp.lang.fortran)
  • Re: How to use H-files
    ... In time I created some common, so called, units. ... You put all the declarations from that ... your Turbo Pascal system did as well, but it did it for you, in the ... How you perform this step depends on which compiler system ...
    (comp.lang.c)
  • Re: Is "volatile sig_atomic_t" redundant?
    ... >Dave Vandervies wrote: ... >It's pretty common to see declarations such as: ... >> Have you ever written code that used a signal handler? ...
    (comp.lang.c)
  • Re: Terminology: Are There Messages in Java?
    ...   classes«), even though they share a common signature (aka ... I would say that the two declarations declare two different ... *implementations* of the same interface method 'I#f'. ... The common base type is 'I'. ...
    (comp.lang.java.programmer)