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.

.