[m-rev.] for review: tone down references to ISO Prolog in documentation

Julien Fischer jfischer at opturion.com
Tue Dec 31 00:59:42 AEDT 2019


For review by anyone.

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

Tone down references to ISO Prolog in documentation.

doc/reference_manual.texi:
    Don't compare tokens and terms to in Mercury to those in ISO Prolog.
    Unless the reader has a copy of the standard to hand doing so isn't all
    that helpful -- it doesn't really add anything in any case.  (The
    transition guide already points out the differences for those coming
    to Mercury from Prolog.)

library/parser.m:
    Delete some irrelevant comments, viz. the parser is intended to
    follow ISO Prolog, where Fergus was in relation to his copy of
    the ISO draft and some stuff about NU-Prolog compatibility hacks
    that were removed years ago.

    Utilise the available space better.

diff --git a/doc/reference_manual.texi b/doc/reference_manual.texi
index d50217f..d229571 100644
--- a/doc/reference_manual.texi
+++ b/doc/reference_manual.texi
@@ -82,7 +82,7 @@ into another language, under the above conditions for modified versions.
  @c                       that hold.
  @menu
  * Introduction::      A brief introduction to Mercury.
-* Syntax::            Mercury's syntax is similar to ISO Prolog.
+* Syntax::            A description of Mercury's syntax.
  * Types::             Mercury has a strong parametric polymorphic type system.
  * Modes::             Modes allow you to specify the direction of data flow.
  * Unique modes::      Unique modes allow you to specify when there is only one
@@ -224,12 +224,7 @@ whitespace is defined to be the following characters:
  @node Tokens
  @section Tokens

-Tokens in Mercury are the same as in ISO Prolog.
-The only differences are the @samp{#@var{line}} token,
-which is used as a line number directive (see below)
-and the backquote (@samp{`}) token.
-
-The different tokens are as follows.
+The different tokens in Mercury are as follows.
  Tokens may be separated by whitespace.

  @table @emph
@@ -417,19 +412,6 @@ The end of file.
  @node Terms
  @section Terms

-Syntactically, terms in Mercury are exactly the same as in ISO Prolog,
-except that as extensions we permit higher-order terms
-and the introduction of infix operators
-by the use of grave accents (backquotes), as described below,
-and we support an extended set of builtin operators.
- at xref{Builtin operators}.
-Also, the constructor for list terms in Mercury is @code{[|]/2},
-not @code{./2} as in Prolog.
-
-Note, however, that the meaning of some terms in Mercury
-is different to that in Prolog.
- at xref{Data-terms}.
-
  A term is either a variable or a functor.

  A functor is an integer, a float, a string, a name, a compound term,
diff --git a/library/parser.m b/library/parser.m
index a4c0361..fdb2720 100644
--- a/library/parser.m
+++ b/library/parser.m
@@ -2,7 +2,7 @@
  % vim: ft=mercury ts=4 sw=4 et
  %---------------------------------------------------------------------------%
  % Copyright (C) 1995-2001, 2003-2008, 2011-2012 The University of Melbourne.
-% Copyright (C) 2014-2018 The Mercury team.
+% Copyright (C) 2014-2019 The Mercury team.
  % This file is distributed under the terms specified in COPYING.LIB.
  %---------------------------------------------------------------------------%
  %
@@ -10,27 +10,16 @@
  % Main author: fjh.
  % Stability: high.
  %
-% This file exports the predicate read_term, which reads
-% a term from the current input stream.
-% The read_term_from_string predicates are the same as the
-% read_term predicates, except that the term is read from
-% a string rather than from the current input stream.
-% The parse_token_list predicate is similar,
-% but it takes a list of tokens rather than a string.
-%
-% The parser and lexer are intended to exactly follow ISO Prolog
-% syntax, but there are some departures from that for three reasons:
-%
-%   (1) I wrote some of the code at home when the ISO Prolog draft
-%       was at uni - so in some places I just guessed.
-%   (2) In some places the lexer reports an error when it shouldn't.
-%   (3) There are a couple of hacks to make it compatible with NU-Prolog
-%       syntax.
+% This file exports the predicate read_term, which reads a term from the
+% current input stream. The read_term_from_string predicates are the same as
+% the read_term predicates, except that the term is read from a string rather
+% than from the current input stream. The parse_token_list predicate is
+% similar, but it takes a list of tokens rather than a string.
  %
  % The parser is a relatively straight-forward top-down recursive descent
  % parser, made somewhat complicated by the need to handle operator
  % precedences.  It uses `lexer.get_token_list' to read a list of tokens.
-% It uses the routines in module `ops' to look up operator precedences.
+% It uses the routines from the module `ops' to look up operator precedences.
  %
  %---------------------------------------------------------------------------%
  %---------------------------------------------------------------------------%


More information about the reviews mailing list