Re: Pure and internal procedures



In article <1kbpqkb.1bow7jxxye9g2N%nospam@xxxxxxxxxxxxx>,
nospam@xxxxxxxxxxxxx (Richard Maine) writes:

I think that the host association rules in general (not just for
internal procedures) are... um... unfortunate. It almost seems like host
association into internal procedures is nearly as likely to be
accidental as intentional. Forget to explicitly declare a variable in
the internal procedure and you get the host one instead if there was a
host one of that name. That's part of why I don't like the idea of
making it a habit to write internal procedures that depend heavily on
host association. There are certainly cases where that works nicely, but
I think in general it is better to, yes, think of an internal procedure
as just like any other procedure except that it is internal to some
other procedure.

For those familiar with DCL (the VMS "shell"), internal procedures are
sort of like GOSUB while other procedures are more like SUBROUTINEs
within another procedure or completely external procedures. Their main
use is for repeated short operations. In this sense, I think of them as
part of the hosting procedure since they mainly perform housekeeping and
so on. They can be set up quickly, so host association is an advantage.
If one thinks of them as part of the hosting procedure, then inheritance
is no more surprising than for the rest of the procedure.

.



Relevant Pages

  • Re: Pure and internal procedures
    ... proceudures had no identity outside the host. ... internal procedures must follow the rules like a stand alone procedure. ... as particularly being just an extension of its host. ... I think that the host association rules in general (not just for ...
    (comp.lang.fortran)
  • Re: another internal procedure
    ... Sometimes, I am thinking if the host, i.e. main program, looks like ... If you declare ... host just because two internal procedures declare something of the same ... use host association, I'm not prepared to go into that. ...
    (comp.lang.fortran)
  • Re: Statement function host association
    ... >> procedures inside of internal procedures. ... > not override host association, so the compiler cannot help you ... there should be a simple way of excluding some or all host ... FUNC1, then X within SUB1 can be accessed as SUB1%X from ...
    (comp.lang.fortran)
  • Re: another internal procedure
    ... Modules provide a very good way of doing this; internal procedures are also ... Both Fortran and C++ have similar abstract notions of scope, although the two languages have different kinds of scope available. ... Any declaration in the host procedure or host module will be visible in all of the contained procedures. ...
    (comp.lang.fortran)