cvs commit: hugs98/src connect.h input.c machdep.c prelude.h storage.c

nordland 2001/09/26 17:26:51 PDT Modified files: src connect.h input.c machdep.c prelude.h storage.c Log: Refurbished the hierarchical module name file search algorithm to make it more in line with GHC. The current definition looks as follows: find along nm hugspath | isFilePath nm = [nm] | isModuleId nm = [ d++f++e | f <- files, d <- dirs, e <- exts ] | otherwise = [] where dirs = along : "" : hugspath files = [mod2dir nm, nm] exts = [".hs",".lhs"] isFilePath s = rindex '.' s `elem` exts isModuleId s = all isConid (splitAt '.' s) mod2dir s = map (\c -> if c=='.' then slash else c) s The news is that file names and module names are now disjoint, which makes it easier to determine when we should convert dots to slashes. The price we pay is that file names must now always have an extension that starts with a lowercase letter, currently either ".hs" or ".lhs". I don't know how many programs that depend on the ability to store modules in files without any extension, but any such program will anyhow break with the new scheme. On the other hand, the overall algorithm is much simpler now. Revision Changes Path 1.24 +3 -3 hugs98/src/connect.h 1.29 +5 -7 hugs98/src/input.c 1.29 +64 -81 hugs98/src/machdep.c 1.27 +3 -3 hugs98/src/prelude.h 1.19 +3 -3 hugs98/src/storage.c

I don't know how many programs that depend on the ability to store modules in files without any extension, but any such program will anyhow break with the new scheme. On the other hand, the overall algorithm is much simpler now.
It's quite common to do this when using #! /usr/bin/runhugs And I just wrote a little library for generating pictures we needed for a paper and tech-report. I used the .hfig extension (Haskell Figure) for the programs so that I could write suitable rules in the Makefile. -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/

I don't know how many programs that depend on the ability to store modules in files without any extension, but any such program will anyhow break with the new scheme. On the other hand, the overall algorithm is much simpler now.
It's quite common to do this when using
#! /usr/bin/runhugs
And I just wrote a little library for generating pictures we needed for a paper and tech-report. I used the .hfig extension (Haskell Figure) for the programs so that I could write suitable rules in the Makefile.
-- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/
Would it work if we simply assumed that everything that's not a valid ModId is a filename? I've simply wanted to reduce the complexity of this beast, and the major problem has been the potential overlap of ModIds and filenames. However, the current status is that there are names that belong to neither category. We can fix this by simply letting filenames be the complement of ModIds. You would still have problems with scripts that begin with a capital letter, but maybe that's acceptable? -- Johan
participants (3)
-
Alastair David Reid
-
Johan Nordlander
-
nordland@glass.cse.ogi.edu