4.7.5 The Language structure

opOptional

Compatibility option

Structure

Shell.Options.Language

Type

val opOptional: bool option

Description

If true, set op as optional when unambiguous. The Definition of Standard ML declares that when an operator identifier is used as something other than an operator -- for example, using an operator identifier as a variable identifier as well -- it must be preceded by the reserved word op. However, there are cases in which the usage is unambiguous, and op is therefore redundant.

Example

The following example demonstrates the use of opOptional for an unambiguous datatype:

MLWorks> infix &&&;
MLWorks> datatype Foo = &&&;
MLWorks>

An error browser containing the message "Need an op for &&&" appears. The evaluation fails because &&& is not prefixed with an op. However, it is clearly an unambiguous case. With opOptional set to true, MLWorks accepts it:

MLWorks> set (opOptional, true);
val it : unit = ()
MLWorks> datatype Foo = &&&;
datatype Foo =
  &&&
val &&& : Foo
MLWorks>

Further, supplying an op with this option set to true will produce a warning, reminding you that it is unnecessary.


MLWorks Reference Manual (version 1.0) - 3 DEC 1996

Generated with Harlequin WebMaker