[m-rev.] Add `.' as a module separator.
Ralph Becket
rafe at cs.mu.OZ.AU
Tue Dec 3 16:17:35 AEDT 2002
Estimated hours taken: 3
Branches: main
Added infix `.' as a module separator. This is paving the way to phasing
out `:' as a module separator in order to use it as a synonym for `with_type`
instead.
NEWS:
Report the change.
compiler/prog_io.m:
compiler/type_util.m:
Changed so that `.'/2 is recognised as a module separator.
library/ops.m:
Change associativity of `.'/2 from xfy to yfx.
Index: NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.289
diff -u -r1.289 NEWS
--- NEWS 3 Dec 2002 04:49:07 -0000 1.289
+++ NEWS 3 Dec 2002 05:11:08 -0000
@@ -5,7 +5,7 @@
==========
Changes to the Mercury language:
-* Nothing yet.
+* Infix `.' is now accepted as a module name separator.
Changes to the Mercury compiler:
* Nothing yet.
@@ -26,7 +26,10 @@
Changes to the Mercury language:
-* Nothing yet.
+* Infix `.' is now accepted as a module name separator. Hence it is
+ now possible to write io.write_string and list.member to mean the
+ same thing as io__write_string and list__member, for instance. This
+ has required changing the associativity of `.' from xfy to yfx.
Changes to the Mercury standard library:
Index: compiler/prog_io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io.m,v
retrieving revision 1.210
diff -u -r1.210 prog_io.m
--- compiler/prog_io.m 1 Aug 2002 00:41:37 -0000 1.210
+++ compiler/prog_io.m 2 Dec 2002 03:49:16 -0000
@@ -3324,7 +3324,11 @@
:- mode parse_symbol_name(in, out) is det.
parse_symbol_name(Term, Result) :-
(
- Term = term__functor(term__atom(":"), [ModuleTerm, NameTerm], _Context)
+ Term = term__functor(term__atom(FunctorName),
+ [ModuleTerm, NameTerm], _Context),
+ ( FunctorName = ":"
+ ; FunctorName = "."
+ )
->
(
NameTerm = term__functor(term__atom(Name), [], _Context1)
@@ -3417,8 +3421,11 @@
parse_qualified_term(Term, ContainingTerm, Msg, Result) :-
(
- Term = term__functor(term__atom(":"), [ModuleTerm, NameArgsTerm],
- _Context)
+ Term = term__functor(term__atom(FunctorName),
+ [ModuleTerm, NameArgsTerm], _Context),
+ ( FunctorName = "."
+ ; FunctorName = ":"
+ )
->
(
NameArgsTerm = term__functor(term__atom(Name), Args, _Context2)
Index: compiler/type_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/type_util.m,v
retrieving revision 1.109
diff -u -r1.109 type_util.m
--- compiler/type_util.m 1 Nov 2002 07:06:59 -0000 1.109
+++ compiler/type_util.m 2 Dec 2002 03:42:37 -0000
@@ -655,10 +655,13 @@
% include arguments with these types.
type_util__is_dummy_argument_type(Type) :-
- Type = term__functor(term__atom(":"), [
+ Type = term__functor(term__atom(FunctorName), [
term__functor(term__atom(ModuleName), [], _),
term__functor(term__atom(TypeName), TypeArgs, _)
], _),
+ ( FunctorName = "."
+ ; FunctorName = ":"
+ ),
list__length(TypeArgs, TypeArity),
type_util__is_dummy_argument_type_2(ModuleName, TypeName, TypeArity).
Index: library/ops.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/ops.m,v
retrieving revision 1.40
diff -u -r1.40 ops.m
--- library/ops.m 9 Jul 2002 01:30:20 -0000 1.40
+++ library/ops.m 2 Dec 2002 02:11:06 -0000
@@ -264,7 +264,7 @@
ops__op_table("--->", after, xfy, 1179). % Mercury extension
ops__op_table("-->", after, xfx, 1200). % standard ISO Prolog
ops__op_table("->", after, xfy, 1050). % standard ISO Prolog
-ops__op_table(".", after, xfy, 600). % traditional Prolog (not ISO)
+ops__op_table(".", after, yfx, 600). % traditional Prolog (not ISO)
ops__op_table("/", after, yfx, 400). % standard ISO Prolog
ops__op_table("//", after, yfx, 400). % standard ISO Prolog
ops__op_table("/\\", after, yfx, 500). % standard ISO Prolog
--------------------------------------------------------------------------
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