Understanding Functions and Predicates
SNOBOL provides a rich set of functions, including primitive and predicate, and a mechanism for creating user-defined functions.
Primitive Functions
Primitive functions in SNOBOL are similar to those in languages like Python or C, returning a value for subsequent use. Key examples include the following:
- ANY(str).
-
Generates a pattern that matches any one character from str. This function is complementary to NOTANY(str).
- ARBNO(pattern).
-
Generates a pattern that matches any number of repetitions of the pattern.
- APPLY(func,p1,...,pn).
-
Applies function named func with at least n parameters to the parameters p1, ..., pn.
- BREAK(str).
-
Generates a pattern that matches strings not containing any character from str ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access