| 1 |
/* |
| 2 |
* @progname rootset.ll |
| 3 |
* @version 0.5 |
| 4 |
* @author Robert Simms |
| 5 |
* @category |
| 6 |
* @output Text |
| 7 |
* @description |
| 8 |
|
| 9 |
Given a list of surnames, finds the set of all people with those |
| 10 |
surnames, then reports on the heads of each line within that set. |
| 11 |
*/ |
| 12 |
proc main() { |
| 13 |
indiset(rootset) |
| 14 |
indiset(tempset) |
| 15 |
|
| 16 |
getstr(surname, "Specify a surname") |
| 17 |
while(nestr(surname, "")) { |
| 18 |
genindiset(concat("*/", surname), tempset) |
| 19 |
set(rootset, tempset) |
| 20 |
getstr(surname, "Specify another surname [return if done]") |
| 21 |
} |
| 22 |
|
| 23 |
set( tempset, childset(rootset)) |
| 24 |
set( rootset, difference(rootset, tempset)) |
| 25 |
call lprintset(rootset) |
| 26 |
call printset(rootset) |
| 27 |
} |
| 28 |
|
| 29 |
proc printset(x) { |
| 30 |
forindiset(x, x_ind, y, x_n) { |
| 31 |
key(x_ind) " - " name(x_ind) nl() |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
proc lprintset(x) { |
| 36 |
forindiset(x, x_ind, y, x_n) { |
| 37 |
print(key(x_ind), " - ", name(x_ind), nl()) |
| 38 |
} |
| 39 |
} |