[plt-scheme] Standard ML in PLT Scheme

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Thu Dec 20 14:28:47 EST 2007

ML structure is mapped to PLT unit; ML signature is just signature of 
PLT unit.

#lang sml
structure foo =

will be treat as

(module foo@ (lib "ml.ss" "sml")
  (provide foo@)
  (provide sig ...)
  (define-signature sig ...)
  (define-unit-binding foo@ ...))

So to import such a ML structure in Scheme, you need to

(require foo@)
(define-values/invoke-unit/infer foo@)

I just uploaded another "sml.plt" to the webpage, which contains a 
"collects/sml/lib/" directory. Under the directory there is a ML 
structure translated into Scheme (a .sig file and a .ss file)

Trying the following in MzScheme:

#lang sml
structure bar :> sig val x : int end =
    open foo

Seeing "foo", which is not previously defined, the compiler will go to 
the "collects/sml/lib/" directory to load the file. The "foo at .ss/sig" 
file can be generated from ML code, or can be any Scheme code that meets 
the interface.


Matthias Felleisen wrote:
> Nice. Could you demonstrate how SML and Scheme modules/units can 
> import/export from each other? -- Matthias
> On Dec 20, 2007, at 9:32 AM, Chongkai Zhu wrote:
>> We are pleased to announce the first public release of Standard ML in 
>> DrScheme. The objective of this project is to provide a development 
>> environment that the user can easily write a project partly in SML 
>> and partly in Scheme.
>> For more information, installation instructions, and sample please 
>> check out the project web site:
>>  http://www.cs.utah.edu/~czhu/sml.htm
>> All comments, suggestions for enhancements, bug reports, etc. are 
>> welcome!
>> Cheers,
>> Chongkai Zhu
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.