> Date: Fri, 05 Feb 1999 11:40:15 -0800
> From: Van Snyder <[log in to unmask]>
> Vittorio G. Caffa wrote:
> > I don't use include...
> I also prefer not to use include, but I have found one useful application
> for it that can't be done with modules: Simulating what are called
> "generic packages" in Ada or "templates" in C++.
[...deleted...]
> Of course, the real solution is a generic/template facility, but that's
> not even on the table for Fortran 2000.
I keep coming back to the thought that it shouldn't be that hard to
do a basic template facility as a preprocessor step (implemented with perl,
maybe?), just doing text substitution. I'm not envisioning a Turing-equivalent
meta-language like in C++, just enough to allow one to write generics without
having to replicate code. It's not trivial, but I don't think it would be that
hard. If you made the restriction that template definition and invocation have
to be syntactically distinct, I don't think you would even need a full parser,
just some regular expressions to find them and a code generator. Of course,
I haven't sat down to actually spec out a syntax that would work this way,
so I could be completely off target here.
-david
> Best regards,
> Van Snyder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|