scheme shell
about
download
support
resources
docu
links
 
scsh.net
From: kelsey2@s48.org (Richard Kelsey)
Newsgroups: comp.lang.scheme.scsh
Subject: Re: How to reference a package?
Date: 12 May 2002 19:37:43 -0700
Organization: http://groups.google.com/
Message-ID: <1383b6a.0205121837.24454e96@posting.google.com>

scsh@memebeam.org wrote in message 
news:<E176G9q-0004Qp-00@sub-d.memebeam.com>...

> I didn't find any documentation that spells out the relationship
> between eval and the module system. I think you are correct that S48
> structures are second class. On the other hand, it seems like the
> packages behind the structures are first class.

Structures and packages are compile-time values, not run-time
ones. At compile-time they are first-class; at run-time they
no longer enter the picture.  Scheme 48's module system keeps
compile time and run time separate.  So it isn't that structures
are second class, they are just segregated by the module system.

You can use the command interpreter to get your hands on packages:

  > ,open packages		; for STRUCTURE-PACKAGE
  > ,config (define-structure test (export)
              (open scheme)
	      (begin (define x 10)))
  ; no values returned
  > ,load-package test
  > ,config test
  #{Structure 178 test}
  > (eval 'x (structure-package ##))
  10
  > 

And, because the command interpreter is itself available in a 
structure, you can run commands directly from code:

  > ,open command-processor
  ; Now we do the equivalent of ',config test'
  > (eval '(config '(run test))
           (user-command-environment))
  #{Structure 178 test}

I don't recommend doing this.  I think that keeping compile time
and run time values separate is a good idea.

> <lament> It is too bad that nobody has found the time to create a
> detailed roadmap of the scsh/scheme48 implementation. The scheme48,
> prescheme, and module papers are tantilizing (especially prescheme),
> but they lack detail. It seems like scrutinizing the source code is
> the only way to really understand these systems (no easy
> task).</lament>

No one has the time because no one is willing to pay for it.
I was unable to get either a Pre-Scheme or module paper accepted
anywhere, despite multiple rewrites and submissions.  A paper on
the optimistic concurrency stuff in Scheme 48 just received its
second rejection.  That relegates it to a hobby, and I don't enjoy
writing papers that much.
                                     -Richard Kelsey

Up