[MLton] Added completion to esml-mlb-mode

Stephen Weeks MLton@mlton.org
Fri, 19 Aug 2005 19:20:13 -0700


> This may not be what you want. The forceUsed annotation
> doesn't actually allow an argument:
...
> Below is a trivial patch that changes the output of -show-anns
> on forceUsed to
>
>   forceUsed {}

I don't like this because my (perhaps overly pedantic) brain reads
this as "no argument can validly follow forceUsed", and hence
forceUsed can not be used.  I would be OK with simply

  forceUsed

Of course, this begins to complicate the output format.

> Related, the expert annotation ffiStr takes a <longid> argument, not a 
> "NONE | SOME <longid>" argument.

OK.  I tweaked it to output

  ffiStr {<longstrid>}

Now, mlton -expert true -show-anns true displays:

  allowConstant {false|true}
  allowFFI {false|true}
  allowOverload {false|true}
  allowPrim {false|true}
  allowRebindEquals {false|true}
  deadCode {false|true}
  ffiStr {<longstrid>}
  forceUsed
  nonexhaustiveExnMatch {default|ignore}
  nonexhaustiveMatch {warn|ignore|error}
  redundantMatch {warn|ignore|error}
  sequenceNonUnit {ignore|error|warn}
  warnUnused {false|true}

Hopefully this doesn't cause too much problem for Vesa's (or other
future) readers.  If it does, I'm willing to go with a more consistent
format.

> With regards to forceUsed, remember that it does not mean to mark every
> identifier encountered in the body of the annotation as used; instead, it
> means to mark as used all identifiers in scope at the end of the 
> annotation as used.
> 
> In fact, ffiStr is somewhat the same -- it "does something" at the end of 
> the annotation scope, rather than during the elaboration of the body of 
> the annotation.
> 
> That difference in behavior is why it might make sense to leave their
> syntax as "action" annotations rather than "toggle" annotations.

Fair enough.  Although I don't find it difficult to read a forceUsed
toggle as saying either "do" or "do not" mark everthing in scope at
the end of the annotation as used.