diff options
Diffstat (limited to 'scm.1')
-rw-r--r-- | scm.1 | 335 |
1 files changed, 335 insertions, 0 deletions
@@ -0,0 +1,335 @@ +.\" dummy line +.TH SCM "Jan 9 1995" +.UC 4 +.SH NAME +scm \- a Scheme Language Interpreter +.SH SYNOPSIS +.B scm +[-a +.I kbytes +] +[-ibvqmu] +[-p +.I number +] +[-c +.I expression +] +[-e +.I expression +] +[-f +.I filename +] +[-l +.I filename +] +[-d +.I filename +] +[-r +.I feature +] +[-- | - | -s] +[filename] [arguments ...] +.br +.sp 0.3 +.SH DESCRIPTION +.I Scm +is a Scheme interpreter. +.PP +Upon startup +.I scm +loads the file specified by by the environment variable SCM_INIT_PATH +or by the parameter IMPLINIT in the makefile (or scmfig.h) if +SCM_INIT_PATH is not defined. The makefiles attempt to set IMPLINIT +to "Init.scm" in the source directory. + +Unless the option +.I -no-init-file +occurs in the command line, "Init.scm" checks to see if there is file +"ScmInit.scm" in the path specified by the environment variable HOME +(or in the current directory if HOME is undefined). If it finds such +a file it is loaded. + +"Init.scm" then looks for command input from one of three sources: +From an option on the command line, from a file named on the command +line, or from standard input. + +.SH OPTIONS +The options are processed in the order specified on the command line. +.TP 5 +.BI -a kbytes +specifies that +.I scm +should allocate an initial heapsize of +.I kbytes. +This option, if present, must be the first on the command line. +.TP +.BI -no-init-file +Inhibits the loading of "ScmInit.scm" as described above. +.TP +.BI -e expression +.TP +.BI -c expression +specifies that the scheme expression +.I expression +is to be evaluated. These options are inspired by +.I perl +and +.I sh +respectively. +On Amiga systems the entire option and argument need to be enclosed in +qoutes. For instance "-e(newline)". +.TP +.BI -r feature +requires +.I feature. +This will load a file from SLIB if that +.I feature +is not already supported. If +.I feature +is 2, 3, 4, or 5 +.I scm +will require the features neccessary to support R2RS, R3RS, R4RS, or +proposed R5RS, respectively. +.TP +.BI -l filename +.TP +.BI -f filename +loads +.I filename. +.I Scm +will load the first (unoptioned) file named on the command line if no +-c, -e, -f, -l, or -s option preceeds it. +.TP +.BI -d filename +opens (read-only) the extended relational database +.I filename. +If +.I filename +contains initialization code, it will be run when the database is +opened. +.TP +.BI -p level +sets the prolixity (verboseness) to +.I level. +This is the same as the +.I scm +command (verobse +.I level +). +.TP +.B -v +(verbose mode) specifies that +.I scm +will print prompts, evaluation times, notice of loading files, and +garbage collection statistics. This is the same as +.I -p3. +.TP +.B -q +(quiet mode) specifies that +.I scm +will print no extra information. This is the same as +.I -p0. +.TP +.B -m +specifies that subsequent loads, evaluations, and user interactions +will be with R4RS macro capability. To use a specific R4RS macro +implementation from SLIB (instead of SLIB's default) put +.I -r macropackage +before +.I -m +on the command line. +.TP +.B -u +specifies that subsequent loads, evaluations, and user interactions +will be without R4RS macro capability. R4RS macro capability can be +restored by a subsequent +.I -m +on the command line or from Scheme code. +.TP +.B -i +specifies that +.I scm +should run interactively. That means that +.I scm +will not terminate until the +.I (quit) +or +.I (exit) +command is given, even if there are errors. It also sets the +prolixity level to 2 if it is less than 2. This will print +prompts, evaluation times, and notice of loading files. The prolixity +level can be set by subsequent options. If +.I scm +is started from a tty, it will assume that it should be interactive +unless given a subsequent +.I -b +option. +.TP +.B -b +specifies that +.I scm +should run non-interactively. That means that +.I scm +will terminate after processing the command line or if there are +errors. +.TP +.B -s +specifies, by analogy with +.I sh, +that further options are to be treated as program aguments. +.TP +.BI - +.BI -- +specifies that there are no more options on the command line. +.SH ENVIRONMENT VARIABLES +.TP 5 +.B SCM_INIT_PATH +is the pathname where +.I scm +will look for its initialization code. The default is the file +"Init.scm" in the source directory. +.TP +.B SCHEME_LIBRARY_PATH +is the SLIB Scheme library directory. +.TP +.B HOME +is the directory where "Init.scm" will look for the user +initialization file "ScmInit.scm". +.SH SCHEME VARIABLES +.TP 5 +.B *argv* +contains the list of arguments to the program. +.I *argv* +can change during argument processing. This list is +suitable for use as an argument to SLIB +.I getopt. +.TP +.B *R4RS-macro* +controls whether loading and interaction support R4RS macros. Define +this in "ScmInit.scm" or files specified on the command line. This +can be overridden by subsequent -m and -u options. +.TP +.B *interactive* +controls interactivity as explained for the -i and -b options. Define +this in "ScmInit.scm" or files specified on the command line. This +can be overridden by subsequent -i and -b options. +.SH EXAMPLES +.ne 5 +.TP 5 +% scm foo.scm arg1 arg2 arg3 +.br +Load and execute the contents of foo.scm. Parameters +arg1 arg2 and arg3 are stored in the global list *argv*. +.TP +% scm -f foo.scm arg1 arg2 arg3 +.br +The same. +.TP +% scm -s foo.scm arg1 arg2 +.br +Set *argv* to ("foo.scm" "arg1" "arg2") and enter interactive session. +.TP +% scm -e '(display (list-ref *argv* *optind*))' bar +.br +Print ``bar'' +.TP +% scm -rpretty-print -r format -i +.br +Load pretty-print and format and enter interactive mode. +.TP +% scm -r5 +.br +Load dynamic-wind, values, and R4RS macros and enter interactive (with +macros) mode. +.TP +% scm -r5 -r4 +.br +Like above but rev4-optional-procedures are also loaded. +.SH FEATURES +.PP +Runs under Amiga, Atari-ST, MacOS, MS-DOS, OS/2, NOS/VE, Unicos, VMS, +Unix and similar systems. Support for ASCII and EBCDIC character +sets. +.PP +Conforms to Revised^4 Report on the Algorithmic Language Scheme +and the IEEE P1178 specification. +.PP +Support for SICP, R2RS, R3RS, and (proposed) R5RS scheme code. +.PP +Many Common Lisp functions: +logand, logor, logxor, lognot, ash, logcount, integer-length, +bit-extract, defmacro, macroexpand, macroexpand1, gentemp, +defvar, force-output, software-type, get-decoded-time, +get-internal-run-time, get-internal-real-time, delete-file, +rename-file, copy-tree, acons, and eval. +.PP +Char-code-limit, most-positive-fixnum, most-negative-fixnum, +and internal-time-units-per-second constants. *Features* and +*load-pathname* variables. +.PP +Arrays and bit-vectors. String ports and software emulation ports. +I/O extensions providing most of ANSI C and POSIX.1 facilities. +.PP +User definable responses to interrupts and errors, +Process-syncronization primitives, String regular expression matching, +and the CURSES screen management package. +.PP +Available add-on packages including an interactive debugger, database, +X-window graphics, BGI graphics, Motif, and Open-Windows packages. +.PP +A compiler (HOBBIT, available separately) and dynamic linking of +compiled modules. +.PP +Setable levels of monitoring and timing information printed +interactively (the `verbose' function). Restart, quit, and exec. +.SH FILES +.TP +code.doc +.br +Documentation on the internal representation and how to extend or +include scm in other programs. +.TP +scm.texi +.br +Documentation of SCM in Texinfo format. +.SH AUTHOR +Aubrey Jaffer +.br +(jaffer@ai.mit.edu) +.SH BUGS +.SH SEE ALSO +The Scheme specifications for details on specific procedures +(ftp-swiss.ai.mit.edu:archive/scheme-reports/) or +.PP +IEEE Std 1178-1990, +.br +IEEE Standard for the Scheme Programming Language, +.br +Institute of Electrical and Electronic Engineers, Inc., +.br +New York, NY, 1991 +.PP +Brian Harvey and Matthew Wright +.br +Simply Scheme: Introducing Computer Science_ +.br +MIT Press, 1994 +ISBN 0-262-08226-8 +.PP +R. Kent Dybvig, The Scheme Programming Language, +.br +Prentice-Hall Inc, Englewood Cliffs, New Jersey 07632, USA +.PP +H. Abelson, G. J. Sussman, and J. Sussman, +.br +Structure and Interpretation of Computer Programs, +.br +The MIT Press, Cambridge, Massachusetts, USA +.PP +Enhancements in +.I scm +not in the standards are detailed in MANUAL in the source directory. + |