SNOBOL4(1)

πŸ“¦
version 2.3.1 Β· 3 versions
, in fedora 43, fedora 44, opensuse-leap 16.0

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 -LIST or the -l command line option) is LEFT. Listings are directed to standard error (or file specified by the -l command 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() and INPUT() functions is interpreted as a string of I/O options, The 4th argument is used to specify a file name, see snobol4io(1) for details.
  • PUNCH variable β€” The PUNCH output variable no longer exists, the TERMINAL variable has been added in its place, see snobol4io(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 β€” &STLIMIT defaults to -1, see snobol4key(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:

  1. The current working directory (β€œ.”).
  2. Any directories specified on the command line using -I options, 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/lib
  • base/version/local
  • base/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 β€” SNOLIB is used to establish the base libary path if SNOPATH is not defined. See Directory Search List above. SNOLIB was 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. Using SNOBOL_PRELOAD_PATH will make your code less portable.
bestie, maybe don't if you want portability. just saying. πŸ™ˆ

✨ SEE ALSO ✨

✨ 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