RE: My not-quite obsolete namespace parser
- Posted by Derek Parnell <ddparnell at bigpond.com> May 14, 2002
- 387 views
Robert Craig wrote: > jbrown writes: > > In fact, when I make it > > > > include get.e > > include ../euphoria/get.e --really /opt/euphoria/get.e > > > > it still runs, despite the fact that ../euphoria/get.e does not exist! > > >From REFMAN: > > ... an include statement will be quietly ignored if a file with > > the same name has already been included. > > That means your second include is ignored because it > is trying to include a file with the name "get.e", and "get.e" > has already been included. The second get.e doesn't exist, > but Euphoria doesn't try to open it. > > Regards, > Rob Craig > Rapid Deployment Software > http://www.RapidEuphoria.com > > Robert, can I suggest then a minor change to the documentation. Currently it reads ... include filename . . . <big snip> ...an include statement will be quietly ignored if a file with the same name has already been included. There appears to be a slight ambiguity. Namely that "include filename" seems to imply that the phrase 'filename' actually means "optional file-path concatenated with a file-name". eg. mydir\xyz.e Now further into this section we find the phrase "file name" where that literally means the name of a file (excluding any path information). I could be argued that some people (eg myself) might confuse the two very similar terms, and wrongly assume that ... include dir1\abc.e include dir2\abc.e would actually include two distinct files (because that's what they are) that coincidently had the same name . However, as you have explained (and I just tested), Euphoria only looks at the FILE NAME part of the include statement to determine if a file has been included or not. On the other hand, you could just change Euphoria to do the obvious, that is use the entire normalized path-file-name to detect duplicate include references, just like all other languages do. ------------ Derek.