[m-rev.] for review: change list constructor from `./2' to `[|]/2'
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Sep 24 12:33:15 AEST 2001
On 23-Sep-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> Change the list constructor from `./2' to `[|]/2'. `./2' will
> eventually become the module qualification operator.
Ah, great. Thanks.
Are there any bootstrapping issues with this change?
> +++ NEWS 2001/09/23 03:44:04
> @@ -22,6 +22,11 @@
> Reference Manual.
>
> Changes to the Mercury standard library:
> +* The constructor for lists is now called '[|]' rather than '.'.
> + `./2' will eventually become the module qualification operator.
> + This change only affects programs which use `./2' explicitly.
> + Programs which only use the `[H | T]' syntax will be unaffected.
This is a change to the language rather than to the standard library.
> Index: doc/reference_manual.texi
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
> retrieving revision 1.215
> diff -u -u -r1.215 reference_manual.texi
> --- doc/reference_manual.texi 2001/08/17 03:52:35 1.215
> +++ doc/reference_manual.texi 2001/09/23 10:14:09
> @@ -316,25 +316,49 @@
> introduction of infix operators by the use of grave accents (backquotes),
> as described below,
> and we support an extended set of builtin operators. @xref{Builtin Operators}.
> -However, the meaning of some terms in Mercury is different to that
> -in Prolog. @xref{Data-terms}.
> +Also, the constructor for list terms in Mercury is @code{[|]/2}, not
> + at code{./2} as in Prolog. The meaning of some terms in Mercury is
> +different to that in Prolog. @xref{Data-terms}.
I think it would be better to split the last sentence into a new
paragraph:
Note, however, that the meaning of some terms ...
> +The following terms are all equivalent:
> + at example
> +[1, 2, 3]
> +[1, 2 | [3]]
> +[1 | [2, 3]]
> +'[|]'(1, '[|]'(2, '[|]'(3, [])))
> + at end example
I suggest also including
[1, 2, 3 | []]
in that list of examples.
> Index: tests/debugger/declarative/app.exp
> ===================================================================
> RCS file: /home/mercury1/repository/tests/debugger/declarative/app.exp,v
> retrieving revision 1.10
> diff -u -u -r1.10 app.exp
> --- tests/debugger/declarative/app.exp 2000/10/01 03:13:42 1.10
> +++ tests/debugger/declarative/app.exp 2001/09/23 07:34:37
> @@ -15,7 +15,10 @@
> mdb> finish -n
> 16: 5 5 EXIT pred app:app/3-0 (det) app.m:26 (app.m:28)
> mdb> dd
> -app([4, 5], [6, 7, 8], [4, 5, 6, 7, 8])
> +pred app
> + [4, 5]
> + [6, 7, 8]
> + [4, 5, 6, 7, 8]
That change appears to be unrelated.
> +++ tests/debugger/declarative/app.exp2 2001/09/23 08:15:49
> @@ -15,7 +15,10 @@
> mdb> finish -n
> 16: 5 5 EXIT pred app:app/3-0 (det) app.m:26 (app.m:28)
> mdb> dd
> -app([4, 5], [6, 7, 8], [4, 5, 6, 7, 8])
> +pred app
> + [4, 5]
> + [6, 7, 8]
> + [4, 5, 6, 7, 8]
Likewise.
> +++ tests/debugger/declarative/filter.exp 2001/09/23 07:34:48
> @@ -30,7 +30,10 @@
> Valid? no
> s2([7, 8, 9])
> Valid? yes
> -my_append([1, 2], [7, 8, 9], [1, 2, 7, 8, 9])
> +pred my_append
> + [1, 2]
> + [7, 8, 9]
> + [1, 2, 7, 8, 9]
> Valid? yes
> Found incorrect contour:
> p([1, 2, 7, 8, 9])
> @@ -45,7 +48,10 @@
> Valid? no
> s1([1, 2, 3])
> Valid? yes
> -my_append([1, 2, 3], [9], [1, 2, 3, 9])
> +pred my_append
> + [1, 2, 3]
> + [9]
> + [1, 2, 3, 9]
Likewise for those two.
> +++ tests/debugger/declarative/filter.exp2 2001/09/23 08:17:47
> @@ -30,7 +30,10 @@
> Valid? no
> s2([7, 8, 9])
> Valid? yes
> -my_append([1, 2], [7, 8, 9], [1, 2, 7, 8, 9])
> +pred my_append
> + [1, 2]
> + [7, 8, 9]
> + [1, 2, 7, 8, 9]
> Valid? yes
> Found incorrect contour:
> p([1, 2, 7, 8, 9])
> @@ -45,7 +48,10 @@
> Valid? no
> s1([1, 2, 3])
> Valid? yes
> -my_append([1, 2, 3], [9], [1, 2, 3, 9])
> +pred my_append
> + [1, 2, 3]
> + [9]
> + [1, 2, 3, 9]
Likewise.
> +++ tests/debugger/declarative/queens.exp 2001/09/23 08:19:27
> @@ -17,9 +17,15 @@
> Call qperm([1, 2, 3, 4, 5], _)
> No solutions.
> Complete? no
> -qdelete(1, [1, 2, 3, 4, 5], [2, 3, 4, 5])
> +pred qdelete
> + 1
> + [1, 2, 3, 4, 5]
> + [2, 3, 4, 5]
> Valid? yes
> -qdelete(2, [1, 2, 3, 4, 5], [1, 3, 4, 5])
> +pred qdelete
> + 2
> + [1, 2, 3, 4, 5]
> + [1, 3, 4, 5]
> Valid? yes
> Call qperm([1, 3, 4, 5], _)
> No solutions.
Likewise.
Otherwise this change looks fine.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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