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

nordland@glass.cse.ogi.edu nordland@glass.cse.ogi.edu
Wed, 26 Sep 2001 17:26:51 -0700


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