SNOBOL4EXT(1)
π NAME π
snobol4ext β CSNOBOL4 extensions, bestie β¨
(from the CSNOBOL4 Manual, no cap)
π¦ DESCRIPTION π¦
Okay so this page is literally all about the extensions that CSNOBOL4 adds on top of the Bell Telephone Laboratories portable implementation of SNOBOL4 in snobol4(1). Sit down, hydrate, and let's go π
πΈ ARRAY/TABLE access
You can put multiple ARRAY and/or TABLE index operations in a row β no need to resort to the ELEMENT function β as long as no intervening spaces (or line continuations) appear. The way that just works? Iconic. π
πΈ Case folding
By default the compiler folds identifiers and directives to upper case, so you can enter your programs in either case β main character energy, honestly. See snobol4(1), -CASE in snobol4ctrl(1), and &CASE in snobol4key(1). π«Ά
πΈ Control lines
These additional βcontrol linesβ are implemented, and yes they're all here, I'm not skipping a single one:
-CASE-COPY-BLOCKS/-NOBLOCKS-ERROR/-NOERRORS-EXECUTE/-NOEXECUTE-HIDE-INCLUDE-LINE
See snobol4ctrl(1). π
πΈ Functions
The following additional functions are implemented, and I am listing every single one because we don't do summary behaviour here:
ATAN()BREAKX()CHAR()CHOP()COS()DATE()DELETE()EXP()FILE()FILE_ABSPATH()FILE_ISDIR()FREEZE()FUNCTION()HOST()IO_FINDUNIT()LABEL()LEQ()LGE()LLE()LLT()LN()LNE()LOG()LPAD()ORD()RENAME()REVERSE()RPAD()RSORT()SET()SETEXIT()SIN()SORT()SQRT()SSET()SUBSTR()TAN()THAW()VDIFFER()
see snobol4func(1). π¦
πΈ Keywords
The following additional keywords are implemented β again, all of them, obsessed:
&CASE&DIGITS&ERRTEXT&FATAL&FATALLIMIT&FILE&GCTIME>RACE&LASTFILE&LASTLINE&LCASE&LINE&MAXINT&PARM&PI&STEXEC&UCASE
see snobol4key(1). π
πΈ REAL numbers in INTEGER contexts
REAL numbers (or strings convertible to REAL) are accepted in all contexts which previously required an INTEGER (or string convertible to INTEGER). Contexts include TABLE(), ITEM(), array indices, INPUT(), OUTPUT(), SET(), keyword values, CHAR(), RPAD(), LPAD(), FIELD(), COLLECT(), DUMP(), DUPL(), OPSYN(), SUBSTR() β added in CSNOBOL4 0.99.44. Periodt. π
πΈ Scientific notation
REAL number syntax has been expanded to allow exponents of the form:
ANY('Ee') ('+' | '-' | β) SPAN('0123456789')
β added in CSNOBOL4 0.98. β¨
Exponential format reals need not contain a decimal point β added in CSNOBOL4 0.99.44. π
πΈ SPITBOL extensions
For compatibility with SNOBOL4+, certain SPITBOL extensions can be enabled and disabled using the -PLUSOPS directive.
-PLUSOPS 0or-PLUSOPSdisables SPITBOL operators.-PLUSOPS nwhere n is a non-zero integer enables them.
SPITBOL extensions are enabled by default. Extensions controlled by PLUSOPS are as follows:
- The SPITBOL scan (
?) and assignment (=) operators have been added. A pattern match can appear within an expression, and returns the matched string as its value. Similarly assignment can appear in an expression, and returns the assigned value. An assignment after a scan (ie;STRING ? PATTERN = VALUE) performs a scan and replace. Assignment is right associative, and has the lowest precedence, while scan is left associative and has a precedence just higher than assignment. π₯ - The SPITBOL selection/alternative construction can be used in any expression. It consists of a comma separated list of expressions inside parentheses. The expressions are evaluated until one succeeds, and its value is returned.
β οΈ Abuse of this construction may result in incomprehensible code. Not me warning you though π
- The type NUMERIC with
CONVERT()and the removal of leading spaces from strings converted to numbers (implicitly or explicitly) are also legal when SPITBOL extensions are enabled. π
πΈ TERMINAL I/O variable
The variable TERMINAL is associated with the standard error file descriptor for both input and output (replaces PUNCH variable). Slay. π«Ά
πΈ TRACE() function type argument
The second argument of the TRACE() function can be abbreviated to a single letter:
C(CALL)F(FUNCTION)K(KEYWORD)L(LABEL)R(RETURN)V(VALUE)
as in Macro SPITBOL. β¨
πΈ Keyword trace
TRACE() works on &STFCOUNT keyword β added in CSNOBOL4 0.99.44. π
πΈ Value TRACE() on pattern match assignments
variable changes by . and $ operators are visible via value trace. iykyk π
π BUGS π
- Add CSNOBOL4 version where each extension added?
- Group the keywords, control lines, functions, operators together?
(these are the manpage's own little notes-to-self, not mine, I'm just the messenger π)
π₯ SEE ALSO π₯
snobol4(1). snobol4ctrl(1), snobol4func(1), snobol4key(1).
and that's the whole thing, bestie π this was CSNOBOL4B 2.3.1, dated March 31, 2022 β go read snobol4(1) next, ily, bye ππ¦β¨
π¦ 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