This directory contains a simple example of creating a module in
RScheme.  All you need to do is cd to this directory and run

  rsc -p sample.mcf

to create the module in byte compiled format, and

  rsc -p -ccode sample.mcf

to generate C code instead.

The .mcf definition is set up to generate all it's files in the
"sample" subdirectory.  That makes it easier to clean up, but note
that at the moment, the subdirectory *must* have the same name as the
module because that determines the name for any .so library.  This is
a bug in the current version of RScheme.

If you generate C code, you can build the necessary shared library
with

  (cd sample && make)

To use the module, you must first either put the resulting .mif, .mx,
.so, .doc, in ~/lib/rs/modules or set RS_MODULE_PATH to include
whatever directory you do put the files in.

Then from the command line:

  RS_MODULE_PATH=/some/dir rs +sample

and you're in business.  Alternately, you can load the module with the
command ",(use sample)" from an RScheme prompt rather than with the
"+sample" command line argument.

Here's an example of what you can expect to see:

$ rsc -p -ccode sample.mcf
processing: sample.mcf
using module primops
using module *scheme*
using module low-scheme
using module objsys
using module iolib
using module mathlib
using module tables
using module high-scheme
using module paths
using module mlink
using module start
using module corelib
Participating scheme file: sample
building C support files...
saving mif: sample/sample.mif
saving documentation...

$ (cd sample && make)
gcc -g -O2 -O2 -DNDEBUG -DINLINES -DGC_MACROS -Wall -Wno-unused  -I. -I- -I/usr/lib/rscheme/include -fPIC   -c sample_l.c -o sample_l.o
gcc -g -O2 -O2 -DNDEBUG -DINLINES -DGC_MACROS -Wall -Wno-unused  -I. -I- -I/usr/lib/rscheme/include -fPIC   -c sample1.c -o sample1.o
ld -shared sample_l.o sample1.o -o librssample.so

$ RS_MODULE_PATH=`pwd`/sample rs +sample
RScheme (v0.7.2, 97.12.21)
Copyright (C) 1995-1997 Donovan Kolbly <d.kolbly@rscheme.org>
RScheme comes with ABSOLUTELY NO WARRANTY.
type ",warranty" for details; type ",help" for some help
loading C unit sample: /home/debian/devel/rscheme/0.7.2/rs-0.7.2/debian/module-example/sample/librssample.so
top[0]=>(define my-point (make <point> x: 10.0 y: 20.0))
value := my-point
top[1]=>

