Commit 670c7a8f authored by POTTIER Francois's avatar POTTIER Francois

Merged the auxiliary class [scope] into [free].

parent fd366bf8
......@@ -14,23 +14,16 @@
(* -------------------------------------------------------------------------- *)
(* The auxiliary class [scope] defines the environment to be a set of atoms
(* The auxiliary class [free] defines the environment to be a set of atoms
(the atoms that are currently in scope). It defines the method [extend]
so as to update this set. *)
class ['self] scope = object (_ : 'self)
method private extend = Atom.Set.add
end
(* -------------------------------------------------------------------------- *)
(* The auxiliary class [free] inherits [scope] and further defines the method
[visit_'fn] so that, at a free name occurrence: -1. if the name is local,
nothing happens; -2. if the name is free, then the method [visit_free] is
invoked. *)
(* Furthermore, this class defines the method [visit_'fn] so that, at a free
name occurrence: -1. if the name is local, nothing happens; -2. if the name
is free, then the method [visit_free] is invoked. *)
class virtual ['self] free = object (self : 'self)
inherit [_] scope
method private extend = Atom.Set.add
method private visit_'fn env x =
if not (Atom.Set.mem x env) then
self#visit_free x
......
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