Commit 4e010cca authored by POTTIER Francois's avatar POTTIER Francois

Comments.

parent 0e17d991
......@@ -26,9 +26,9 @@ type ('bn, 'term) abs =
(* We need one class per variety of visitor, which is a bit painful. *)
(* The method [visit_abstraction] is polymorphic in the type of terms. This is
important, as it means that one can use several instances of [abstraction]
in a single type definition and still be able to construct well-typed
(* The method [visit_abs] is polymorphic in the type of terms. This is
important, as it means that one can use several instances of [abs] in a
single type definition and still be able to construct well-typed
visitors. *)
(* The virtual methods [extend] and [restrict] are not polymorphic in the
......@@ -38,6 +38,10 @@ type ('bn, 'term) abs =
(* Because [iter] and [iter2] are special cases of [reduce] and [reduce2],
respectively, we define them that way, so as to save effort. *)
(* -------------------------------------------------------------------------- *)
(* [map] *)
class virtual ['self] map = object (self : 'self)
method private visit_'bn: void -> void -> void
......@@ -55,6 +59,10 @@ class virtual ['self] map = object (self : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [endo] *)
class virtual ['self] endo = object (self : 'self)
method private visit_'bn: void -> void -> void
......@@ -76,6 +84,10 @@ class virtual ['self] endo = object (self : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [reduce] *)
class virtual ['self] reduce = object (self : 'self)
method private visit_'bn: void -> void -> void
......@@ -95,6 +107,10 @@ class virtual ['self] reduce = object (self : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [iter] *)
class virtual ['self] iter = object (_ : 'self)
inherit ['self] reduce
......@@ -103,6 +119,10 @@ class virtual ['self] iter = object (_ : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [map2] *)
class virtual ['self] map2 = object (self : 'self)
method private visit_'bn: void -> void -> void -> void
......@@ -120,6 +140,10 @@ class virtual ['self] map2 = object (self : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [reduce2] *)
class virtual ['self] reduce2 = object (self : 'self)
method private visit_'bn: void -> void -> void -> void
......@@ -139,6 +163,10 @@ class virtual ['self] reduce2 = object (self : 'self)
end
(* -------------------------------------------------------------------------- *)
(* [iter2] *)
class virtual ['self] iter2 = object (_ : 'self)
inherit ['self] reduce2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment