[m-dev.] op/3 changes (2 of 5): diff -u library/ops.m
doug.auclair at logicaltypes.com
doug.auclair at logicaltypes.com
Fri Feb 3 06:20:31 AEDT 2006
--- ops.m.~1.47.2.2.~ 2006-02-02 07:38:02.000000000 -0500
+++ ops.m 2006-02-02 07:37:48.000000000 -0500
@@ -23,6 +23,11 @@
%-----------------------------------------------------------------------------%
:- module ops.
+
+% modified: January 1, 2006, DMA (Douglas M. Auclair) -- Happy New Year!
+% changed: Added a map implementation for the Mercury syntax to allow for
+% mutable syntax with an op/3 declaration.
+
:- interface.
:- typeclass ops__op_table(Table) where [
@@ -146,10 +151,18 @@
:- type ops__table == ops__mercury_op_table.
+ % ops__category is used to index the op_table so that
+ % lookups are semidet rather than nondet.
+ % Prefix and binary_prefix operators have ops__category `before'.
+ % Infix and postfix operators have ops__category `after'.
+:- type ops__category ---> before ; after.
+
%-----------------------------------------------------------------------------%
:- implementation.
+:- import_module string, require.
+
ops__op_specifier_to_class(fx, prefix(x)).
ops__op_specifier_to_class(fy, prefix(y)).
ops__op_specifier_to_class(xf, postfix(x)).
@@ -163,12 +176,6 @@
:- type ops__mercury_op_table ---> ops__mercury_op_table.
- % ops__category is used to index the op_table so that
- % lookups are semidet rather than nondet.
- % Prefix and binary_prefix operators have ops__category `before'.
- % Infix and postfix operators have ops__category `after'.
-:- type ops__category ---> before ; after.
-
ops__init_mercury_op_table = ops__mercury_op_table.
:- instance ops__op_table(ops__mercury_op_table) where [
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list