[plt-scheme] default file for planet shorthand "require"s, other than "main.ss"

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Dec 7 08:41:02 EST 2008

At Sun, 07 Dec 2008 05:20:22 -0500, Neil Van Dyke wrote:
> For the shorthand form of "planet" "require", which currently permits 
> the file name to default to "main.ss", would it be possible to make that 
> default to a file specified in "info.ss" (e.g., the existing 
> "primary-file" field)?

It's possible, and it sounds easy, but I think it would create new
problems for tracking compilation dependencies and managing bytecode. I
can't quite put my finger on what could go wrong, but this change would
be something like adding a search path, and search paths always seem to
create trouble.

> I think it's the usual case that we want a default file, but it's also 
> the usual case (at least when editing multiple PLaneT packages in Emacs 
> simultaneously), that we want to name the default files something other 
> than "main.ss".

I see what you mean, but how about treating "main.ss" like "info.ss"?
That is, just have it re-export the content of whatever module you'd
rather have been the main module:

   #lang scheme/base
   (require "actual-main.ss")
   (provide (all-from-out "actual-main.ss"))

Instead of putting the mapping in "info.ss", this pushes the
indirection all the way down into the module system. I think that's why
it works better than trying to manage the indirection at the "info.ss"


Posted on the users mailing list.