SCM(1)
β¨ SCM(1) β a Scheme Language Interpreter β¨
okay bestie, welcome to the SCM(1) page from the General Commands Manual, and no, we are not skipping anything, we are reading the whole thing together π
π¦ NAME π¦
scm β a Scheme Language Interpreter
πΈ SYNOPSIS πΈ
scm [-a kbytes ] [-muvqib] [--version] [--help]
[[-]-no-init-file] [--no-symbol-case-fold]
[-p int ] [-r feature ] [-h feature ]
[-d filename ] [-f filename ] [-l filename ]
[-c expression ] [-e expression ] [-o dumpname ]
[-- | - | -s] [ filename ] [ arguments ... ]
π DESCRIPTION π
Scm is a Scheme interpreter. That's the whole vibe. It interprets Scheme. Iconic behavior, honestly.
When it starts up, scm loads the file that's specified by the environment variable SCM_INIT_PATH, or by the parameter IMPLINIT in the makefile (or scmfig.h) if SCM_INIT_PATH isn't defined. The makefiles try their hardest to set IMPLINIT to "Init.scm" in the source directory. π«Ά
Unless the option -no-init-file or --no-init-file shows up in the command line, or unless scm is being invoked as a script, "Init.scm" checks to see if there's a 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, then it gets loaded. so nosy, love that for it π
Then "Init.scm" 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. three whole sources. main character energy fr fr.
β¨ OPTIONS β¨
The options are processed in the order specified on the command line.</purl> (okay that's just how it works, no skipping around bestie)
-akbytesβ specifies thatscmshould allocate an initial heapsize ofkbytes. This option, if present, must be the first on the command line. like, FIRST first. no cutting the line. π--no-init-fileβ Inhibits the loading of"ScmInit.scm"as described above.--no-symbol-case-foldβ Symbol (and identifier) names are case-sensitive.-eexpression-cexpressionβ specifies that the scheme expression expression is to be evaluated. These options are inspired byperlandshrespectively. On Amiga systems the entire option and argument need to be enclosed in quotes. For instance"-e(newline)".-rfeatureβ requires feature. This will load a file from SLIB if that feature is not already supported. If feature is2,3,4, or5scmwill require the features necessary to support R2RS, R3RS, R4RS, or R5RS, respectively.-hfeatureβ provides feature.-lfilename-ffilenameβ loads filename. Scm will load the first (unoptioned) file named on the command line if no-c,-e,-f,-l, or-soption precedes it.-dfilenameβ opens (read-only) the extended relational database filename. If filename contains initialization code, it will be run when the database is opened.-odumpnameβ saves the current SCM session as the executable program dumpname. This option works only in SCM builds supporting dump.
If options appear on the command line after -o dumpname, then the saved session will continue with processing those options when it is invoked. Otherwise the (new) command line is processed as usual when the saved image is invoked.
-plevelβ sets the prolixity (verboseness) to level. This is the same as thescmcommand(verbose level ).-vβ (verbose mode) specifies thatscmwill print prompts, evaluation times, notice of loading files, and garbage collection statistics. This is the same as-p3.-qβ (quiet mode) specifies thatscmwill print no extra information. This is the same as-p0.-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-r macropackagebefore-mon the command line.-uβ specifies that subsequent loads, evaluations, and user interactions will be without R4RS macro capability. R4RS macro capability can be restored by a subsequent-mon the command line or from Scheme code.-iβ specifies thatscmshould run interactively. That means thatscmwill not terminate until the(quit)or(exit)command is given, even if there are errors. It also sets the prolixity level to2if it is less than2. This will print prompts, evaluation times, and notice of loading files. The prolixity level can be set by subsequent options. Ifscmis started from a tty, it will assume that it should be interactive unless given a subsequent-boption.-bβ specifies thatscmshould run non-interactively. That means thatscmwill terminate after processing the command line or if there are errors.-sβ specifies, by analogy withsh, that further options are to be treated as program arguments.---β specifies that there are no more options on the command line.
π ENVIRONMENT VARIABLES π
SCM_INIT_PATHβ is the pathname wherescmwill look for its initialization code. The default is the file"Init.scm"in the source directory.SCHEME_LIBRARY_PATHβ is the SLIB Scheme library directory.HOMEβ is the directory where"Init.scm"will look for the user initialization file"ScmInit.scm".
π§ SCHEME VARIABLES π§
*argv*β contains the list of arguments to the program.*argv*can change during argument processing. This list is suitable for use as an argument to SLIBgetopt.*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-mand-uoptions.*interactive*β controls interactivity as explained for the-iand-boptions. Define this in"ScmInit.scm"or files specified on the command line. This can be overridden by subsequent-iand-boptions.
π EXAMPLES π
% scm foo.scm arg1 arg2 arg3
Load and execute the contents of foo.scm. Parameters arg1 arg2 and arg3 are stored in the global list *argv*.
% scm -f foo.scm arg1 arg2 arg3
The same.
% scm -s foo.scm arg1 arg2
Set *argv* to ("foo.scm" "arg1" "arg2") and enter interactive session.
% scm -e '(display (list-ref *argv* *optind*))' bar
Print ``bar''
% scm -rpretty-print -r format -i
Load pretty-print and format and enter interactive mode.
% scm -r5
Load dynamic-wind, values, and R4RS macros and enter interactive (with macros) mode.
% scm -r5 -r4
Like above but rev4-optional-procedures are also loaded.
π FEATURES π
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.
Conforms to Revised^5 Report on the Algorithmic Language Scheme and the IEEE P1178 specification.
Support for SICP, R2RS, R3RS, and R4RS scheme code.
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.
Char-code-limit, most-positive-fixnum, most-negative-fixnum, and internal-time-units-per-second constants. *Features* and *load-pathname* variables.
Arrays and bit-vectors. String ports and software emulation ports. I/O extensions providing most of ANSI C and POSIX.1 facilities.
User definable responses to interrupts and errors, Process-synchronization primitives, String regular expression matching, and the CURSES screen management package.
Available add-on packages including an interactive debugger, database, X-window graphics, BGI graphics, Motif, and Open-Windows packages.
A compiler (HOBBIT, available separately) and dynamic linking of compiled modules.
Setable levels of monitoring and timing information printed interactively (the verbose function). Restart, quit, and exec.
π FILES π
scm.texiβ Texinfo documentation ofscmenhancements, internal representations, and how to extend or includescmin other programs.
π«Ά AUTHORS π«Ά
- Aubrey Jaffer (
agj@alum.mit.edu) - Radey Shouman
π BUGS π
(no bugs listed, bestie. the section is literally empty. slay, I guess π)
β SEE ALSO β
The SCM home-page: http://people.csail.mit.edu/jaffer/SCM.html
The Scheme specifications for details on specific procedures (http://groups.csail.mit.edu/mac/ftpdir/scheme-reports) or
IEEE Std 1178-1990, IEEE Standard for the Scheme Programming Language, Institute of Electrical and Electronic Engineers, Inc., New York, NY, 1991
Brian Harvey and Matthew Wright Simply Scheme: Introducing Computer Science_ MIT Press, 1994 ISBN 0-262-08226-8
R. Kent Dybvig, The Scheme Programming Language, Prentice-Hall Inc, Englewood Cliffs, New Jersey 07632, USA
H. Abelson, G. J. Sussman, and J. Sussman, Structure and Interpretation of Computer Programs, The MIT Press, Cambridge, Massachusetts, USA
and that's a wrap π this beauty came from the 4th Berkeley Distribution, dated February 2008 β SCM(1), forever iconic, periodt π
β¨
π¦ where this page comes from
- debian bookworm: scm 5f3-4 Β· LGPL-3.0-or-later
- debian trixie: scm 5f4-3 Β· LGPL-3.0-or-later
- ubuntu jammy: scm 5f3-1 Β· LGPL-3.0-or-later
- ubuntu questing: scm 5f4-3
- ubuntu resolute: scm 5f4-3.1 Β· LGPL-3.0-or-later
- ubuntu stonking: scm 5f4-3.1 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms