3 ms·
I wrote one of these in 2002, back in college, after being inspired by Icon and SNOBOL. From Wikipedia: s := "this is a string" s ? {
by ebiester 6y ago
I wrote one of these in 2002, back in college, after being inspired by Icon and SNOBOL. From Wikipedia:
s := "this is a string"
s ? { # Establish string scanning environment
while not pos(0) do { # Test for end of string
tab(many(' ')) # Skip past any blanks
word := tab(upto(' ') | 0) # the next word is up to the next blank -or- the end of the line
write(word) # write the word
}
}
I really think we lost out when we went toward regular expressions rather than SNOBOL/Icon syntax, but I don't think a direct substitute is as much the issue.