1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2004-2008 Jean Privat <jean@pryen.org>
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
27 # Ancestor: "Object" on "Hashable"
43 class Pair[F
: Hashable]
46 # Ancestor: "ANY": "Object" on "Pair[E: Object]"
47 # "HASHABLE": "Hashable" on "Pair[F: Hashable]"
49 class PairCmp[G
: Comparable]
53 # Ancestor: "PAIR": "Pair[G]" on "PairCmp[G: Comparable]"
54 # => "ANY": "Object" on "PairCmp[G: Comparable]"
55 # => "HASHABLE": "Hashable" on "PairCmp[G: Comparable+Hahsable]"
56 # Ancestor: "COMPARABLE": "Comparable" on "PairCmp[G: Comparable]"
61 # Ancestor: "PAIRCMP": "PairCmp[Int]" on "Complex"
62 # => "PAIR": "Pair[Int]" on "Complex"
63 # => "ANY": "Object" on "Complex"
64 # => "HASHABLE": "Hashable" on "Complex"
66 # Un ancètre d'une classe c est un couple de types (ancetre, héritier) où héritier est dérivé de c
67 # les ancètres indirects de c par la filiation (a, h) sont
68 # pour chaque ancètres (aa, ha) de la classe de a
71 # un type a un contexte.
72 # Les ancetres d'une classes c sont un tas de types dont le contexte est dérivé de la classe c
75 # application: type1 x type2 x type3 -> type4 (ex "A[U]" x "A[E: T]" x "B[E,C]" -> "B[U,C]")
76 # * map: type1 x type2 -> hash (ex "A[U] x A[E: T]" -> {E->U})
77 # * betared: hash x type3 -> type4 (ex {E->U} x "B[E,C]" -> "B[U,C]"
78 # * application(x,y,z) = betared(map(x,y), z)
80 # * type2 est la liste des parametres formels
81 # * type1 peut contenir des paramètres formels
82 # ... l'application est plus compliquée
84 # application("Pair[Comparable]", "Pair[E: Comparable]", )