[m-dev.] for review: make unboxed enums and no-tag types optional

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Aug 9 16:03:55 AEST 2000


On 09-Aug-2000, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> Index: compiler/options.m
> @@ -1931,7 +1938,16 @@
>  		"\tThe C code needs to be compiled with `-UBOXED_FLOAT'.",
>  		"\tIt may also need to be compiled with",
>  		"\t`-DUSE_SINGLE_PREC_FLOAT', if double precision",
> -		"\tfloats don't fit into a word."
> +		"\tfloats don't fit into a word.",
> +
> +		"--unboxed-enums",
> +		"(This option is not for general use.)",
> +		"\tDon't box enumerations.  This option is set by default.",

For consistency with the documentation for the rest of the options,
if an option is enabled by default, then you should document the
inverse option (`--no-unboxed-enums' in this case).

If you don't like the double negation, then you could provide an
option `--boxed-enums', either in addition to or instead of the
`--no-unboxed-enums' option.  (If you want to allow both, this can be
handled by one of them being a bool_special option.)  For consistency
whatever you do here should also be done for `--unboxed-float'. 

> +		"--no-tag-types",
> +		"(This option is not for general use.)",
> +		"\tDon't allow unboxed no-tag types.",
> +		"\tThis option is set by default."

Clearly the double and triple negatives are getting confusing,
since your documentation here inverts the sense of the option.

Likewise here since the option is set by default, you
should document its inverse, the `--no-no-tag-types' option(!).

In fact using `--no-tag-types' as an option name won't work, because
"--no-" prefix is reserved for use as the negation operator.  If you
try to use that option, getopt will complain about there being no such
option as the `--tag-types' option.

So, I suggest you name the option `--unboxed-no-tag-types'/
`--boxed-no-tag-types', or perhaps `--unboxed-trivial-types'/
`--boxed-trivial-types'.  In addition, the documentation should
explain what a "no-tag" or "trivial" type is.

Finally, anything documented here should also be documented in
doc/user_guide.texi.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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