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 /smlnj-lib/trunk/Unix/unix-path.sml
ViewVC logotype

Diff of /smlnj-lib/trunk/Unix/unix-path.sml

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

revision 2546, Tue May 15 01:45:54 2007 UTC revision 2547, Tue May 15 15:11:04 2007 UTC
# Line 1  Line 1 
1  (* unix-path.sml  (* unix-path.sml
2   *   *
3   * COPYRIGHT (c) 1991 by AT&T Bell Laboratories.  See COPYRIGHT file for details.   * COPYRIGHT (c) 2007 The Fellowship of SML/NJ (http://smlnj.org)
4   *   * All rights reserved.
  * AUTHOR:  John Reppy  
  *          AT&T Bell Laboratories  
  *          Murray Hill, NJ 07974  
  *          jhr@research.att.com  
5   *)   *)
6    
7  structure UnixPath : UNIX_PATH =  structure UnixPath : UNIX_PATH =
# Line 19  Line 15 
15    
16    (** Path lists **)    (** Path lists **)
17    
18      datatype path_list = PathList of string list      type path_list = string list
19    
20      exception NoSuchFile      exception NoSuchFile
21    
# Line 51  Line 47 
47      (* return the first path p in the pathlist, such that p/name satisfies      (* return the first path p in the pathlist, such that p/name satisfies
48       * the predicate.       * the predicate.
49       *)       *)
50        fun findFile' (PathList l, pred) fname = let        fun findFile' (l, pred) fname = let
51              fun find [] = raise NoSuchFile              fun find [] = raise NoSuchFile
52                | find (p::r) = let val pn = OS.Path.joinDirFile{dir=p, file=fname}                | find (p::r) = let val pn = OS.Path.joinDirFile{dir=p, file=fname}
53                    in                    in
# Line 65  Line 61 
61      (* return the list of paths p in the pathlist, such that p/name satisfies      (* return the list of paths p in the pathlist, such that p/name satisfies
62       * the predicate.       * the predicate.
63       *)       *)
64        fun findFiles' (PathList l, pred) fname = let        fun findFiles' (l, pred) fname = let
65              fun find ([], l) = rev l              fun find ([], l) = rev l
66                | find (p::r, l) = let val pn = OS.Path.joinDirFile{dir=p, file=fname}                | find (p::r, l) = let val pn = OS.Path.joinDirFile{dir=p, file=fname}
67                    in                    in

Legend:
Removed from v.2546  
changed lines
  Added in v.2547

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