Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/paths/abspath.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/paths/abspath.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 373, Wed Jul 7 00:45:56 1999 UTC revision 374, Wed Jul 7 02:59:55 1999 UTC
# Line 62  Line 62 
62        | compareId (PRESENT _, ABSENT _) = GREATER        | compareId (PRESENT _, ABSENT _) = GREATER
63        | compareId (ABSENT s, ABSENT s') = String.compare (s, s')        | compareId (ABSENT s, ABSENT s') = String.compare (s, s')
64    
65      fun getId f = (PRESENT (F.fileId f) handle _ => ABSENT f)      (* To maximize our chances of recognizing eqivalent path names to
66         * non-existing files, we use F.fullPath to expand the largest
67         * possible prefix of the path. *)
68        fun expandPath f = let
69            fun loop { dir, file } =
70                P.concat (F.fullPath dir, file)
71                handle _ => let
72                    val { dir = dir', file = file' } = P.splitDirFile dir
73                in
74                    loop { dir = dir', file = P.concat (file', file) }
75                end
76        in
77            (* An initial call to splitDirFile is ok because we already know
78             * that the complete path does not refer to an existing file. *)
79            loop (P.splitDirFile f)
80        end
81    
82        fun getId f = (PRESENT (F.fileId f) handle _ => ABSENT (expandPath f))
83    
84      type elaboration = { stamp : unit ref,      type elaboration = { stamp : unit ref,
85                           name : string,                           name : string,

Legend:
Removed from v.373  
changed lines
  Added in v.374

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0