
sci  scheme interpreter

scc [ option ] ... file ...
     The scc command invokes a Scheme compiler which accepts  the
     language  defined  in  the  essential  portions  of Revised3
     Report on the Algorithmic Language Scheme, with  minor  con-
     straints and some additions.  The compiler produces C source
     files which are then compiled using the system's C  compiler
     to produce conventional .o and a.out files.  The C code pro-
     duced by this compiler may be intermixed with other  C  code
     or code written in other languages.
 
     -o output-file-name
     -i combines file with sci to give new command which loads sci with
        the new compiled function installed




To make a compiled scheme function
----------------------------------
> less file.sc
(module blah)
(define (function ...)
  body)

> scc -i -o file+sci file.sc
> file+sci
scheme>(function ...)

To make a compiled unix function
--------------------------------
> less file.sc
(module blah (main function))
(top-level symbol)             ; these symbols will be true top level
                               ; instead of being named module-symbol
(define (function clargs)       ;clargs are passed from unix call
  body)

> scc -o file file.sc
>file args

To make a compiled unix function which uses C code
--------------------------------------------------
> less file.sc
(module blah (main main-function))
(define-c-external (c_function args_types)  ;name given in C code
                   return_type 
                   "sc-function")           ;name to be used here

(define (main-function clargs)              ;clargs is the list of items
   (sc-function args)                       ;in the unix call
   rest-of-body                             ;args must be converted to c types
)

>less file.c
#include <need_this>                        ;normal C code
c_function(args_types)
{
       body
}

>scc -o command_name file.sc file.c     ;name all files
                                        ;be carefull - intermediate files
                                        ;command_name.c and .o  will be made
Special Scheme->c functions
---------------------------
(define-c-external (function args) return "name")  ;to use c-lib functions
 eg. (define-c-external (time pointer) int "time")

(define-in-line (symbol .formals body)             ;to be compiled on line

(define-system-file-task )                         ; may be useful

(fixed->float )
(float->fixed )

(include "file")

Some Scheme functions
------------------------

(display thing)        ;send to output
(loade "filename")     ;will echo text read to standard output file
(trace function)       ;will set trace on this fn
(untrace function)
(untrace)
(bpt function)         ;set break point on entry and exit
(bpt function function); the second function will be called on entry and exit
(for-each procedure list list ...)
(list->string list)
