[MLton] Non-exhaustive exn fn match
Vesa Karvonen
vesa.karvonen@cs.helsinki.fi
Sun, 17 Jul 2005 17:47:14 +0300
Quoting Matthew Fluet <fluet@cs.cornell.edu>:
> How does "warnExnMatch" sound for the annotation name?
Sounds good to me.
> 1) Add an "allowFFI {false|true}" annotation, which would simultaneously
> affect "allowImport", "allowExport", and "allowSymbol" (corresponding
> to the new _symbol primitive). The fine-grained control is nice, but
> as we argued with _symbol, as soon as you want one, you're likely to
> want the others.
Sounds reasonable to me. [I think that the fine-grained control is also
good.]
> 2) Extend the general syntax of annotations to
> ann "[compiler:]ann [opt ...]" in basexp end
>
> The idea is that a compiler should silently ignore annotations marked
> for a different compiler, while it may issue a warning for unmarked
> annotations that it doesn't understand.
I'm not sure about this one. For (mostly) semantics preserving annotations
(e.g. enabling/disabling warnings) I would probably prefer to get no
warnings on compilers that do not happen to support the annotations. For
semantics modifying annotations (e.g. enabling extensions) I would probably
prefer to get a warning or even an error (better to get a single specific
error than dozens of errors for a program using an extension). So, one
alternative might be to allow an annotation to be annotated as "optional"
(default) or "required" (to get a warning or error). This way the annotations
would not be dependent upon particular compilers.
-Vesa Karvonen