[m-rev.] diff: add dir.det_basename/1

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Feb 8 16:02:38 AEDT 2006


Estimated hours taken: 0.1
Branches: main

library/dir.m:
	Add dir.det_basename/1 as a synonym for dir.basename_det/1.  The
	former is more consistent with (most of) the rest of the library where
	we use `det_' as a prefix.

	Fix some formatting.

Julien.

Index: dir.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/dir.m,v
retrieving revision 1.28
diff -u -r1.28 dir.m
--- dir.m	14 Dec 2005 10:33:53 -0000	1.28
+++ dir.m	7 Feb 2006 07:47:34 -0000
@@ -8,17 +8,16 @@

 % File: dir.m.
 % Main authors: fjh, stayl.
+% Stability: high.

 % Filename and directory handling.
-% Stability: high.
 %
-% Note that the predicates and functions in this module change
-% directory separators in paths passed to them to the normal
-% separator for the platform, if that doesn't change the meaning
-% of the path name.
+% Note that the predicates and functions in this module change directory
+% separators in paths passed to them to the normal separator for the platform,
+% if that doesn't change the meaning of the path name.
 %
-% Duplicate directory separators and trailing separators are also
-% removed where that doesn't change the meaning of the path name.
+% Duplicate directory separators and trailing separators are also removed
+% where that doesn't change the meaning of the path name.
 %
 %-----------------------------------------------------------------------------%

@@ -94,6 +93,10 @@
     %
 :- func dir__basename_det(string) = string.

+    % A synonym for the above.
+    %
+:- func dir__det_basename(string) = string.
+
     % dir__dirname(PathName) = DirName.
     %
     % Returns the directory part of a filename.
@@ -177,8 +180,8 @@
     % A predicate passed to dir__foldl2 to process each entry in a directory.
     % Processing will stop if Continue is bound to `no'.
     %
-:- type dir__foldl_pred(T) == pred(string, string, io__file_type, bool,
-                    T, T, io, io).
+:- type dir__foldl_pred(T) ==
+    pred(string, string, io__file_type, bool, T, T, io, io).
 :- inst dir__foldl_pred == (pred(in, in, in, out, in, out, di, uo) is det).

     % dir__foldl2(P, DirName, InitialData, Result, !IO).
@@ -302,6 +305,8 @@

 %-----------------------------------------------------------------------------%

+dir__det_basename(FileName) = dir__basename_det(FileName).
+
 dir__basename_det(FileName) =
     ( BaseName = dir__basename(FileName) ->
         BaseName

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list