[m-rev.] for review: update syntax in documentation

Julien Fischer juliensf at cs.mu.OZ.AU
Thu Jan 20 15:37:34 AEDT 2005


Estimated hours taken: 0.5
Branches: main

Use `.' as a module qualification operator throughout
the compiler documentation.

Make sure that the documentation does not refer to syntax
that is now deprecated.

XXX The library reference guide still uses `__' in most places
but that will have to wait until those library modules are
changed over to use the new syntax.

reference_manual.texi:
	Remove the comment saying we should make this change.
	s/is/=/ in a few spots.

transition_guide.m:
	Replace an instance of the old-style lambda syntax.

doc/faq.texi:
doc/user_guide.texi:
	As above.

Julien.

Workspace:/home/earth/juliensf/ws55
Index: faq.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/faq.texi,v
retrieving revision 1.28
diff -u -r1.28 faq.texi
--- faq.texi	18 Mar 2004 03:42:09 -0000	1.28
+++ faq.texi	20 Jan 2005 04:26:52 -0000
@@ -129,19 +129,19 @@

 This error generally happens if you attempt bind non-local variables
 in the @emph{condition} of the if-then-else.  For example, the following
-code attempts to bind @samp{Value} in the call to @samp{map__search},
+code attempts to bind @samp{Value} in the call to @samp{map.search},
 but @samp{Value} occurs outside of the if-then-else --- in particular,
 it occurs in the head of the clause.

 @example
-:- pred map__search(map(K, V), K, V).
-:- mode map__search(in, in, out) is semidet.
+:- pred map.search(map(K, V), K, V).
+:- mode map.search(in, in, out) is semidet.

 :- pred lookup(map(string, int), string, int).
 :- mode lookup(in, in, out) is det.

 lookup(Map, Key, Value) :-
-        (if map__search(Map, Key, Value) then
+        (if map.search(Map, Key, Value) then
                 true
         else
                 Value = -1
@@ -165,7 +165,7 @@
 @example
 lookup(Map, Key, Value) :-
         (if some [Value1]
-                map__search(Map, Key, Value1)
+                map.search(Map, Key, Value1)
         then
                 Value = Value1
         ;
@@ -179,7 +179,7 @@

 @example
 lookup(Map, Key, Value) :-
-        ( map__search(Map, Key, Value1) ->
+        ( map.search(Map, Key, Value1) ->
                 Value = Value1
         ;
                 Value = -1
Index: reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.305
diff -u -r1.305 reference_manual.texi
--- reference_manual.texi	5 Jan 2005 05:09:33 -0000	1.305
+++ reference_manual.texi	20 Jan 2005 04:21:37 -0000
@@ -745,17 +745,17 @@
 might write
 @example
 	main(IO0, IO) :-
-		io__write_string("The answer is ", IO0, IO1),
-		io__write_int(calculate_answer(@dots{}), IO1, IO2),
-		io__nl(IO3, IO).
+		io.write_string("The answer is ", IO0, IO1),
+		io.write_int(calculate_answer(@dots{}), IO1, IO2),
+		io.nl(IO3, IO).
 @end example
 @noindent
 using state variable syntax one could write
 @example
 	main(!IO) :-
-		io__write_string("The answer is ", !IO),
-		io__write_int(calculate_answer(@dots{}), !IO),
-		io__nl(!IO).
+		io.write_string("The answer is ", !IO),
+		io.write_int(calculate_answer(@dots{}), !IO),
+		io.nl(!IO).
 @end example

 A state variable is written @samp{!. at var{X}} or @samp{!:@var{X}},
@@ -908,10 +908,10 @@
 @item Threading the IO state
 @example
 main(!IO) :-
-	io__write_string("The 100th prime is ", !IO),
+	io.write_string("The 100th prime is ", !IO),
 	X = prime(100),
-	io__write_int(X, !IO),
-	io__nl(!IO).
+	io.write_int(X, !IO),
+	io.nl(!IO).
 @end example

 @item Handling accumulators (1)
@@ -1580,8 +1580,8 @@
 The universal type is useful for situations
 where you need heterogeneous collections.

- at item The ``state-of-the-world'' type: @code{io__state}.
-The type @code{io__state} is defined in the standard library module @code{io},
+ at item The ``state-of-the-world'' type: @code{io.state}.
+The type @code{io.state} is defined in the standard library module @code{io},
 and represents the state of the world.
 Predicates which perform I/O are passed the old state of the world
 and produce a new state of the world.
@@ -2012,11 +2012,11 @@
 @example
 :- func map(K, V) ^ elem(K) = V.
 :- mode in        ^ in      = out is semidet.
-Map ^ elem(Key) = map__lookup(Map, Key).
+Map ^ elem(Key) = map.lookup(Map, Key).

 :- func (map(K, V) ^ elem(K) := V)  = V.
 :- mode (in        ^ in      := in) = out is semidet.
-(Map ^ elem(Key) := Value) = map__set(Map, Key, Value).
+(Map ^ elem(Key) := Value) = map.set(Map, Key, Value).
 @end example

 The Mercury standard library modules @code{array} and @code{bt_array}
@@ -2754,10 +2754,10 @@

 @example
 	append(Prefix, Suffix, List) :-
-		list__length(List, ListLength),
-		list__length(Suffix, SuffixLength),
-		PrefixLength is ListLength - SuffixLength,
-		list__split_list(PrefixLength, List, Prefix, Suffix).
+		list.length(List, ListLength),
+		list.length(Suffix, SuffixLength),
+		PrefixLength = ListLength - SuffixLength,
+		list.split_list(PrefixLength, List, Prefix, Suffix).
 @end example

 @noindent
@@ -2793,10 +2793,10 @@
 	usual_append([X|Xs], Ys, [X|Zs]) :- usual_append(Xs, Ys, Zs).

 	other_append(Prefix, Suffix, List) :-
-		list__length(List, ListLength),
-		list__length(Suffix, SuffixLength),
-		PrefixLength is ListLength - SuffixLength,
-		list__split_list(PrefixLength, List, Prefix, Suffix).
+		list.length(List, ListLength),
+		list.length(Suffix, SuffixLength),
+		PrefixLength = ListLength - SuffixLength,
+		list.split_list(PrefixLength, List, Prefix, Suffix).
 @end example

 This language feature can be used to write ``impure'' code that
@@ -3008,7 +3008,7 @@
 determinism of @code{erroneous}.

 The determinism annotation @code{erroneous} is used on the library
-predicates @samp{require__error/1} and @samp{exception__throw/1},
+predicates @samp{require.error/1} and @samp{exception.throw/1},
 but apart from that determinism annotations @code{erroneous} and
 @code{failure} are generally not needed.

@@ -3629,14 +3629,14 @@
 :- type set(T) ---> set(list(T))
         where equality is set_equals, comparison is set_compare.

-:- pred set_compare(builtin__comparison_result::uo,
+:- pred set_compare(builtin.comparison_result::uo,
                 set(T)::in, set(T)::in) is det.
 set_compare(promise_only_solution(set_compare_2(Set1, Set2)), Set1, Set2).

 :- pred set_compare_2(set(T)::in, set(T)::in,
-                builtin__comparison_result::uo) is cc_multi.
+                builtin.comparison_result::uo) is cc_multi.
 set_compare_2(set(List1), set(List2), Result) :-
-        builtin__compare(Result, list__sort(List1), list__sort(List2)).
+        builtin.compare(Result, list.sort(List1), list.sort(List2)).
 @end example

 If a comparison predicate is supplied and the unification predicate
@@ -3651,7 +3651,7 @@

 If a unification predicate is supplied without a comparison predicate,
 the compiler will generate a comparison predicate which throws an
-exception of type @samp{require__software_error} when called.
+exception of type @samp{require.software_error} when called.

 A type declaration for a type @samp{foo(T1, @dots{}, TN)} may contain a
 @samp{where equality is @var{equalitypred}} specification only if it
@@ -3743,7 +3743,7 @@
 @item
 @var{comparepred} must be the name of a predicate with signature
 @example
-:- pred @var{comparepred}(builtin__comparison_result::uo,
+:- pred @var{comparepred}(builtin.comparison_result::uo,
                 foo(T1, @dots{}, TN)::in, foo(T1, @dots{}, TN)::in) is det.
 @end example

@@ -3780,7 +3780,7 @@

 For each type for which the declaration has a
 @samp{where comparison is @var{comparepred}} specification,
-any calls to the standard library predicate @samp{builtin__compare/3}
+any calls to the standard library predicate @samp{builtin.compare/3}
 with arguments of that type are evaluated as if they were calls
 to @var{comparepred}.

@@ -3899,10 +3899,10 @@

 @example
 Pred = (pred(Strings::in, Num::out, di, uo) is det -->
-    io__write_string("The strings are: "),
-    @{ list__length(Strings, Num) @},
-    io__write_strings(Strings),
-    io__nl
+    io.write_string("The strings are: "),
+    @{ list.length(Strings, Num) @},
+    io.write_strings(Strings),
+    io.nl
 )
 @end example

@@ -3911,10 +3911,10 @@

 @example
 Pred = (pred(Strings::in, Num::out, IO0::di, IO::uo) is det :-
-    io__write_string("The strings are: ", IO0, IO1),
-    list__length(Strings, Num),
-    io__write_strings(Strings, IO1, IO2),
-    io__nl(IO2, IO)
+    io.write_string("The strings are: ", IO0, IO1),
+    list.length(Strings, Num),
+    io.write_strings(Strings, IO1, IO2),
+    io.nl(IO2, IO)
 )
 @end example

@@ -3931,21 +3931,21 @@
 For example, instead of

 @example
-list__filter([1,2,3], \=(2), List)
+list.filter([1,2,3], \=(2), List)
 @end example

 @noindent
 you must write either

 @example
-list__filter([1,2,3], (pred(X::in) is semidet :- X \= 2), List)
+list.filter([1,2,3], (pred(X::in) is semidet :- X \= 2), List)
 @end example

 @noindent
 or

 @example
-list__filter([1,2,3], not_equal(2), List)
+list.filter([1,2,3], not_equal(2), List)
 @end example

 @noindent
@@ -4040,24 +4040,24 @@

 @example
 solutions(Pred, List) is true iff
-        all [X] (call(Pred, X) <=> list__member(X, List))
+        all [X] (call(Pred, X) <=> list.member(X, List))
         and List is sorted.
 @end example

 @noindent
 where @samp{call(Pred, X)} invokes the higher-order predicate term
 @samp{Pred} with argument @samp{X},
-and where @samp{list__member/2} is the standard
+and where @samp{list.member/2} is the standard
 library predicate for list membership.  In other words,
 @samp{solutions(Pred, List)} finds all the values of @samp{X}
 for which @samp{call(Pred, X)} is true, collects these solutions
 in a list, sorts the list, and returns that list as its result.
 Here's an example: the standard library defines a predicate
- at samp{list__perm(List0, List)}
+ at samp{list.perm(List0, List)}

 @example
-:- pred list__perm(list(T), list(T)).
-:- mode list__perm(in, out) is nondet.
+:- pred list.perm(list(T), list(T)).
+:- mode list.perm(in, out) is nondet.
 @end example

 @noindent
@@ -4065,7 +4065,7 @@
 Hence the following call to solutions

 @example
-solutions(list__perm([3,1,2]), L)
+solutions(list.perm([3,1,2]), L)
 @end example

 @noindent
@@ -4087,7 +4087,7 @@
 term are part of that term's @emph{inst}, not its @emph{type}.
 This allows a single higher-order predicate to work on argument
 predicates of different modes and determinism, which is particularly
-useful for library predicates such as @samp{list__map} and @samp{list__foldl}.
+useful for library predicates such as @samp{list.map} and @samp{list.foldl}.

 The language contains builtin @samp{inst} values

@@ -4162,7 +4162,7 @@

 Note that the compiler will only catch direct attempts at higher-order
 unifications; indirect attempts (via polymorphic predicates, for
-example @samp{(list__append([], [P], [Q])} may result in an error at
+example @samp{(list.append([], [P], [Q])} may result in an error at
 run-time rather than at compile-time.

 In order to call a higher-order term, the compiler must know its higher-order
@@ -4183,8 +4183,6 @@

 @node Modules
 @chapter Modules
- at c XXX At some point in the future, change the rest of the documentation
- at c     to use `.' as the module separator rather than `__'.

 @menu
 * The module system::
@@ -4270,14 +4268,14 @@
 must be declared as either

 @example
-:- pred main(io__state::di, io__state::uo) is det.
+:- pred main(io.state::di, io.state::uo) is det.
 @end example

 @noindent
 or

 @example
-:- pred main(io__state::di, io__state::uo) is cc_multi.
+:- pred main(io.state::di, io.state::uo) is cc_multi.
 @end example

 @noindent
@@ -4320,7 +4318,7 @@
 % Queues are implemented as lists. We need the `list' module
 % for the declaration of the type list(T), with its constructors
 % '[]'/0 % and '.'/2, and for the declaration of the predicate
-% list__append/3.
+% list.append/3.

 :- import_module list.

@@ -4333,7 +4331,7 @@
 empty_queue([]).

 put(Queue0, Elem, Queue) :-
-         list__append(Queue0, [Elem], Queue).
+         list.append(Queue0, [Elem], Queue).

 get([Elem | Queue], Elem, Queue).

@@ -4675,7 +4673,7 @@
 	func method1(T, T) = int,
 	func method2(T) = int,
 	pred method3(T::in, int::out) is det,
-	pred method4(T::in, io__state::di, io__state::uo) is det,
+	pred method4(T::in, io.state::di, io.state::uo) is det,
 	func method5(bool, T) = T
 ].

@@ -4690,7 +4688,7 @@
 	(method3(X, Y) :- Y = X + 2),

 	% method defined by a DCG rule
-	(method4(X) --> io__print(X), io__nl),
+	(method4(X) --> io.print(X), io.nl),

 	% method defined by multiple clauses
 	method5(no, _) = 0,
@@ -4842,8 +4840,8 @@

 :- func hash_string(string) = int.
 hash_string(S) = H :-
-        % use the standard library predicate string__hash/2
-        string__hash(S, H).
+        % use the standard library predicate string.hash/2
+        string.hash(S, H).

 :- end_module hashable.
 @end example
@@ -4947,7 +4945,7 @@

 @example
 :- typeclass portrayable(T) where [
-        pred portray(T::in, io__state::di, io__state::uo) is det
+        pred portray(T::in, io.state::di, io.state::uo) is det
 ].
 @end example

@@ -4955,11 +4953,11 @@

 @example
 :- instance portrayable(int) where [
-        pred(portray/3) is io__write_int
+        pred(portray/3) is io.write_int
 ].

 :- instance portrayable(char) where [
-        pred(portray/3) is io__write_char
+        pred(portray/3) is io.write_char
 ].
 @end example

@@ -4974,14 +4972,14 @@
         pred(portray/3) is portray_list
 ].

-:- pred portray_list(list(T), io__state, io__state) <= portrayable(T).
+:- pred portray_list(list(T), io.state, io.state) <= portrayable(T).
 :- mode portray_list(in, di, uo) is det.

 portray_list([]) -->
         [].
 portray_list([X|Xs]) -->
 	portray(X),
-	io__write_char(' '),
+	io.write_char(' '),
 	portray_list(Xs).
 @end example

@@ -5083,7 +5081,7 @@
 type, put it in a polymorphic data structure, or pass it to a
 polymorphic procedure whose argument type is universally quantified.
 (Note, however, that the standard library includes some quite powerful
-procedures such as @samp{io__write} which can be useful in this context.)
+procedures such as @samp{io.write} which can be useful in this context.)

 A non-variable type (i.e.@: a type that is not a type variable)
 is considered @emph{more general} than an
@@ -5555,7 +5553,7 @@
 combinations of the @samp{--no-reorder-conj}, @samp{--no-reorder-disj},
 and @samp{--fully-strict} options.  (The @samp{--fully-strict} option
 prevents the compiler from improving completeness by optimizing away infinite
-loops or calls to @code{require__error/1} or @code{exception__throw/1}.)
+loops or calls to @code{require.error/1} or @code{exception.throw/1}.)
 The default semantics are the commutative semantics.  Enabling all of these
 options gives you the strict sequential semantics.  Enabling just some
 of them gives you a semantics somewhere in between.
@@ -5833,7 +5831,7 @@
 an underscore and then the type arity,
 expressed as a decimal integer.
 Mercury module qualifiers are converted to CLR namespace qualifiers.
-For example the Mercury type @samp{foo__bar__baz/1} will be passed as the CLR
+For example the Mercury type @samp{foo.bar.baz/1} will be passed as the CLR
 type @samp{foo.bar.baz_1}.
 Note an extra namespace qualifier, @samp{mercury}, will be prepended to the
 beginning of names residing in the Mercury standard library.
@@ -5862,7 +5860,7 @@
 and the function result has an output mode,
 then the IL function should return the Mercury function result value.
 Otherwise the function result is appended as an extra argument.
-Arguments of type @samp{io__state} or @samp{store__store(_)} are not
+Arguments of type @samp{io.state} or @samp{store.store(_)} are not
 passed or returned at all.
 (The reason for this is that these types represent mutable state,
 and in IL modifications to mutable state are done via side effects,
@@ -5888,7 +5886,7 @@
 an underscore and then the type arity,
 expressed as a decimal integer.
 Mercury module qualifiers are converted to Java namespace qualifiers.
-For example the Mercury type @samp{foo__bar__baz/1} will be passed as the Java
+For example the Mercury type @samp{foo.bar.baz/1} will be passed as the Java
 type @samp{foo.bar.baz_1}.
 Note an extra namespace qualifier, @samp{mercury}, will be prepended to the
 beginning of names residing in the Mercury standard library.
@@ -5921,7 +5919,7 @@
 Otherwise, the Java function will return an array of type
 @samp{java.lang.Object[]}.

-Arguments of type @samp{io__state} or @samp{store__store(_)} are not
+Arguments of type @samp{io.state} or @samp{store.store(_)} are not
 passed or returned at all.
 (The reason for this is that these types represent mutable state,
 and in Java modifications to mutable state are done via side effects,
@@ -6196,11 +6194,11 @@
 For example:

 @example
-:- pred string__contains_char(string, character).
-:- mode string__contains_char(in, in) is semidet.
+:- pred string.contains_char(string, character).
+:- mode string.contains_char(in, in) is semidet.

 :- pragma foreign_proc("C",
-	string__contains_char(Str::in, Ch::in),
+	string.contains_char(Str::in, Ch::in),
         [will_not_call_mercury, promise_pure],
         "SUCCESS_INDICATOR = (strchr(Str, Ch) != NULL);").
 @end example
@@ -6384,11 +6382,11 @@
 @samp{SUCCESS_INDICATOR}.  For example:

 @example
-:- pred string__contains_char(string, character).
-:- mode string__contains_char(in, in) is semidet.
+:- pred string.contains_char(string, character).
+:- mode string.contains_char(in, in) is semidet.

 :- pragma foreign_proc("C#",
-	string__contains_char(Str::in, Ch::in),
+	string.contains_char(Str::in, Ch::in),
         [will_not_call_mercury, promise_pure],
         "SUCCESS_INDICATOR = (Str.IndexOf(Ch) != -1);").
 @end example
@@ -6417,7 +6415,7 @@
 :- pragma foreign_decl("C#", "
 	using System;
 ").
-:- pred hello(io__state::di, io__state::uo) is det.
+:- pred hello(io.state::di, io.state::uo) is det.
 :- pragma foreign_proc("C#",
 	hello(_IO0::di, _IO::uo),
 	[will_not_call_mercury],
@@ -6645,11 +6643,11 @@
 @samp{succeeded}.  For example:

 @example
-:- pred string__contains_char(string, character).
-:- mode string__contains_char(in, in) is semidet.
+:- pred string.contains_char(string, character).
+:- mode string.contains_char(in, in) is semidet.

 :- pragma foreign_proc("Java",
-	string__contains_char(Str::in, Ch::in),
+	string.contains_char(Str::in, Ch::in),
         [will_not_call_mercury, promise_pure],
         "succeeded = (Str.IndexOf(Ch) != -1);").
 @end example
@@ -6691,7 +6689,7 @@
     @}
 @}
 ").
-:- pred hello(io__state::di, io__state::uo) is det.
+:- pred hello(io.state::di, io.state::uo) is det.
 :- pragma foreign_proc("Java",
 	hello(_IO0::di, _IO::uo),
 	[will_not_call_mercury],
@@ -6772,10 +6770,10 @@
 @samp{SUCCESS_INDICATOR}.  For example:

 @example
-:- pred string__contains_char(string, character).
-:- mode string__contains_char(in, in) is semidet.
+:- pred string.contains_char(string, character).
+:- mode string.contains_char(in, in) is semidet.

-:- pragma foreign_proc("MC++", string__contains_char(Str::in, Ch::in),
+:- pragma foreign_proc("MC++", string.contains_char(Str::in, Ch::in),
         [will_not_call_mercury, promise_pure],
         "SUCCESS_INDICATOR = (Str->IndexOf(Ch) != -1);").
 @end example
@@ -7016,10 +7014,10 @@
 For example:

 @example
-:- pred string__contains_char(string, character).
-:- mode string__contains_char(in, in) is semidet.
+:- pred string.contains_char(string, character).
+:- mode string.contains_char(in, in) is semidet.

-:- pragma c_code(string__contains_char(Str::in, Ch::in),
+:- pragma c_code(string.contains_char(Str::in, Ch::in),
         [will_not_call_mercury],
         "SUCCESS_INDICATOR = (strchr(Str, Ch) != NULL);").
 @end example
@@ -7129,14 +7127,14 @@
 @noindent
 The next example is a more realistic example;
 it shows how you could implement the reverse
-mode of @samp{string__append}, which returns
+mode of @samp{string.append}, which returns
 all possible ways of splitting a string into
 two pieces, using @samp{pragma c_code}.

 @example
-:- pred string__append(string, string, string).
-:- mode string__append(out, out, in) is multi.
-:- pragma c_code(string__append(S1::out, S2::out, S3::in),
+:- pred string.append(string, string, string).
+:- mode string.append(out, out, in) is multi.
+:- pragma c_code(string.append(S1::out, S2::out, S3::in),
                 [will_not_call_mercury, thread_safe],
         local_vars("
                 String s;
@@ -7223,7 +7221,7 @@
 C pointer arguments, even without unique modes.  But they cannot
 destructively update the arguments themselves.
 Procedures may perform I/O only if their arguments
-include an @samp{io__state} pair (see the @samp{io} chapter
+include an @samp{io.state} pair (see the @samp{io} chapter
 of the Mercury Library Reference Manual), or if they are declared impure
 (@pxref{Impurity}).
 The Mercury implementation is allowed to assume that
@@ -7235,10 +7233,10 @@

 For example, the following code defines a predicate
 @samp{c_write_string/3}, which has a similar effect to
-the Mercury library predicate @samp{io__write_string/3}:
+the Mercury library predicate @samp{io.write_string/3}:

 @example
-:- pred c_write_string(string, io__state, io__state).
+:- pred c_write_string(string, io.state, io.state).
 :- mode c_write_string(in, di, uo) is det.

 :- pragma c_code(c_write_string(S::in, IO0::di, IO::uo),
@@ -7248,9 +7246,9 @@

 @noindent
 In this example, the I/O is done via side effects inside the C code,
-but the Mercury interface includes @samp{io__state} arguments
+but the Mercury interface includes @samp{io.state} arguments
 to ensure that the predicate has a proper declarative
-semantics.  If the @samp{io__state} arguments were
+semantics.  If the @samp{io.state} arguments were
 left off, then the Mercury implementation might apply
 undesirable optimizations (e.g.@: reordering, duplicate
 call elimination, tabling, lazy evaluation, @dots{})
@@ -7370,7 +7368,7 @@
 the function result has an output mode, then the C interface
 function will return the Mercury function result value.
 Otherwise the function result is appended as an extra argument.
-Arguments of type @samp{io__state} or @samp{store__store(_)}
+Arguments of type @samp{io.state} or @samp{store.store(_)}
 are not passed at all.  (The reason for this is that these types
 represent mutable state, and in C modifications to mutable state
 are done via side effects, rather than argument passing.)
@@ -7496,7 +7494,7 @@
 and the function result has an output mode,
 then the C function should return the Mercury function result value.
 Otherwise the function result is appended as an extra argument.
-Arguments of type @samp{io__state} or @samp{store__store(_)} are not
+Arguments of type @samp{io.state} or @samp{store.store(_)} are not
 passed at all.
 (The reason for this is that these types represent mutable state,
 and in C modifications to mutable state are done via side effects,
@@ -8044,7 +8042,7 @@
 For pure procedures, the set of solutions depends only on the
 values of the input arguments.
 They do not interact with the ``real'' world (i.e., do any
-input/output) without taking an io__state (@pxref{Types}) as input and
+input/output) without taking an io.state (@pxref{Types}) as input and
 returning one as output, and do not change the value of any data
 structure that will not be undone on backtracking (unless the data
 structure would be unreachable on backtracking).  Note that equality
@@ -8469,12 +8467,12 @@
 The declarations

 @example
-:- pred map__lookup(map(K, V), K, V).
-:- pragma type_spec(map__lookup/3, K = int).
+:- pred map.lookup(map(K, V), K, V).
+:- pragma type_spec(map.lookup/3, K = int).
 @end example

 @noindent
-give a hint to the compiler that a version of @samp{map__lookup/3} should
+give a hint to the compiler that a version of @samp{map.lookup/3} should
 be created for integer keys.

 Implementations are free to ignore @samp{pragma type_spec} declarations.
@@ -8893,14 +8891,14 @@

 Every predicate with a @samp{pragma aditi} or
 @samp{pragma base_relation} declaration must have an input
-argument of type @samp{aditi__state}. This ensures that Aditi predicates
+argument of type @samp{aditi.state}. This ensures that Aditi predicates
 are only called from within transactions and that updates and database
-calls are ordered correctly, in the same way that @samp{io__state} arguments
+calls are ordered correctly, in the same way that @samp{io.state} arguments
 are used to ensure ordering of I/O operations. Within the clauses for
 predicates with a @samp{pragma aditi} declaration variables with
-type @samp{aditi__state} may only be passed to other database predicates ---
+type @samp{aditi.state} may only be passed to other database predicates ---
 they may not be packaged into terms or passed to top-down Mercury predicates.
-This allows the compiler to remove all instances of @samp{aditi__state}
+This allows the compiler to remove all instances of @samp{aditi.state}
 variables from database predicates, and enforces the restriction that
 top-down Mercury code called from within the database cannot call bottom-up
 code, which is currently impossible for Aditi to handle.
@@ -8914,68 +8912,68 @@
 The following predicates and functions from the standard library
 can be called from Aditi:

- at samp{builtin__compare/3},
+ at samp{builtin.compare/3},

- at samp{int:'<'/2},
- at samp{int:'>'/2},
- at samp{int:'=<'/2},
- at samp{int:'>='/2},
- at samp{int__abs/2},
- at samp{int__max/3},
- at samp{int__min/3},
- at samp{int__to_float/2},
- at samp{int__pow/2},
- at samp{int__log2/2},
- at samp{int:'+'/2},
- at samp{int:'+'/1},
- at samp{int:'-'/2},
- at samp{int:'-'/1},
- at samp{int:'*'/2},
- at samp{int:'//'/2},
- at samp{int__rem/2},
-
- at samp{float:'<'/2},
- at samp{float:'>'/2},
- at samp{float:'>='/2},
- at samp{float:'=<'/2},
- at samp{float__abs/1},
- at samp{float__abs/2},
- at samp{float__max/2},
- at samp{float__max/3},
- at samp{float__min/2},
- at samp{float__min/3},
- at samp{float__pow/2},
- at samp{float__log2/2},
- at samp{float__float/1},
- at samp{float__truncate_to_int/1},
- at samp{float__truncate_to_int/2},
- at samp{float:'+'/2},
- at samp{float:'+'/1},
- at samp{float:'-'/2},
- at samp{float:'-'/1},
- at samp{float:'*'/2},
- at samp{float:'/'/2},
-
- at samp{math__ceiling/1},
- at samp{math__round/1},
- at samp{math__floor/1},
- at samp{math__sqrt/1},
- at samp{math__pow/2},
- at samp{math__exp/1},
- at samp{math__ln/1},
- at samp{math__log10/1},
- at samp{math__log2/1},
- at samp{math__sin/1},
- at samp{math__cos/1},
- at samp{math__tan/1},
- at samp{math__asin/1},
- at samp{math__acos/1},
- at samp{math__atan/1},
- at samp{math__sinh/1},
- at samp{math__cosh/1},
- at samp{math__tanh/1},
+ at samp{int.'<'/2},
+ at samp{int.'>'/2},
+ at samp{int.'=<'/2},
+ at samp{int.'>='/2},
+ at samp{int.abs/2},
+ at samp{int.max/3},
+ at samp{int.min/3},
+ at samp{int.to_float/2},
+ at samp{int.pow/2},
+ at samp{int.log2/2},
+ at samp{int.'+'/2},
+ at samp{int.'+'/1},
+ at samp{int.'-'/2},
+ at samp{int.'-'/1},
+ at samp{int.'*'/2},
+ at samp{int.'//'/2},
+ at samp{int.rem/2},
+
+ at samp{float.'<'/2},
+ at samp{float.'>'/2},
+ at samp{float.'>='/2},
+ at samp{float.'=<'/2},
+ at samp{float.abs/1},
+ at samp{float.abs/2},
+ at samp{float.max/2},
+ at samp{float.max/3},
+ at samp{float.min/2},
+ at samp{float.min/3},
+ at samp{float.pow/2},
+ at samp{float.log2/2},
+ at samp{float.float/1},
+ at samp{float.truncate_to_int/1},
+ at samp{float.truncate_to_int/2},
+ at samp{float.'+'/2},
+ at samp{float.'+'/1},
+ at samp{float.'-'/2},
+ at samp{float.'-'/1},
+ at samp{float.'*'/2},
+ at samp{float.'/'/2},
+
+ at samp{math.ceiling/1},
+ at samp{math.round/1},
+ at samp{math.floor/1},
+ at samp{math.sqrt/1},
+ at samp{math.pow/2},
+ at samp{math.exp/1},
+ at samp{math.ln/1},
+ at samp{math.log10/1},
+ at samp{math.log2/1},
+ at samp{math.sin/1},
+ at samp{math.cos/1},
+ at samp{math.tan/1},
+ at samp{math.asin/1},
+ at samp{math.acos/1},
+ at samp{math.atan/1},
+ at samp{math.sinh/1},
+ at samp{math.cosh/1},
+ at samp{math.tanh/1},

- at samp{string__length/2}.
+ at samp{string.length/2}.

 @node Aditi pragma declarations
 @subsection Aditi pragma declarations
@@ -9090,13 +9088,13 @@
 The examples make use of the following declarations:

 @example
-:- pred p(aditi__state::aditi_mui, int::out, int::out) is nondet.
+:- pred p(aditi.state::aditi_mui, int::out, int::out) is nondet.
 :- pragma base_relation(p/3).

-:- func f(aditi__state::aditi_mui, int::out) = (int::out) is nondet.
+:- func f(aditi.state::aditi_mui, int::out) = (int::out) is nondet.
 :- pragma base_relation(f/2).

-:- pred ancestor(aditi__state::aditi_mui, int::out, int::out) is nondet.
+:- pred ancestor(aditi.state::aditi_mui, int::out, int::out) is nondet.
 :- pragma aditi(ancestor/3).
 @end example

@@ -9140,12 +9138,12 @@

 The tuple to be inserted must have the same type signature as the relation
 being inserted into. All the arguments of the tuple (including the return value
-of a function) have mode @samp{in}, except the @samp{aditi__state} argument
+of a function) have mode @samp{in}, except the @samp{aditi.state} argument
 which has mode @samp{unused}.

 @item
 @samp{@var{DB0}} and @samp{@var{DB}} must be data-terms of type
- at samp{aditi__state}. They have mode @w{@samp{aditi_di, aditi_uo}}.
+ at samp{aditi.state}. They have mode @w{@samp{aditi_di, aditi_uo}}.
 @end itemize

 @sp 1
@@ -9226,7 +9224,7 @@
 @samp{@var{Closure}} must be a data-term which has a higher-order type with
 the same type signature as the base relation being updated.

-The @samp{aditi__state} argument of @samp{@var{Closure}} must have
+The @samp{aditi.state} argument of @samp{@var{Closure}} must have
 mode @samp{aditi_mui}. All other arguments must have mode @samp{out}.
 The determinism of @samp{@var{Closure}} must be @samp{nondet}.

@@ -9238,7 +9236,7 @@

 @item
 @samp{@var{DB0}} and @samp{@var{DB}} must be data-terms of type
- at samp{aditi__state}. They have mode @w{@samp{aditi_di, aditi_uo}}.
+ at samp{aditi.state}. They have mode @w{@samp{aditi_di, aditi_uo}}.
 @end itemize

 @sp 1
@@ -9333,7 +9331,7 @@
 @end example

 The type of @samp{InsertP} is
- at w{@samp{aditi_bottom_up pred(aditi__state, int, int)}}.
+ at w{@samp{aditi_bottom_up pred(aditi.state, int, int)}}.
 Its inst is @w{@samp{pred(aditi_mui, out, out) is nondet}},
 as for a normal lambda expression.

@@ -9394,9 +9392,9 @@

 The original tuple is given by the first set of arguments, which
 have mode @samp{out}. The updated tuple is given by the second set
-of arguments, which have mode @samp{out}. The @samp{aditi__state}
+of arguments, which have mode @samp{out}. The @samp{aditi.state}
 argument for the original tuple has mode @samp{aditi_mui}.
-The @samp{aditi__state} argument for the updated tuple has mode
+The @samp{aditi.state} argument for the updated tuple has mode
 @samp{unused}.

 The argument types of each tuple must match the argument types
@@ -9409,16 +9407,16 @@
 @samp{@var{Closure}} must be a data-term which has a higher-order type.

 When modifying a predicate with type declaration
- at w{@samp{:- pred p(aditi__state, @var{Type1}, @dots{})}}, @samp{@var{Closure}}
+ at w{@samp{:- pred p(aditi.state, @var{Type1}, @dots{})}}, @samp{@var{Closure}}
 must have type
- at samp{aditi_bottom_up pred(aditi__state, @var{Type1}, @dots{}, aditi__state, @var{Type1}, @dots{})},
+ at samp{aditi_bottom_up pred(aditi.state, @var{Type1}, @dots{}, aditi.state, @var{Type1}, @dots{})},
 and inst
 @w{@samp{pred(aditi_mui, out, @dots{}, unused, out, @dots{}) is nondet}}.

 When modifying a function with type declaration
- at w{@samp{:- func p(aditi__state, @var{Type1}, @dots{}) = @var{Type2}}},
+ at w{@samp{:- func p(aditi.state, @var{Type1}, @dots{}) = @var{Type2}}},
 @samp{@var{Closure}} must have type
- at samp{aditi_bottom_up pred(aditi__state, @var{Type1}, @dots{}, @var{Type2}, aditi__state, @var{Type1}, @dots{}, @var{Type2})},
+ at samp{aditi_bottom_up pred(aditi.state, @var{Type1}, @dots{}, @var{Type2}, aditi.state, @var{Type1}, @dots{}, @var{Type2})},
 and inst
 @w{@samp{pred(aditi_mui, out, @dots{}, out, unused, out, @dots{}, out) is nondet}}.

@@ -9428,7 +9426,7 @@

 @item
 @samp{@var{DB0}} and @samp{@var{DB}} must be data-terms of type
- at samp{aditi__state}. They have mode @w{@samp{aditi_di, aditi_uo}}.
+ at samp{aditi.state}. They have mode @w{@samp{aditi_di, aditi_uo}}.
 @end itemize

 @sp 2
@@ -9539,7 +9537,7 @@
 of the @samp{aditi_bulk_modify} call, resulting in a syntax error.

 The type of @samp{ModifyP} is
- at w{@samp{aditi_bottom_up pred(aditi__state, int, int, aditi__state, int, int)}}.
+ at w{@samp{aditi_bottom_up pred(aditi.state, int, int, aditi.state, int, int)}}.
 Its inst is @w{@samp{pred(aditi_mui, out, out, unused, out, out) is nondet}},
 as for a normal lambda expression.

@@ -9556,7 +9554,7 @@
 @item aggregate
 Aggregates are used to compute a value such as a sum over all the solutions
 for a predicate. Aggregates can be computed over Aditi predicates using
- at samp{aditi__aggregate_compute_initial} defined in
+ at samp{aditi.aggregate_compute_initial} defined in
 @file{$ADITI_HOME/doc/aditi.m} in the Aditi distribution.

 @item base relation
Index: transition_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/transition_guide.texi,v
retrieving revision 1.43
diff -u -r1.43 transition_guide.texi
--- transition_guide.texi	18 Mar 2004 03:42:10 -0000	1.43
+++ transition_guide.texi	20 Jan 2005 04:26:16 -0000
@@ -140,7 +140,7 @@
 input and output with side-effects.
 The mechanism that Mercury uses is the threading of an object
 that represents the state of the world through the computation.
-The type of this structure is @samp{io__state}.
+The type of this structure is @samp{io.state}.
 The modes of the two arguments that are added to calls are
 @samp{di} for ``destructive input'' and @samp{uo} for ``unique output''.
 The first means that the input variable
@@ -163,7 +163,7 @@
 in Mercury becomes

 @example
-:- pred write_total(int, io__state, io__state).
+:- pred write_total(int, io.state, io.state).
 :- mode write_total(in, di, uo) is det.

 write_total(Total, IO0, IO) :-
@@ -246,10 +246,10 @@

 @example
     ...
-    io__write_string("calling: ", IO6, IO7),
-    solve__write_goal(Goal, IO7, IO8),
+    io.write_string("calling: ", IO6, IO7),
+    solve.write_goal(Goal, IO7, IO8),
     ( solve(Goal) ->
-        io__write_string("succeeded\n", IO8, IO9),
+        io.write_string("succeeded\n", IO8, IO9),
         ...
     ;
         IO9 = IO8,
@@ -274,11 +274,11 @@

 The use of assert and retract should be replaced with
 a collection data structure threaded through the relevant part of the program.
-Data which is truly global may be stored in the @samp{io__state} using
-the predicates @samp{io__get_globals} and @samp{io__set_globals}.
+Data which is truly global may be stored in the @samp{io.state} using
+the predicates @samp{io.get_globals} and @samp{io.set_globals}.
 These predicates take an argument of type @samp{univ}, the universal
 type, so that by using @samp{type_to_univ} and @samp{univ_to_type} it
-is possible to store data of any type in the @samp{io__state}.
+is possible to store data of any type in the @samp{io.state}.

 The standard library contains
 several abstract data types for storing collections,
@@ -420,7 +420,7 @@
 Instead of appending elements to the end of a difference list by
 binding the tail pointer, you simply insert elements onto the
 front of a list accumulator.  At the end of the loop, you can
-call @samp{list__reverse} to put the elements in the correct order
+call @samp{list.reverse} to put the elements in the correct order
 if necessary.  Although this may require two traversals of the list,
 it is still linear in complexity, and it probably still runs faster
 than the Prolog code using difference lists.
@@ -521,8 +521,8 @@

 @example
 intersect(List1, List2, Intersection) :-
-	solutions(lambda([X::out] is nondet,
-	    (list__member(X, List1), list__member(X, List2))), Intersection).
+	solutions((pred(X::out) is nondet :-
+	    (list.member(X, List1), list.member(X, List2))), Intersection).
 @end example

 Alternately, this could also be written as
@@ -533,7 +533,7 @@

 :- pred member_of_both(list(T)::in, list(T)::in, T::out) is nondet.
 member_of_both(List1, List2, X) :-
-	list__member(X, List1), list__member(X, List2).
+	list.member(X, List1), list.member(X, List2).
 @end example

 @noindent
Index: user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.409
diff -u -r1.409 user_guide.texi
--- user_guide.texi	17 Jan 2005 05:58:02 -0000	1.409
+++ user_guide.texi	20 Jan 2005 04:24:43 -0000
@@ -2180,7 +2180,7 @@
 finds all the solutions to the goal.
 @sp 1
 For @samp{query} and @samp{cc_query}, the debugger will print
-out all the variables in the goal using @samp{io__write}.
+out all the variables in the goal using @samp{io.write}.
 The goal must bind all of its variables to ground terms,
 otherwise you will get a mode error.
 @sp 1
@@ -2414,9 +2414,9 @@
 (The compiler will keep the values
 of the input arguments of traced predicates as long as possible,
 but it cannot keep them beyond the point where they are destructively updated.)
-The exception is values of type `io__state';
+The exception is values of type `io.state';
 the debugger can perform a retry if the only missing value is of
-type `io__state' (there can be only one io__state at any given time).
+type `io.state' (there can be only one io.state at any given time).
 @sp 1
 Retries over I/O actions are guaranteed to be safe
 only if the events at which the retry starts and ends
@@ -2438,7 +2438,7 @@
 @c A retry in which the values of all input arguments are available
 @c works fine, provided that the predicates defined in C code that are
 @c called inside the repeated computation do not pose any problems.
- at c A retry in which a value of type `io__state' is missing has the
+ at c A retry in which a value of type `io.state' is missing has the
 @c following effects:
 @c @sp 1
 @c @itemize @bullet
@@ -4356,55 +4356,55 @@
 -----------------------------------------------

                 0.00        0.75       1/1           do_interpreter [3]
-[2]    100.0    0.00        0.75       1         io__run/0(0) [2]
-                0.00        0.00       1/1           io__init_state/2(0) [11]
+[2]    100.0    0.00        0.75       1         io.run/0(0) [2]
+                0.00        0.00       1/1           io.init_state/2(0) [11]
                 0.00        0.74       1/1           main/2(0) [4]

 -----------------------------------------------

                 0.00        0.75       1/1           call_engine_label [1]
 [3]    100.0    0.00        0.75       1         do_interpreter [3]
-                0.00        0.75       1/1           io__run/0(0) [2]
+                0.00        0.75       1/1           io.run/0(0) [2]

 -----------------------------------------------

-                0.00        0.74       1/1           io__run/0(0) [2]
+                0.00        0.74       1/1           io.run/0(0) [2]
 [4]     99.9    0.00        0.74       1         main/2(0) [4]
                 0.00        0.74       1/1           sort/2(0) [5]
                 0.00        0.00       1/1           print_list/3(0) [16]
-                0.00        0.00       1/10          io__write_string/3(0) [18]
+                0.00        0.00       1/10          io.write_string/3(0) [18]

 -----------------------------------------------

                 0.00        0.74       1/1           main/2(0) [4]
 [5]     99.9    0.00        0.74       1         sort/2(0) [5]
-                0.05        0.65       1/1           list__perm/2(0) [6]
+                0.05        0.65       1/1           list.perm/2(0) [6]
                 0.00        0.09   40320/40320       sorted/1(0) [10]

 -----------------------------------------------

-                                       8             list__perm/2(0) [6]
+                                       8             list.perm/2(0) [6]
                 0.05        0.65       1/1           sort/2(0) [5]
-[6]     86.6    0.05        0.65       1+8      list__perm/2(0) [6]
-                0.00        0.60    5914/5914        list__insert/3(2) [7]
-                                       8             list__perm/2(0) [6]
+[6]     86.6    0.05        0.65       1+8      list.perm/2(0) [6]
+                0.00        0.60    5914/5914        list.insert/3(2) [7]
+                                       8             list.perm/2(0) [6]

 -----------------------------------------------

-                0.00        0.60    5914/5914        list__perm/2(0) [6]
-[7]     80.0    0.00        0.60    5914         list__insert/3(2) [7]
-                0.60        0.60    5914/5914        list__delete/3(3) [8]
+                0.00        0.60    5914/5914        list.perm/2(0) [6]
+[7]     80.0    0.00        0.60    5914         list.insert/3(2) [7]
+                0.60        0.60    5914/5914        list.delete/3(3) [8]

 -----------------------------------------------

-                                   40319             list__delete/3(3) [8]
-                0.60        0.60    5914/5914        list__insert/3(2) [7]
-[8]     80.0    0.60        0.60    5914+40319  list__delete/3(3) [8]
-                                   40319             list__delete/3(3) [8]
+                                   40319             list.delete/3(3) [8]
+                0.60        0.60    5914/5914        list.insert/3(2) [7]
+[8]     80.0    0.60        0.60    5914+40319  list.delete/3(3) [8]
+                                   40319             list.delete/3(3) [8]

 -----------------------------------------------

-                0.00        0.00       3/69283       tree234__set/4(0) [15]
+                0.00        0.00       3/69283       tree234.set/4(0) [15]
                 0.09        0.09   69280/69283       sorted/1(0) [10]
 [9]     13.3    0.10        0.10   69283         compare/3(0) [9]
                 0.00        0.00       3/3           __Compare___io__stream/0(0) [20]
@@ -4422,7 +4422,7 @@
 The first entry is @samp{call_engine_label} and its parent is
 @samp{<spontaneous>}, meaning that it is the root of the call graph.
 (The first three entries, @samp{call_engine_label}, @samp{do_interpreter},
-and @samp{io__run/0} are all part of the Mercury runtime;
+and @samp{io.run/0} are all part of the Mercury runtime;
 @samp{main/2} is the entry point to the user's program.)

 Each entry of the call graph profile consists of three sections, the parent
@@ -4465,8 +4465,8 @@
 The predicate or function names are not just followed by their arity but
 also by their mode in brackets.  A mode of zero corresponds to the first mode
 declaration of that predicate in the source code.  For example,
- at samp{list__delete/3(3)} corresponds to the @samp{(out, out, in)} mode
-of @samp{list__delete/3}.
+ at samp{list.delete/3(3)} corresponds to the @samp{(out, out, in)} mode
+of @samp{list.delete/3}.

 Now for the parent and child procedures the self and descendent time have
 slightly different meanings.  For the parent procedures the self and descendent
@@ -4536,7 +4536,7 @@

 On some operating systems,
 Mercury's profiling doesn't work properly with shared libraries.
-The symptom is errors (@samp{map__lookup failed}) or warnings from @samp{mprof}.
+The symptom is errors (@samp{map.lookup failed}) or warnings from @samp{mprof}.
 On some systems, the problem occurs because the C implementation
 fails to conform to the semantics specified by the ISO C standard
 for programs that use shared libraries.

--------------------------------------------------------------------------
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