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 491, Thu Nov 25 15:08:04 1999 UTC revision 492, Fri Nov 26 09:00:50 1999 UTC
# Line 22  Line 22 
22      val sameDirContext: t -> context      val sameDirContext: t -> context
23    
24      val osstring : t -> string      val osstring : t -> string
25        (* like osstring; return relative path if shorter *)
26        val osstring' : t -> string
27      val descr : t -> string      val descr : t -> string
28      val compare : t * t -> order      val compare : t * t -> order
29      val contextOf : t -> context      val contextOf : t -> context
# Line 243  Line 245 
245          (* get the name as a string (calls elab, so don't cache externally!) *)          (* get the name as a string (calls elab, so don't cache externally!) *)
246          fun osstring p = #name (elab p)          fun osstring p = #name (elab p)
247    
248            (* generate osstring and relative version thereof;
249             * return the one that's shorter *)
250            fun osstring' p = let
251                val oss = osstring p
252            in
253                if P.isAbsolute oss then let
254                    val cwd = cwdName ()
255                    val ross = P.mkRelative { path = oss, relativeTo = cwd }
256                in
257                    if size ross < size oss then ross else oss
258                end
259                else oss
260            end
261    
262          (* get the context back *)          (* get the context back *)
263          fun contextOf (PATH { context = c, ... }) = c          fun contextOf (PATH { context = c, ... }) = c
264          fun contextName c = #name (elabContext c)          fun contextName c = #name (elabContext c)

Legend:
Removed from v.491  
changed lines
  Added in v.492

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