I'm having a hard time understanding the parenthetical. If you grok it, and could take a moment to explain it in your own words -- or give an example of its use -- I'd very much appreciate it. Thanks!
If you have a pattern that matches FIRSTNAME and another that matches LASTNAME, roughly:
FULLNAME = FIRSTNAME LASTNAME
Whitespace is a catenation operator, and catenating two patterns gives you a new pattern that matches a string matching the first and the second pattern.
Maybe you want to handle old-school people like raganwald:
OLDSCHOOLNAME = LASTNAME ‘, ‘ FIRSTNAME
Or both:
ANYNAME = FULLNAME | OLDSCHOOLNAME
The vertical bar is an alternate operator.
Regular expressions work the same way, but in most languages, the regular expression language is really a DSL embedded in the syntax for a regular expression literal. Whereas in SNOBOL, all those operators are ordinary language operators and you can use them anywhere.
How does that differ from a parser combinator library beyond that it's baked into the language? It took a few decades for other languages to catch up, but patterns being first-class objects that can be combined in various ways isn't that unusual. For example, in Lua with LPeg those examples would be:
full_name = first_name * last_name
old_school_name = last_name * P', ' * first_name
any_name = full_name + old_school_name
(* is sequence, + is or, P is a function that converts a string to a pattern)
While I don't remember enough Snobol to say, in Icon every expression may participate in the pattern-matching search process. For example, `a < b` doesn't produce a boolean value, it either fails (cutting off the current branch of the search) or succeeds (producing b's value as its value, so you can write `a < b < c` with the conventional meaning without any special handling of that form of comparison).
That's the kind of way that patterns are more deeply baked into these languages.
I don't think that's quite the same, as Perl 6 isolates the grammar DSL to grammar blocks, but it would be trivial to make something in Perl 6 that is equivalent, if there isn't already, by defining operators between tokens and grammars in Perl 6 to accomplish the same thing.
IIUC grammars are also first class in Perl 6, but it isolates their DSL to grammar blocks. I'm not sure of the specifics of each to note whether one is capable of easily doing something the other can't or has a hard time with, but it looks to boil down to SPITBAL's implementation being slightly easier to access as there's no grammar block required, and Perl 6's being slightly more clear and self documenting, due to that same requirement.
Note: I've yet to use either, so someone with more experience, possibly you, might be able to correct my misunderstandings.
I think it's saying that "patterns" are themselves values that have operations you can perform on them. For example, adding to patterns, or subtracting from them, or concatenating them, etc.
I don't know SNOBOL though, so I'm having a hard time picturing what the actual implications of that are, or exactly how it works. But I'm intrigued enough now that I want to go read this "Green Book" and see what it's all about.