Running a top-level R6RS program under PLT Racket
With the setup described in my previous post on Larceny, I could find no way to run the same top-level program under PLT Racket. That language processor requires all libraries to be contained in “collections,” i.e., directories.
Accordingly, I created a subdirectory called greeting, moved greeting.sls into it, and revised the import clause of the top-level greeter to read
(import (greeting greeting))
I also revised the library name at the beginning of greeting.sls to read
(greeting greeting (0 0))
In both cases, the idea was to identify the contents of the greeting.sls file as a library called greeting within a collection also called greeting.
I discovered that, because of the diversity of language variants that the PLT Racket processor accepts and distinguishes, R6RS library modules must begin with the comment
#!r6rs
in order to be recognized.
With these changes, I found that the command
plt-r6rs ++path . top-level-greeter.ss
executed the program.
I confirmed that the Larceny and Ikarus Scheme command lines that I worked out continued to work under the new arrangement of files:
ikarus --r6rs-script top-level-greeter.ss larceny -r6rs -path . -program top-level-greeter.ss