SNOBOL4(1)
SNOBOL4(1) π CSNOBOL4 Manual π
okay so bestie, welcome to the SNOBOL4(1) manual page from the CSNOBOL4 Manual. this is the whole thing, no cap. let's get into it. β¨
β¨ NAME β¨
snobol4 β SNOBOL4 interpreter π
β¨ DESCRIPTION β¨
This manual page describes CSNOBOL4, a port of the original Bell Telephone Labs (BTL) Macro Implementation of SNOBOL4 to the C language. it's giving "we took the OG and made it C". π
The language and its implementation are described in [Griswold1971] and [Griswold1972].
For command line options see snobol4cmd(1).
Extensions from Catspaw SNOBOL4+, SPITBOL and SITBOL have been added, see snobol4ext(1).
Includes BLOCKS (SNOBOL4B) extensions, see snobol4blocks(1).
β¨ Changes β¨
The following behaviors have been changed from the original Macro SNOBOL4 in ways that might affect old programs:
- INTEGER errors β INTEGER overflow does not cause expression failure. so like, it just keeps going? iconic. π
- Listings are disabled by default β Default listing side (when enabled by
-LISTor the-lcommand line option) isLEFT. Listings are directed to standard error (or file specified by the-lcommand line option). lowkey a whole vibe. - Messages β The startup banner and statistics (if enabled) are directed to standard error. Compilation error messages (including erroneous lines) appear on standard error. Error messages reference the source file name and line number. ngl that's helpful.
- Character set β see below. π
- INPUT() and OUTPUT() β FORTRAN formats are not used to control I/O. The 3rd argument to the
OUTPUT()andINPUT()functions is interpreted as a string of I/O options, The 4th argument is used to specify a file name, seesnobol4io(1)for details. - PUNCH variable β The
PUNCHoutput variable no longer exists, theTERMINALvariable has been added in its place, seesnobol4io(1). rip PUNCH, you will be missed. π«‘ - Statement separator β Control lines and comment characters are valid after the (
;) statement separator. Listing statement numbers show the statement number of the LAST statement on the line (rather than the first). periodt. &STLIMITβ&STLIMITdefaults to-1, seesnobol4key(1).- Tracing β VALUE tracing applies to variables modified by immediate value assignment (
$operator) and value assignment (.operator) during pattern matching.
β¨ Extensions β¨
Further additions are documented in snobol4ext(1).
β¨ Character set β¨
snobol4(1) is 8-bit clean, and uses the native character set. Any 8-bit byte is accepted as a SNOBOL datum or in a string constant of a SNOBOL source program. The value of the SNOBOL protected keyword &ALPHABET is a 256-character string of all bytes from 0 to 255, in ascending order. that's a lot of bytes, bestie. π
On ASCII-based systems, any character with the 8th bit set is treated as βalphabeticβ, and can start, or be used in identifiers and labels. This includes characters from the βupper halfβ of national character sets and all bytes resulting from the UTF-8 encoding of Unicode characters. Include file utf.sno implements pattern matching functions for UTF-8 sequences.
Programs may be entered in mixed case; By default lower case identifiers are folded to upper case (see &CASE and -CASE). Case folding is performed by using the C library islower(3) test, and then using toupper(3) to convert the lower-case characters to upper case. When using UTF-8 encoded characters in code, case folding should be disabled, to prevent any bytes which appear to be lower case in the current locale from being modified.
so like, if you're doing UTF-8, turn that off. fr fr. π
The following operator character sequences are permitted and represent a cross between PDP-10 Macro SNOBOL, SITBOL and Catspaw SPITBOL usage:
Assignment: = _
Comment line: * # | ; !
Continuation line: + .
Both square brackets ([]) and angle brackets (<>) may be used to subscript arrays and tables. The TAB (ASCII 9) character is accepted as whitespace.
Underscore (_) and period (.) are legal within identifiers and labels.
Note that the use of the pound sign for comments allows use of the script interpreter (hash-bang) sequence at the top of a file marked as executable: β#!/usr/local/bin/snobol4β or β#!/usr/bin/env snobol4β
See snobol4op(1) for operators.
β¨ DIRECTORY SEARCH LIST β¨
A directory search list is used for files specified in -INCLUDE directives and LOAD() function calls, and is constructed from:
- The current working directory (β
.β). - Any directories specified on the command line using
-Ioptions, in the order specified.
3a. Directories from the SNOPATH environment variable (see below), if defined.
3b. If SNOPATH is not defined, the SNOLIB environment variable (or a compiled in default) is used as base to add the following directories:
base/version/libbase/version/localbase/local
The LOAD() function will also check for the file in shared subdirectory in each directory in the search path.
β¨ ENVIRONMENT β¨
SNOBOL4UNBUFFEREDβ If set to a non-null value, all stdio output will be unbuffered, and will be written immediately. so like, no waiting. πSNOPATHβ Is a list of directories delimited by colons (semi-colons on VMS and Windows) appended to the Directory Search List (see above).SNOLIBβSNOLIBis used to establish the base libary path ifSNOPATHis not defined. See Directory Search List above.SNOLIBwas the sole search directory in versions of CSNOBOL4 prior to version 1.5.SNOBOL_PRELOAD_PATHβ Is a list of source files delimited by colons (semi-colons on VMS and Windows) that will be read before the program source. UsingSNOBOL_PRELOAD_PATHwill make your code less portable.
bestie, maybe don't if you want portability. just saying. π
β¨ SEE ALSO β¨
sdb(1)β SNOBOL4 Debuggersnobol4cmd(1)β command line optionssnobol4ctrl(1)β control linessnobol4error(1)β&ERRTYPEand&ERRTEXTvaluessnobol4ext(1)β extensions to BTL SNOBOL4snobol4func(1)β built-in function listsnobol4io(1)β input/outputsnobol4key(1)β keywordssnobol4op(1)β operatorssnobol4blocks(1)β SNOBOL4B BLOCKS extensionsnopea(1)β convert snopea documentation to roff and HTMLsnobol4dirs(3)β directory access functionssnobol4ezio(3)β easy to use file I/Osnobol4ffi(3)β Foreign Function Interface functionssnobol4fork(3)β subprocess interface functionssnobol4host(3)β HOST and O/S functionssnobol4logic(3)β bit logic & formatting functionssnobol4load(3)β loading extension modules into SNOBOL4snobol4ndbm(3)β keyed file access functionssnobol4random(3)β pseudo-random numbers functionssnobol4readline(3)β input with line editingsnobol4setup(3)β loadable module buildersnobol4sprintf(3)β formatting functionsnobol4sqlite3(3)β SQLite database interface functionssnobol4sqlite3dbm(3)β DBM interface using SQLitesnobol4stat(3)β file metadata functionssnobol4stcl(3)β Tcl/Tk interface functionssnobol4time(3)β date/time functionssnolib(3)β misc library functionssnopea(7)β A little βPlain Old Documentationβ format for SNOBOL4http://www.regressive.org/snobol4β All things SNOBOL4 related.http://www.snobol4.comβ Catspaw: commercial SPITBOL implementations, Free SNOBOL4+ for DOS.http://www.regressive.org/snobol4/doc/burks/tutorial/contents.htmβ SNOBOL4 language tutorial (from Catspaw Vanilla SNOBOL4)[Griswold1971]β R. E. Griswold, J. F. Poage, and I. P. Polonsky, The SNOBOL4 Programming Language, 2nd ed., Prentice-Hall Inc., 1971. (aka the βgreen bookβ)http://www.regressive.org/snobol4/docs/books.html#green[Griswold1972]β R. E. Griswold, The Macro Implementation of SNOBOL4, W. H. Freeman and Co., 1972. Book describing the implementation techniques used in Macro SNOBOL4.http://www.regressive.org/snobol4/docs/books.html#macrohttp://www.regressive.org/snobol4/doc/burks/manual/contents.htmβ Catspaw Vanilla SNOBOL4 manual.ftp://ftp.snobol4.com/spitman.pdfβ Catspaw Macro SPITBOL manualhttp://www.regressive.org/snobol4/docs/books.html#orangeβ Algorithms in SNOBOL4, James F. Gimpel, Wiley, New York, 1976.
β¨ AUTHORS β¨
- Ralph E. Griswold, James F. Poage, Ivan P. Polonsky, et al (Macro SNOBOL4)
- Philip. L. Budne (CSNOBOL4)
- Mark Emmer (code from SNOBOL4+)
- Viktors Berstis (code from Minnesota SNOBOL4)
- James F. Gimpel (SNOBOL4B)
β¨ BUGS β¨
- I/O is still tied to unit numbers.
- I/O retains some record oriented flavor (maximum line length on input).
- βDynamicβ storage cannot be expanded after startup.
- Integer math can never fail, even on overflow.
- Oversize integer constants may not be detected.
okay so that's the whole manual, bestie. hope you slayed. π β¨
and that's a wrap! this page is from CSNOBOL4B 2.3.1, dated March 31, 2022. so iconic. πππ¦
π¦ where this page comes from
- fedora 43: snobol4 2.3.1-7.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- fedora 43: snobol4 2.3.1-7.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- fedora 44: snobol4 2.3.1-8.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- fedora 44: snobol4 2.3.1-8.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms