Re: include statement bugs
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Oct 18, 2004
- 734 views
On Sun, 17 Oct 2004 12:40:51 +0000, Chris Bensler <bensler at nt.net> wrote: <snip> I think Chris has raised some good points. Euphoria should most definitely load two different files which happen to have the same name from two different folders, when you ask it to. I don't care if it is documented to be that way, it is wrong. >Win32lib would be easier to deal with, if it were distributed as a >self contained subfolder. >Euphoria basically doesn't allow the programmer to utilize the >benefit of directory structure, to help organize our growing >library archives. Win32lib *is* distributed in a self contained folder (or three). Derek does the best he can, given the limitation you point out. One thing I would definitely like to see is that a statement: include w32/win32lib.ew adds the w32 directory to the list of places that the interpreter should search for subsequent includes. [See also PS] > include "lib1\test_include.e" as lib1 '\t' in a quoted string is a tab character, end of discussion. If indeed the above works under exu, I proclaim it a bug. Equally, it appears (from Irv's posts) that '\\' is crippled. '/' tends to work equally on Windows and Linux, so I think it would be a good idea to always automatically replace all '\\' with '/' within the include statement, and resolve any problems that creates. (after resolving the directory stuff, that is) >Irv mullins wrote: >it doesn't take a genius to see that: path1/misc.e IS NOT the same as >path2/misc.e Maybe Rob had a panic attack over this BEFORE error reports showed the full path (quite recent, iirc) >Rob, doesn't Euphoria have access to the platform() function? >If so, then why can't the include routine make use of it to handle >the different path separators appropriately? Irv, I believe the windows api is documented as supporting forwardslash; it is linux which does not support backslash. I would be inclined(tee hee) to think linux got it right vs. M$BS (Might be a DOS issue, anyone know?) >Derek wrote: >of Robert some time again and he has assured me that v2.5 will have >this and related issues corrected in 2.5. >For example: > > include .\inc1.e > include inc1.e > >are two 'different' files in 2.4 but the same file in 2.5. My gut reaction is that Rob was just being more adamant that if both win32lib and EuSQL had, say, a string.e file, he was just being more certain you could not possibly load them both. So right in one sense, so wrong in another Regards, Pete PS Back to Eu supporting directory structures a bit more: It seems clear that if including w32/win32lib.ew adds the w32 directory to the list of directories to search, it should also place it at the top of the list, since it is quite likely that subsequent includes will be from the same directory, but also at the end of win32lib.ew, w32/ should be removed from the list. I may be [AM] missing a really simple trick, but I can't seem to do both, not with nested includes, anyway.