everycat.icn: Procedure for generating all concatenations

link everycat
April 25, 1992; Ralph E. Griswold
This file is in the public domain.

 everycat(x1, x2, ...) generates the concatenation of every string
 from !x1, !x2, ... .

 For example, if

     first := ["Mary", "Joe", "Sandra"]
     last := ["Smith", "Roberts"]

 then

     every write(everycat(first, " ", last))

 writes

     Mary Smith
     Mary Roberts
     Joe Smith
     Joe Roberts
     Sandra Smith
     Sandra Roberts

Note that x1, x2, ... can be any values for which !x1, !x2, ... produce
strings or values convertible to strings.  In particular, in the example
above, the second argument is a one-character string " ", so that !" "
generates a single blank.

Source code | Program Library Page | Icon Home Page