Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] implementing the visitor pattern in ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-10-14 (10:13)
From: Samuel Lacas <Samuel.Lacas@t...>
Subject: Re: [Caml-list] implementing the visitor pattern in ocaml
Hi, you need to use coercions here (at least, that's the way it works
with me). Simply declare

method accept (v : abstractvisitor) = v#visit_foo(self :> foo)

in class foo.
Have a look at section 3.11 of the manual for more information.

Hope this helps,


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: