1SNOBOL4(1)                  General Commands Manual                 SNOBOL4(1)
2
3
4

NAME

6       snobol4 - SNOBOL4 interpreter
7

SYNOPSIS

9       snobol4 [ options ...  ] [ file(s) ...  ] [ params ...  ]
10
11

DESCRIPTION

13       This  manual  page describes a port of the original Bell Telephone Labs
14       (BTL) Macro Implementation of SNOBOL4 (MAINBOL) to machines with  ILP32
15       (32-bit  int/long/pointer) or LP64 (64-bit long/pointer) C compilers by
16       Philip L. Budne.  The language and it's implementation are described in
17       [1] and [2].  Extensions from Catspaw SNOBOL4+, SPITBOL and SITBOL have
18       been added.  This page discusses only the changes/extensions.
19
20
21   Limitations
22       All aspects of the language are implemented except;
23
24       ·      Trapping of arithmetic exceptions.
25
26       ·      LOAD() can be used to access external functions  on  most  plat‐
27              forms,  but  not all.  External functions can be staticly linked
28              (poor man's loading) into the snobol4 executable ALL  platforms.
29              See /usr/local/lib/snobol4/load.txt for more information.
30
31
32   Changes
33       The  following  behaviors  have  been  changed  from the original Macro
34       SNOBOL4;
35
36       ·      Listings are disabled by default.  Default  listing  side  (when
37              enabled by -LIST or the -l command option is LEFT.  Listings are
38              directed to standard output.
39
40       ·      Error messages, the startup banner and statistics  are  directed
41              to  standard error.  Compilation error messages (including erro‐
42              neous lines) appear on standard error as well as  in  the  list‐
43              ings.   Error  messages  now  reference the source file name and
44              line number.
45
46       ·      Character set (see below).
47
48       ·      The PUNCH output variable no longer exists (see  TERMINAL  vari‐
49              able below).
50
51       ·      I/O is not performed using FORTRAN I/O.  The 3rd argument to the
52              OUTPUT() and INPUT() functions are interpreted as  a  string  of
53              I/O options (see below).
54
55       ·      Control  lines and comment characters are valid after the end of
56              string (;) statement separator.  Listing statement numbers  show
57              the  statement  number of the LAST statement on the line (rather
58              than the first).
59
60       ·      Setting the &ABEND keyword causes a core dump upon termination!
61
62       ·      The value of the &CODE keyword determines the exit status of the
63              snobol4 application.
64
65       ·      The  DATE()  function  returns  strings  of the form: MM/DD/YYYY
66              HH:MM:SS.  See extensions section for arguments  to  the  DATE()
67              function.
68
69       ·      Keyword &STLIMIT now defaults to -1.  When &STLIMIT is less than
70              zero there is no limit to the number of statements executed, and
71              &STCOUNT is not incremented.
72
73       ·      VALUE  tracing  applies to variables modified by immediate value
74              assignment ($ operator) and value assignment (. operator) during
75              pattern matching.
76
77       ·      The BACKSPACE() function is not implemented. Use the SET() func‐
78              tion instead.
79
80       ·      I/O unit numbers up to 256 can be used.
81
82       ·      Attempts to output on a closed unit generates  a  fatal  “Output
83              error”
84
85
86   Character set
87       snobol4(1)  is  8-bit  clean,  and  uses the native character set.  Any
88       8-bit byte is accepted as a SNOBOL datum or in a string constant  of  a
89       SNOBOL  source  program.   The  value  of  the SNOBOL protected keyword
90       &ALPHABET is a 256-character string of all bytes  from  0  to  255,  in
91       ascending order.
92
93
94       On  ASCII  based systems, any character with the 8th bit set is treated
95       as "alphabetic", and can start, or be used in identifiers  and  labels.
96       This  includes  characters  from the "upper half" of national character
97       sets and all bytes resulting from the UTF-8 encoding of Unicode charac‐
98       ters.
99
100
101       Programs  may  be  entered in mixed case; By default lower case identi‐
102       fiers are folded to upper case (see &CASE and -CASE extensions  below).
103       Case  folding  is performed by using the C library islower(3) test, and
104       then using toupper(3) to convert the  lower-case  characters  to  upper
105       case.  When using UTF-8 encoded characters in code, case folding should
106       be disabled, to prevent any bytes which appear to be lower case in  the
107       current locale from being modified.
108
109
110       The  following operator character sequences are permitted and represent
111       a cross between PDP-10 Macro SNOBOL (a.k.a. DECBOL), SITBOL and Catspaw
112       SPITBOL usage;
113
114       Exponentiation:     ^ **
115       Alternation:        | !
116       Unary negation:     ~ \
117       Assignment:         = _
118       Comment line:       * # | ; !
119       Continuation line:  + .
120
121       Both  square  brackets ([]) and angle brackets (<>) may be used to sub‐
122       script arrays and tables.  The TAB (ASCII 9) character is  accepted  as
123       whitespace.   Note  that  the use of the pound sign for comments allows
124       use of the shell interpreter  sequence  at  the  top  of  a  file  (ie;
125       "#!/usr/local/bin/snobol4  -b").   Underscore  (_)  and  period (.) are
126       legal within identifiers and labels.
127
128
129   Extensions
130       ARRAY/TABLE access
131              Multiple ARRAY and/or TABLE index operations  may  appear  in  a
132              row, without having to resort to use of the ELEMENT function, so
133              long as no intervening spaces (or line continuations) appear.
134
135       BREAKX()
136              The BREAKX() function is a pattern function used for fast  scan‐
137              ning.   BREAKX(str)  is  equivalent  to  BREAK(str) ARBNO(LEN(1)
138              BREAK(str)).  In other words BREAKX matches a sequence  of  ever
139              larger strings terminated by a break set.  BREAKX can be used as
140              a faster matching  replacement  for  ARB;  BREAKX('S')  'STRING'
141              always  runs  faster  than  ARB  'STRING' since it only attempts
142              matching 'STRING' at locations where an 'S' has been detected.
143
144       Case folding
145              By default the compiler  folds  identifiers  and  directives  to
146              upper  case, so programs can be entered in either case.  To dis‐
147              able case folding use the directive -CASE 0 or  -CASE.   To  re-
148              enable  case folding use directive -CASE n where n is a non-zero
149              integer.  The status of case folding may be  examined  and  con‐
150              trolled from a running program by the unprotected system keyword
151              &CASE.
152
153       CHAR()
154              The CHAR() function takes an integer from 0 to 255  and  returns
155              the n'th character in &ALPHABET.
156
157       DATE() For  compatibility  with new versions of Catspaw SPITBOL DATE(0)
158              returns strings of  the  form  MM/DD/YY  HH:MM:SS,  and  DATE(2)
159              returns strings of the form YYYY-MM-YY HH:MM:SS.  With any other
160              arguments  DATE()  returns  strings  of  the   form   MM/DD/YYYY
161              HH:MM:SS.
162
163       -ERROR/-NOERRORS
164              Directives  -ERROR  and  -NOERRORS  control execution of program
165              with compiler errors.  If the -ERROR  directive  is  given,  the
166              program will be executed (but any attempt to execute a statement
167              with a compiler error will cause a fatal execution  error).   By
168              default  programs with compiler errors will not be started, this
169              can be restored using -NOERRORS.
170
171       &ERRTEXT
172              After an otherwise fatal error is curtailed due  to  a  non-zero
173              value  in &ERRLIMIT, the protected keyword &ERRTEXT will contain
174              the error message.
175
176       -EXECUTE/-NOEXECUTE
177              Directives -EXECUTE and -NOEXECUTE  control  execution  of  pro‐
178              grams.   If  the -NOEXECUTE directive is given, the program will
179              be not executed after compilation.  -EXECUTE Cancels any  previ‐
180              ous -NOEXECUTE.
181
182       FREEZE()/THAW()
183              The  FREEZE()  function prohibits creation of new entries in the
184              referenced table.  This is useful once a table has been initial‐
185              ized to avoid creating empty entries on lookups that fail.  This
186              can greatly improve program speed, since frozen tables will  not
187              become  clogged  with  empty entries.  Lookups for uninitialized
188              entries will return the null string.  Attempts to  assign  to  a
189              non-existent  entry  will  cause  a  “Variable not present where
190              required” error. The THAW() function restores normal entry  cre‐
191              ation behavior.
192
193       FUNCTION()
194              The  FUNCTION()  predicate  evaluates  it's argument as a string
195              (with case folding), and returns the null string if  a  function
196              with  that name exists and fails if it does not.  The FUNCTION()
197              predicate exists in SITBOL.
198
199       &GTRACE
200              If set to a non-zero value, each time a  garbage  collection  is
201              run,  a  trace  message is output indicating the source file and
202              line number of the current statement, how long the GC took,  and
203              how many units of storage are now free.
204
205       HOST()
206              A  limited  simulation of the SPITBOL HOST() function (with lib‐
207              eral implementation specific extensions) is included.
208
209              The -INCLUDE file host.sno contains symbolic defines  for  these
210              (and many other) function codes.
211
212              HOST() with no parameters returns a string describing the system
213              the program is running on.  The  string  contains  three  parts,
214              separated  by  colons.   The  first  part describes the physical
215              architecture, the second describes the operating system, and the
216              third  describes  the  language  implementation  name.  Example:
217              i386:Darwin 8.11.1:CSNOBOL4 1.2
218
219              HOST(0) returns a string containing the command  line  parameter
220              supplied  to  the -u option, if any.  If no -u option was given,
221              HOST(0) returns the concatenation of all user parameters follow‐
222              ing the input filename(s).
223
224              HOST(1,string)  passes  the  string  to  the system(3) c library
225              function, and returns the subprocess exit status.
226
227              HOST(2,n) for integer n returns the n'th command  line  argument
228              (regardless  of  whether  the  argument was the command name, an
229              option, a filename or a user parameter) as a string, or  failure
230              if n is out of range.
231
232              HOST(3)  returns  an integer for use with HOST(2) indicating the
233              first command line argument available as a user parameter.
234
235              HOST(4,string) returns the value  of  the  environment  variable
236              named string.
237
238       -INCLUDE
239              The  -INCLUDE  directive  causes the compiler to interpolate the
240              contents of the named file enclosed in single or double  quotes.
241              Any  filename will be included only once, this can be overridden
242              by appending a trailing space to the filename.  Trailing  spaces
243              are  removed  from  the filename before use.  If the file is not
244              found in the current working directory an attempt will  be  made
245              to  find it in the directory specified by the SNOLIB environment
246              variable, or if that is not set, a predetermined library  direc‐
247              tory.
248
249              -COPY  is  a  synonym  for -INCLUDE for compatibility with SPIT‐
250              BOL/370.
251
252       IO_FINDUNIT()
253              The IO_FINDUNIT() function returns an unused I/O unit number for
254              use  with  the  INPUT() or OUTPUT() functions.  IO_FINDUNIT() is
255              meant for use in subroutines which can be reused.  IO_FINDUNIT()
256              will never return a unit number below 20.
257
258       LABEL()
259              The  LABEL() predicate evaluates it's argument as a string (with
260              case folding), and returns the null string if a label with  that
261              name  has  been  defined, and fails if it does not.  The LABEL()
262              predicate was copied from SITBOL and  Steve  Duff's  version  of
263              Macro SPITBOL.
264
265       &GTRACE
266              keyword enables Garbage Collection tracing if non-zero.  If pos‐
267              itive, the value of &GTRACE will  be  decremented  after  it  is
268              tested.
269
270       &LINE/&FILE/&LASTLINE/&LASTFILE
271              The &LINE and &FILE keywords can be used to determine the source
272              file and file line associated with the current  statement.   The
273              &LASTLINE  and  &LASTFILE  return  the source file and file line
274              associated with the previous statement.
275
276       -LINE
277              The -LINE directive can be used to alter SNOBOL's  idea  of  the
278              current  source  file  and  line (ie; for use by preprocessors).
279              -LINE takes a line number and an optional  quoted  string  file‐
280              name.
281
282       Lexical comparison
283              A  full  set of lexical (string) comparison predicates have been
284              added to complement the standard LGT() function;  LEQ(),  LGE(),
285              LLE(), LLT(), LNE().
286
287       LPAD()/RPAD()
288              The  LPAD()  and  RPAD() functions take the first argument (sub‐
289              ject) string, and pad it out to the length specified in the sec‐
290              ond  argument,  using  the first character of the optional third
291              argument.  If the third argument is  missing,  or  is  the  null
292              string,  spaces  will  be used for padding.  The subject will be
293              returned unmodified if already long enough.
294
295       Named files
296              Filenames can be supplied to the INPUT() and OUTPUT()  functions
297              via  an optional fourth argument.  If the filename begins with a
298              vertical bar (|), the remainder is used as a shell command whose
299              stdin  (in  the  case  of  OUTPUT())  or  stdout (in the case of
300              INPUT()) will be connected to the file variable via a pipe.   If
301              a  pipe is opened by INPUT() input in "update" mode, the connec‐
302              tion will be bi-directional  (on  systems  with  socketpair  and
303              Unix-domain sockets).  The filename - (hyphen) is interpreted as
304              stdin on INPUT() and stdout on OUTPUT().   The  magic  filenames
305              /dev/stdin,  /dev/stdout,  and  /dev/stderr refer to the current
306              process standard input, standard output and standard  error  I/O
307              streams  respectively  regardless of whether those special file‐
308              names exist on your system.  The magic pathname /dev/fd/n, opens
309              a  new I/O stream associated with file descriptor number n.  The
310              magic pathname /tcp/hostname/service can be used to open connec‐
311              tion  to  a  TCP server. If the path ends in the optional suffix
312              /priv the local address will be bound to  a  port  number  below
313              1024,   if   process  privileges  allow.   /udp/hostname/service
314              behaves similarly for  UDP.   The  magic  pathname  /dev/tmpfile
315              opens  an  anonymous temporary file for reading and writing, see
316              tmpfile(3).  On VMS,  Win32,  and  MS-DOS  (when  compiled  with
317              DJGPP),  the  pathnames  /dev/null and /dev/tty are magical, and
318              refer to the  null  device,  and  the  user's  terminal/console,
319              respectively.
320
321       ORD()
322              The  ORD()  function  returns the ordinal value (zero to 255) of
323              the first character in it's string argument (the inverse of  the
324              CHAR() function).
325
326       &PARM
327              The  entire  command  line  is available via the &PARM protected
328              keyword for compatibility with  Catspaw  SNOBOL4+.  Use  of  the
329              SPITBOL compatible HOST() function is probably preferable.
330
331       REAL numbers in INTEGER contexts
332              REAL  numbers  (or  strings convertible to REAL) are accepted in
333              all contexts which previously required  an  INTEGER  (or  string
334              convertible  to  INTEGER).   Contexts  include  TABLE(), ITEM(),
335              array indices, INPUT(), OUTPUT(), SET(), keyword values, CHAR(),
336              RPAD(),  LPAD(),  FIELD(),  COLLECT(),  DUMP(), DUPL(), OPSYN(),
337              SUBSTR().
338
339       REVERSE()
340              REVERSE() returns it's subject string in reverse order.
341
342       Scientific notation
343              REAL number syntax has been expanded to allow exponents  of  the
344              form:
345              ANY('Ee') ('+' | '-' | '') SPAN('0123456789').  Exponential for‐
346              mat reals need not contain a decimal point.
347
348       SERV_LISTEN()
349              The SERV_LISTEN() function makes SNOBOL4 into a  network  server
350              process,  and  takes  three STRING arguments: FAMILY, TYPE, SER‐
351              VICE.  FAMILY must be either "inet" for an Internet Protocol  v4
352              socket,  "inet6"  for  an Internet Protocol v6 socket, or "unix"
353              for a local ("unix domain") socket.  The second  argument,  TYPE
354              must be "stream", and the third argument, SERVICE must be a port
355              number or service name (for an internet socket), or  a  pathname
356              (for  a  "unix"  socket).   SERV_LISTEN()  listens  for incoming
357              requests, accepts them, then "forks" a child process and returns
358              an integer file descriptor which can be opened for bidirectional
359              I/O using a "/dev/fd/n" magic pathname.  The original ("parent")
360              process  never  returns from the SERV_LISTEN() call.  This func‐
361              tion is only available on systems with the "fork"  system  call,
362              which  makes  a  child process which is an identical copy of the
363              parent process.
364
365       SET()
366              The SET() function can be used to seek the file  pointer  of  an
367              open file.  The first argument is an I/O unit number, the second
368              is an integer offset.  The third argument, an integer determines
369              from  whence  the  file  pointer will be adjusted.  If whence is
370              zero the starting point is the beginning of the file, if  whence
371              is  one,  the starting point is the current file pointer, and if
372              whence is two, the starting point is the end of the file.  SET()
373              returns the new file pointer value.  On systems with 64-bit file
374              pointers and 32-bit integers (ie; 4.4BSD  on  i386)  the  return
375              value  will be truncated to 32-bits, and only the first and last
376              4 gigabytes of a file can be accessed directly.
377
378       SITBOL file functions
379              FILE(string) is a predicate which returns  the  null  string  if
380              it's argument is the name of a file that exists, and fails if it
381              does not.  DELETE(string) is a predicate which tries  to  remove
382              the  file  named  by  it's  argument,  and  fails  if it cannot.
383              RENAME(string1,string2) is a predicate which attempts to  rename
384              the  file named by string2 to the file named by string1.  Unlike
385              the SITBOL version, if  the  target  file  exists,  it  will  be
386              removed.
387
388       SNOBOL4+ real functions
389              EXP(),  LOG() and CHOP() functions are available for compatibil‐
390              ity with SNOBOL4+.  EXP()  returns  the  value  e  **  x,  LOG()
391              returns  the natural logarithm of it's REAL argument, and CHOP()
392              truncates the fractional part of it's  REAL  argument  (rounding
393              towards zero), and returns a REAL.
394
395       SORT()/RSORT()
396              The  SORT() and RSORT() functions take two arguments.  The first
397              can be either an array or a table.  If the first argument is  an
398              array,  it  may  be  singly-dimensioned in which case the second
399              argument, if non-null should indicate the name of a field  of  a
400              programmer  defined  data  type  to  use to access the sort key.
401              Otherwise the first argument should be  a  table  or  a  doubly-
402              dimensioned  array,  in  which  case  the second argument may an
403              integer indicating the array column on which to  sort.   If  the
404              second argument is null, it is taken to be 1.  The array (or ta‐
405              ble) is not modified; a new array  is  allocated  and  returned.
406              SORT() sorts elements in ascending order, while RSORT() sorts in
407              descending order.
408
409              Example: for a table TAB of integers, indexed by  strings  being
410              used  to  tabulate  word  counts  FREQ = RSORT(TAB,2) returns an
411              array such that FREQ<1,1> contains the most frequent word  while
412              FREQ<1,2>  contains  the  number  of  occurrences  of that word.
413              While WORDS = SORT(TAB,1) returns an array with the rows by  the
414              lexicographical  ordering  of the words; WORDS<1,1> contains the
415              lexicographically first word and WORDS<1,2> contains the  number
416              of occurrences of that word.
417
418       SPITBOL operators
419              The  SPITBOL  scan  (?)  and  assignment (=) operators have been
420              added.  A pattern match can appear  within  an  expression,  and
421              returns  the matched string as it's value.  Similarly assignment
422              can appear in an expression, and returns the assigned value.  An
423              assignment  after a scan (ie; STRING ? PATTERN = VALUE) performs
424              a scan and replace.  Assignment is right  associative,  and  has
425              the  lowest precedence, while scan is left associative and has a
426              precedence just higher than assignment.
427
428              The SPITBOL selection/alternative construction can  be  used  in
429              any  expression.   It  consists  of  a  comma  separated list of
430              expressions inside parentheses.  The expressions  are  evaluated
431              until  one  succeeds, and it's value is returned.  Abuse of this
432              construction may result in incomprehensible code.
433
434              The type NUMERIC with CONVERT() and the removal of leading  spa‐
435              ces from strings converted to numbers (implicitly or explicitly)
436              are also legal when SPITBOL  extensions  are  enabled.   SPITBOL
437              extensions can be enabled and disabled using the -PLUSOPS direc‐
438              tive.  -PLUSOPS 0 disables SPITBOL operators, while -PLUSOPS  or
439              -PLUSOPS  n where n is a non-zero integer enables them.  SPITBOL
440              extensions are enabled by default.
441
442       SQRT()
443              The SQRT() function is available for  compatibility  with  SPARC
444              SPITBOL.  SQRT() fails if the argument is negative, but does not
445              cause a fatal error.
446
447       SSET()
448              Experimental "scaled set" function.  Takes arguments unit,  off‐
449              set,  whence,  and  scale.  The first three are analogous to the
450              same arguments for the SET() function.  The  last  parameter  is
451              used as a multiplicative scaling factor on the offset parameter,
452              and as a divisor on the return value.  When used in  combination
453              with  relative  SET() calls (whence of one), any file offset can
454              be achieved, even when system file offsets are larger  than  can
455              be  represented in a SNOBOL4 INTEGER.  Support for "Large Files"
456              is enabled when available, but  not  all  file  systems  support
457              them.
458
459       SUBSTR()
460              SUBSTR()  takes  a  subject  string  as it's first argument, and
461              returns the substring starting at the position specified by  the
462              second argument (one-based) with a length specified by the third
463              argument.  If the third argument is missing or zero, the remain‐
464              der of the string is returned.
465
466       TERMINAL I/O variable
467              The variable TERMINAL is associated with the standard error file
468              descriptor for both input and output.
469
470       Trig functions
471              SIN(), COS() and TAN() functions are available for compatibility
472              with SPARC SPITBOL and take arguments in radians.
473
474       &UCASE/&LCASE
475              Protected  keywords  &UCASE  and  &LCASE contain upper and lower
476              case characters respectively.
477
478       VDIFFER()
479              The VDIFFER() function takes two arguments,  if  they  DIFFER(),
480              the  first argument's value is returned.  This is intended to be
481              used in contexts where DIFFER(X) X  would  otherwise  have  been
482              used.   The VDIFFER() function was copied from Steve Duff's ver‐
483              sion of Macro SPITBOL.
484
485
486   I/O Associations
487       I/O is performed by associating a variable name  with  a  numbered  I/O
488       unit  using the INPUT() and OUTPUT() functions.  The following associa‐
489       tions are available by default;
490
491       Variable  Unit      Association
492       INPUT     5         standard input
493       OUTPUT    6         standard output
494       TERMINAL  7         standard error (output)
495       TERMINAL  8         /dev/tty (input)
496
497
498   I/O Options
499       The third argument of the INPUT() and OUTPUT() functions is interpreted
500       as a string of single letter options, commas are ignored.  Some options
501       effect only the I/O variable named in the first argument, others effect
502       any variable associated with the unit number in the second argument.
503
504       digits A  span of digits will set the input record length for the named
505              I/O variable.  This controls the maximum  string  that  will  be
506              returned  for regular text I/O, and the number of bytes returned
507              for binary I/O.  Record length is per-variable;  multiple  vari‐
508              ables  may  be associated with the same unit, but with different
509              record lengths.
510
511       A      For OUTPUT() the unit will be opened for append  access   (no-op
512              for INPUT()).
513
514       B      The  unit  will  be  opened for binary access.  On input newline
515              characters have no special meaning; the number of  bytes  trans‐
516              ferred  depends  on record length (see above). On output no new‐
517              line is appended.  For terminal devices, all I/O  to  this  unit
518              will be done without special processing for line editing or EOF,
519              while characters which deliver signals  (interrupt,  kill,  sus‐
520              pend)  are  still  processed.  Units opened on the same terminal
521              device entry operate independently; some can  use  binary  mode,
522              while others operate in text mode.
523
524       C      Character at a time I/O.  A synonym for B,1.
525
526       T      Terminal  mode.   No newline characters are added on output, and
527              any newline characters are returned  on  input.   Terminal  mode
528              effects  only  the referenced unit.  Terminal mode is useful for
529              outputting prompts in interactive programs.
530
531       Q      Quiet mode.  Turns off input echo on  terminals.   Effects  only
532              input from this unit.
533
534       U      Update mode.  The unit is opened for both input and output.
535
536       W      Unbuffered  writes.   Each  output variable assignment causes an
537              I/O transfer to occur, rather than collecting the data in a buf‐
538              fer for efficiency.
539
540

OPTIONS

542       -b        Toggle startup banner output (by default on).
543
544       -d DDD    Allocate “dynamic storage” region of DDD descriptors for pro‐
545                 gram code and data. A suffix of k multiplies  the  number  by
546                 1024,  a  suffix  of  m  multiplies the number by 1048576.  A
547                 larger dynamic region may result in fewer garbage collections
548                 (storage  regenerations), however large values may cause exe‐
549                 cution to slow down when large amounts  of  garbage  collect.
550                 Most programs do not need an increased dynamic region to run.
551                 If your program terminates with an “Insufficient  storage  to
552                 continue”  message  you  need to increase the dynamic storage
553                 region size.
554
555       -f        Toggle folding of identifiers to upper case  (see  -CASE  and
556                 &CASE).
557
558       -g        Enable garbage collection tracing (sets &GTRACE to -1).
559
560       -h        Give  help.  Shows  usage message, includes default sizes for
561                 “dynamic region” and pattern match stack.
562
563       -k        Toggle running programs with compilation errors  (see  -ERROR
564                 and -NOERRORS extensions).  By default programs with compila‐
565                 tion errors will not be run.
566
567       -l        Re-enable listing to stdout.  (default is -UNLIST).   Default
568                 listing side is LEFT.
569
570       -n        Toggle  running  programs after compilation (see -EXECUTE and
571                 -NOEXECUTE extensions).  By default programs  are  run  after
572                 compilation.
573
574       -p        Toggle SPITBOL extensions (also controlled by -PLUSOPS).
575
576       -r        Toggle  reading  INPUT  from  input  file(s) after END label.
577                 Otherwise INPUT defaults (back) to standard input after  pro‐
578                 gram compilation is complete.
579
580       -s        Toggle termination statistics (off by default).
581
582       -u params specifies a parameter string available via HOST(0).
583
584       -v        Show version and exit.
585
586       --        Terminates processing items as options. Any remaining strings
587                 are treated as files or user parameters.
588
589       -M        Specifies that all items  left  on  the  command  line  after
590                 option processing is complete are to be treated as filenames.
591                 The files are read in turn until an END  statement  is  found
592                 (Any  remaining  data  is available via the INPUT variable if
593                 the -r option is also given).  A -- terminates processing  of
594                 arguments  as files, and makes the remaining arguments avail‐
595                 able as user parameters (see the HOST() function).
596
597       -P DDD    Allocate DDD descriptors for the pattern match stack.  A suf‐
598                 fix  of k multiplies the number by 1024, a suffix of m multi‐
599                 plies the number by 1048576.  The pattern match stack is used
600                 to  save  backtracking and conditional assignment information
601                 during pattern matching.  If your program terminates with  an
602                 “Overflow  during  pattern  matching”  message (Error 16) you
603                 need to increase the pattern match stack size.
604
605       -S DDD    Allocate DDD descriptors for the interpreter stack.  A suffix
606                 of  k multiplies the number by 1024, a suffix of m multiplies
607                 the number by 1048576.  The interpreter  stack  is  used  for
608                 saving  data,  and passing parameters to internal procedures.
609                 If your program terminates with an “Stack  overflow”  message
610                 (Error  21)  you need to increase the interpreter stack size.
611                 A common reason for needing additional  stack  space  is  for
612                 tracing  deeply  nested DATA() structures during garbage col‐
613                 lection.
614
615

SEE ALSO

617       snobol4dbm(3),snobol4tcl(3),snolib(3).
618
619
620       http://www.snobol4.org
621              All things SNOBOL4 related.
622
623
624       http://www.snobol4.com
625              Catspaw: commercial SPITBOL implementations, Free  SNOBOL4+  for
626              DOS.
627
628
629       http://www.snobol4.org/doc/burks/tutorial/contents.htm
630              SNOBOL4 language tutorial (from Catspaw Vanilla SNOBOL4)
631
632
633       http://www.snobol4.org/doc/burks/manual/contents.htm
634              Catspaw Vanilla SNOBOL4 manual.
635
636
637       ftp://ftp.snobol4.com/spitman.pdf
638              Catspaw Macro SPITBOL manual
639
640
641       [1] R. E. Griswold, J. F. Poage, and I. P. Polonsky
642              The  SNOBOL4  Programming Language, 2nd ed., Prentice-Hall Inc.,
643              1971.
644              Reference manual for Macro SNOBOL4.  (soon to be available as  a
645              PDF!!!)
646
647
648       [2] R. E. Griswold,
649              The  Macro  Implementation  of  SNOBOL4,  W. H. Freeman and Co.,
650              1972.
651              Book describing the  implementation  techniques  used  in  Macro
652              SNOBOL4.
653
654
655       ftp://ftp.snobol4.org/snobol/doc/
656              Directory  with sources for University of Arizona SNOBOL4 memos,
657              including formatted versions of memo s4d58, which describes each
658              pseudo-instruction in the Snobol Implementation Language (SIL).
659
660

AUTHOR

662       Philip L. Budne
663
664       with a little help from:
665
666       R. E. Griswold, J. F. Poage, and I. P. Polonsky
667
668       Mark Emmer (code from SNOBOL4+)
669
670       Viktors Berstis (code from Minnesota SNOBOL4)
671
672

DIAGNOSTICS

674       “Insufficient storage to continue” (error 20)
675              “Dynamic” storage exhausted. See the -d option.
676
677
678       “Stack overflow” (error 21)
679              Interpreter stack exhausted. See the -S option.
680
681

BUGS

683       I/O retains some record oriented flavor.
684
685       I/O is still tied to unit numbers.
686
687       “Dynamic” storage cannot be expanded after startup.
688
689       Integer math can never "fail", even on overflow.
690
691       Oversize integer constants may not be detected.
692
693
694
695Local                             09 Dec 2008                       SNOBOL4(1)
Impressum