File: rootset.ll

package info (click to toggle)
lifelines 3.0.50-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 11,140 kB
  • ctags: 6,517
  • sloc: ansic: 57,468; xml: 8,014; sh: 4,255; makefile: 848; yacc: 601; perl: 170; sed: 16
file content (39 lines) | stat: -rw-r--r-- 1,030 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * @progname       rootset.ll
 * @version        0.5
 * @author         Robert Simms
 * @category       
 * @output         Text
 * @description

   Given a list of surnames, finds the set of all people with those
   surnames, then reports on the heads of each line within that set.
*/
proc main() {
        indiset(rootset)
        indiset(tempset)

        getstr(surname, "Specify a surname")
        while(nestr(surname, "")) {
                genindiset(concat("*/", surname), tempset)
                set(rootset, tempset)
                getstr(surname, "Specify another surname [return if done]")
        }

        set( tempset, childset(rootset))
        set( rootset, difference(rootset, tempset))
        call lprintset(rootset)
        call printset(rootset)
}

proc printset(x) {
        forindiset(x, x_ind, y, x_n) {
                key(x_ind) " - " name(x_ind) nl()
        }
}

proc lprintset(x) {
        forindiset(x, x_ind, y, x_n) {
                print(key(x_ind), " - ", name(x_ind), nl())
        }
}