Re: include statement bugs
- Posted by Robert Craig <rds at RapidEuphoria.com> Oct 18, 2004
- 724 views
Derek Parnell wrote: > Do you believe that two files always have the same content if > the have the same name but reside in different folders? > > For example, given these two files ... > > myfolder\abc.ew > yourfolder\abc.ew > > do you believe that their contents must therefore also be > identical, just because their names are the same? The second include is ignored on the assumption that they are essentially the same. ("belief" that they are "identical" overstates things a bit) > If not, will v2.5 use the entire canonical path name when it > determines whether or not to instantiate a new included file? No it won't. I consider this to be a tiny issue that affects maybe 1% or less of all programs. I think it took several years for anyone to even notice how it works. How many people want to include two files in one program, where the files have the same name, but different content? As I think back 10 years or so, I think I did it this way because I didn't want: graphics.e .\graphics.e ./graphics.e c:\euphoria\include\graphics.e \euphoria\include\graphics.e c:graphics.e to be considered "different" files, leading to multiply-defined symbol error messages, when in fact they might be exactly the same file, or at least a copy of a file. I didn't want to write code to resolve the paths, to prove that one of them was in fact the same file as another. If this bothers you, just rename one of your files (and avoid confusing the reader of your code). By the way, this and the backslash vs. forward slash thing can be changed easily by anyone in the new source code. e.g. copied from global.e in the 2.5 front-end...
global integer PATH_SEPARATOR, SLASH global sequence SLASH_CHARS if ELINUX then PATH_SEPARATOR = ':' -- in PATH environment variable SLASH = '/' -- preferred on Linux/FreeBSD SLASH_CHARS = "/" -- special chars allowed in a path else PATH_SEPARATOR = ';' SLASH = '\\' SLASH_CHARS = "\\/:" end if
Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com