All of the following refers to ISO/IEC 13211-1:1995.
Let me move inside out...
6.5.1 graphic char = ":";
graphic char = "-";
6.4.2 graphic token char = graphic char;
graphic token = graphic token char, { graphic token char };
name token = graphic token;
6.4 name = [ layout text sequence (* 6.4.1 *) ], name token;
6.3.1.3 atom = name;
6.5.3 open char = "(";
close char = ")";
comma char = ",";
6.4.8 open token = open char;
close token = close char;
comma token = comma char;
6.4.1 (* grammar rules for layout text sequence were omitted *)
6.4 comma = comma token;
open ct = open token;
close = [ layout text sequence ], close token;
6.3.3.1 arg = atom; (* if that atom is an operator *)
arg = term; (* otherwise: priority = 999 *)
6.3.3 arg list = arg;
arg list = arg, comma, arg list;
6.3.3 term = atom, open ct, arg list, close ;
So we come back to the initial question:
These round brackets used to be necessary. But today, they are no longer needed. Why are they no longer needed? How does the standard cope with this situation?
Let's assume T = op(1200,fx,:-)
holds.
T
is a compound term provided in functional notation.
T
is covered by above rule term = atom, open ct, arg list, close;
atom
matches op
, which is the functor of T
.
open ct matches an open bracket.
the "middle part" (the arguments of T
) is covered by the grammar rules for arg list
.
arg list
is a non-empty list of arg
.
What's arg
?
a term with priority less than 1000, the priority of (',')/2. E.g., 1200
and fx
.
an atom that is an operator. (No strings attached!)
close matches a closing bracket.
Quoting:
An argument (represented by arg
in the syntax rules occurs as the argument of a compount term or element of a list. It can be an atom which is an operator,or a term with priority not greater than 999. When an argument is an arbitrary term, its priority shall be less than the priority of the ',' (comma) operator so that there is no conflict between comma as an infix operator and comma as an argument or list element separator.
Note:
This concept of an "argument" ensures that both the terms f(x,y)
and f(:-, ;, [:-, :-|:-])
are syntactically valid whatever operator definitions are currently defined. Comma is not an atom and the following "terms" have syntax errors: f(,,a)
, [a,,|v]
, and [a,b|,]
; but the following two terms are syntactically valid: f(',',a)
, [a,','|v]
, and [a,b|',']
.