[MLton] can mlbasis rename the top-level?

Wesley W. Terpstra wesley@terpstra.ca
Wed, 7 Sep 2005 16:00:59 +0200


On Sep 7, 2005, at 3:51 PM, Matthew Fluet wrote:
> Another thought: we could push even closer to the 'here-document'  
> approach and allow the opening/closing delimiters be chosen on a  
> per-instance basis.  For example, I don't imagine it is that much  
> harder to allow an opening delimiter that matches the reg-exp:
>  {<+{
> and a closing delimeter that matches the reg-exp:
>  }>+}
> with the additional requirement that the number of < in the opening  
> is equal to the number of > in the closing.  Now you can always  
> find an opening/closing pair that doesn't conflict with any finite  
> amount of SML code.

Forgive me for being stupid, but why not just use { and } ?

It's easy to keep a count of the opening and closing {}s in the lexer.
The only detail would be (afaics) to watch out for nested comments
(since they could have unmatched {}s), but that just needs another
state in the lexer.