##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: September 2016 # Modified: 2016-10-03/21:29-0400 ##+ # # Abort.icn, demonstrate SNOBOL style pattern match abort # procedure main() write("match a or b, but abort (fail) if 1 is found first") pat := Any("ab") .| "1" || Abort() tests := ["ab1", "b1a", "1ab", "xzyab1", "xzy1ba"] every s := !tests do if s ?? pat then write(s || " matched") else write(s || " aborted") end