summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSon Ho2021-12-07 10:22:36 +0100
committerSon Ho2021-12-07 10:22:36 +0100
commitf6e979127b60709db8d736b9d69c72e6d28863ad (patch)
treef8ed49b782dc05072cc963e058eadcf45a3738e3
parentc6e2bfa1751192a0bbc5729df74a1b5c08b3cf26 (diff)
Add comments
Diffstat (limited to '')
-rw-r--r--src/Values.ml16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Values.ml b/src/Values.ml
index 7b5e9537..9a932fc2 100644
--- a/src/Values.ml
+++ b/src/Values.ml
@@ -346,7 +346,21 @@ type abs = {
which are a special kind of value.
*)
-class virtual ['self] map_g_value =
+(** Monomorphic version of the map visitor for [g_typed_value].
+
+ The type variables are quantified at the level of the class (not at the
+ level of each method). As a consequence, the visit methods don't need to
+ take closures as parameters.
+
+ The polymorphic visitor generated by the visitors macro caused some
+ trouble: it was in some cases not possible to override a function
+ to refine the behaviour of a visitor. With this version, it is
+ possible. Note that this works only because the polymorphism of
+ [g_value], [g_adt_value], etc. is "uniform": the type instantiation
+ is always the same.
+
+*)
+class virtual ['self] map_g_typed_value =
object (self : 'self)
inherit [_] VisitorsRuntime.map