One of the features of Pascal and Ada that I really like is the ability
to nest procedures and functions. This allows you to define lots of
smaller functions without polluting your global namespace. I use them a
lot.
Unfortunately, it does not appear that DCTD processes them well.
Conceptually, every identifier can be viewed as a name in a hierarchical
namespace. The namespace can be viewed as a forest with roots for each
program/unit. Thus, function F inside program P would be P.F. If
another function were nested inside F, say G, then its name would be
P.F.G, etc. Variable V in unit Unit1 would be Unit1.V.
Using such a convention provides an unambiguous naming scheme for all
identifiers, and would be very helpful in DCTD. (This is sort of untrue
in that identifiers like readln, chr, ord, pred, etc. need to be
associated with some program unit, but pascal doesn't define one.)
Are there any plans to implement something like this? Does the current
code maintain enough state information to even do this?
Thanks!
Dave
|