author | berghofe |
Wed, 07 Feb 2007 17:30:53 +0100 | |
changeset 22264 | 6a65e9b2ae05 |
parent 22188 | a63889770d57 |
child 22386 | 4ebe883b02ff |
permissions | -rw-r--r-- |
21147 | 1 |
structure ROOT = |
2 |
struct |
|
3 |
||
4 |
structure Code_Generator = |
|
5 |
struct |
|
6 |
||
22188
a63889770d57
adjusted manual to improved treatment of overloaded constants
haftmann
parents:
22015
diff
changeset
|
7 |
type 'a eq = {Code_Generator__op_eq : 'a -> 'a -> bool}; |
a63889770d57
adjusted manual to improved treatment of overloaded constants
haftmann
parents:
22015
diff
changeset
|
8 |
fun op_eq (A_:'a eq) = #Code_Generator__op_eq A_; |
21147 | 9 |
|
10 |
end; (*struct Code_Generator*) |
|
11 |
||
12 |
structure List = |
|
13 |
struct |
|
14 |
||
22188
a63889770d57
adjusted manual to improved treatment of overloaded constants
haftmann
parents:
22015
diff
changeset
|
15 |
fun memberl A_ x (y :: ys) = |
22015 | 16 |
Code_Generator.op_eq A_ x y orelse memberl A_ x ys |
22188
a63889770d57
adjusted manual to improved treatment of overloaded constants
haftmann
parents:
22015
diff
changeset
|
17 |
| memberl A_ x [] = false; |
21147 | 18 |
|
19 |
end; (*struct List*) |
|
20 |
||
21 |
structure Codegen = |
|
22 |
struct |
|
23 |
||
22188
a63889770d57
adjusted manual to improved treatment of overloaded constants
haftmann
parents:
22015
diff
changeset
|
24 |
fun collect_duplicates A_ xs ys (z :: zs) = |
21147 | 25 |
(if List.memberl A_ z xs |
26 |
then (if List.memberl A_ z ys then collect_duplicates A_ xs ys zs |
|
27 |
else collect_duplicates A_ xs (z :: ys) zs) |
|
21994 | 28 |
else collect_duplicates A_ (z :: xs) (z :: ys) zs) |
22188
a63889770d57
adjusted manual to improved treatment of overloaded constants
haftmann
parents:
22015
diff
changeset
|
29 |
| collect_duplicates A_ y ys [] = y; |
21147 | 30 |
|
31 |
end; (*struct Codegen*) |
|
32 |
||
33 |
end; (*struct ROOT*) |