Re: Including Files
- Posted by Chris Bensler <bensler at nt.net> Dec 01, 2006
- 801 views
cklester wrote: > > > That is not a very easy thing to do. Doing so would require changing how Eu > > processes code. > > I don't see how > > include smith.e > > is that much more complicated than > > include "smith.e" > > or > > sequence smith > smith = "smith.e" > > include smith > For one thing, it's abmiguous. Is smith a variable or a filename without an extension? If it were up to me, I would resolve this by forcing all literal filenames to be quoted. But that breaks compatability. The other major issue is that Eu assumes all the files are technically included before any code is executed. We can 'hack' around it using the interpetter because of how it parses source code, but the same is not posible for a bound application. A bound application has already parsed and included it's files before it even begins to execute anything. So the dummy file would always be empty, regardless of your attempts to rewrite it. A bound application would have to be capable of parsing and translating to op code during runtime, which would impose load time latencies during the run of your program whenever a new file is encountered. Any file that contains a dynamic include statement would also have to be processed everytime it's included, regardless if it was already parsed, since you couldn't guarantee that the dynamically included files within that include will be the same. If eu supported string execution it would be possible, but there is still the include statement abiguity and the overhead imposed by runtime parsing. Chris Bensler ~ The difference between ordinary and extraordinary is that little extra ~ http://empire.iwireweb.com - Empire for Euphoria