Re: Rob Idea for dynamic include
- Posted by Colin Taylor <ctaylor at ACCESS.INET.CO.TH> Feb 29, 2000
- 451 views
Dynamic includes sound pretty hairy. I think that most of us would be very happy with the ability to do conditional includes at "compile" time (without having to resort to fancy work-arounds). This would widen the possibility of the same program running on different operating systems, by selectively including the appropriate graphics support, etc. - Colin Taylor Everett Williams wrote: > Power equals danger. If I did dynamic includes, I would expect dynamic > errors...surprise Dynamic includes could be triggered by environmental > conditions or data input. They need not be limited to overloading as they > may have code as well as procedures and functions. Actually, dynamic > includes could cascade, including separately differently named procedures > and functions, followed by an include that will make use of those functions > and procedures. The major objection that I can see to dynamic includes from > the viewpoint of current practice is the need to call the interpreter again at > the resolution of the include. I would love to be able to trigger the interpreter > in several forms of controllable situation, but there has been no indication of > any willingness to implement anything of the sort. > > The most useful reasonably simple one would be an evaluate statement. > The most powerful would be inline functions. A possible compromise would > be a direct call of the interpreter with several options...reevaluate a section > of code and do a dynamic include. Those would both attempt to make the > output of the pass of the interpreter fit with current code. The other use of > such an item might be a way to true modularity of Euphoria code. Call the > interpreter with a separate module of Euphoria code and then pass certain > things to that new module with possible return...that is to say, a native > Euphoria call. Voila, instant modularity with separate development.