Re: include limit
- Posted by "Boehme, Gabriel" <gboehme at POBOXB1.HQ.MSMAIL.MUSICLAND.COM> Jun 08, 1999
- 423 views
Tor Bernhard Gausen wrote: >>>Is there a limit to how many files can be included, and if so; is >>>there a way to push this limit? > >Pete wrote: >>I've discovered the nested include files are limited to a depth of about >>10. At the time, I was trying to work out how to do an unlimited number >>of dynamic includes in an interactive Euphoria shell. > >While Bernie Ryan solved my problem (I had simply set my files=x >in config.sys to low), I still wonder why Eu keeps the include files >on disk during runtime so that they require each their file identity >and stuff. Why not load them all into memory the minute they are >included and then close all those files? Would this speed up >access to the routines in those include files (I hope and guess it >wouldn't be that simple...). First of all, please read section 2.6.1 in REFMAN.DOC. The nested include depth limit of 10 is mentioned right there. Tor, you're completely misunderstanding what Euphoria does with its include files. It *doesn't* need to keep the include files on disk during run time. Just check out Liquid Nitrogen's dynamic include method on the contributions page for a perfect example of this -- the program deletes the temporary include file right after including it. So the file *is* loaded into memory when it's included. Well then, you ask, why the depth limit of 10? First of all, this does *not* mean that you're limited to 10 include statements per program. What this means is that you're limited to 10 *levels* of includes -- you can have inc01.e which includes inc02.e which includes inc03.e which includes...and so on, all the way to inc10.e, but if inc10.e includes inc11.e then the program will abend with an "includes are nested too deeply" error. My guess is the depth limit of 10 is releated to the number of internal include file handles Euphoria has available -- after all, it *does* have to keep those nine nested include files open while getting ready to open that tenth nested include. This would also explain, Tor, why you had DOS file limit problems with Dave Cuny's EE (which nests its includes quite a few levels deep), but not with simpler programs. Please keep in mind that this is purely my own speculation, based on the information in REFMAN.DOC and my own experience with Euphoria. It does, however, seem to fit the facts of the case. Rob (or anyone else), please feel free to contradict or correct me here. Be seeing you, Gabriel Boehme