SMLFamily / BasisLibrary

Repository and Wiki for enriching the Standard ML Basis Library
60 stars 4 forks source link

Expose ML implementation name in the REPL #15

Open eduardoleon opened 8 years ago

eduardoleon commented 8 years ago

I'd like interactive Successor ML implementations to expose their name as a standardized global constant:

val topLevelName : unit -> string

This way, it would be easier to work around differences between implementations, writing code that looks like this:

case topLevelName () of
    "Poly/ML" => use "Foo.PolyML.sml"
  | "MosML" => use "Foo.MosML.sml"
  | "SML/NJ" => use "Foo.SMLNJ.sml"

Thus avoiding the need to use arcane external tools for building programs.

JohnReppy commented 8 years ago

I do not think that we should be relying on the REPL for configuring builds. I think that something like smackage is a better approach.

That said, adding a standard way to query vendor information from SML does seem like a reasonable feature. It could either go into a new module or be added to the General structure.