[MLton] can mlbasis rename the top-level?

Vesa Karvonen vesa.karvonen@cs.helsinki.fi
Tue, 6 Sep 2005 23:00:13 +0300


Quoting Matthew Fluet <fluet@cs.cornell.edu>:
> [...] I think some 
> sort of "escape" mechanism, like in MLYacc for dentoting semantic actions 
> or "here documents" in bash, would be useful:
> 
> local
>    $(SML_LIB)/basis/basis.mlb
>    $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
> in
> {{{
>    structure IntRedBlackMap = RedBlackMapFn(type ord_key = int
>                                             val compare = Int.compare)
> }}}
> end
> 
> I like the idea of delimiting the the sml in a manner that doesn't require 
> embedding the SML grammar in the MLB grammar.

I would much prefer something like

  local
     $(SML_LIB)/basis/basis.mlb
     $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb
  in
     sml
        structure IntRedBlackMap = RedBlackMapFn(type ord_key = int
                                                 val compare = Int.compare)
     end
  end

but then you would need to tokenize the SML code and count nested blocks
(let|local|struct|sig ... end). No need to embed the full grammar, though.

-Vesa Karvonen